aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tcp.c b/tcp.c
index c5431f1..286a417 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1666,7 +1666,7 @@ static void tcp_conn_from_tap(struct ctx *c, sa_family_t af,
if (!(flow = flow_alloc()))
return;
- flow_initiate(flow, PIF_TAP);
+ flow_initiate_af(flow, PIF_TAP, af, saddr, srcport, daddr, dstport);
flow_target(flow, PIF_HOST);
conn = FLOW_SET_TYPE(flow, FLOW_TCP, tcp);
@@ -2351,7 +2351,9 @@ void tcp_listen_handler(struct ctx *c, union epoll_ref ref,
if (s < 0)
goto cancel;
- flow_initiate(flow, ref.tcp_listen.pif);
+ /* FIXME: When listening port has a specific bound address, record that
+ * as the forwarding address */
+ flow_initiate_sa(flow, ref.tcp_listen.pif, &sa, ref.tcp_listen.port);
if (sa.sa_family == AF_INET) {
const struct in_addr *addr = &sa.sa4.sin_addr;