[BUILD] proto_tcp: fix build issue with CTTPROXY
Recent sockaddr_storage changes broke the almost unused cttproxy code.
Fix is obvious.
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index d40f85c..3c8a04f 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -164,13 +164,13 @@
return 0;
#ifdef CONFIG_HAP_CTTPROXY
- if (!foreign_ok) {
+ if (!foreign_ok && remote->ss_family == AF_INET) {
struct in_tproxy itp1, itp2;
memset(&itp1, 0, sizeof(itp1));
itp1.op = TPROXY_ASSIGN;
- itp1.v.addr.faddr = bind_addr.sin_addr;
- itp1.v.addr.fport = bind_addr.sin_port;
+ itp1.v.addr.faddr = ((struct sockaddr_in *)&bind_addr)->sin_addr;
+ itp1.v.addr.fport = ((struct sockaddr_in *)&bind_addr)->sin_port;
/* set connect flag on socket */
itp2.op = TPROXY_FLAGS;