From 4e2d36e83fb1ff86c2e7f6d0832827d59f829934 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 18 Jul 2024 15:26:28 +1000 Subject: flow: Common address information for target side Require the address and port information for the target (non initiating) side to be populated when a flow enters TGT state. Implement that for TCP and ICMP. For now this leaves some information redundantly recorded in both generic and type specific fields. We'll fix that in later patches. For TCP we now use the information from the flow to construct the destination socket address in both tcp_conn_from_tap() and tcp_splice_connect(). Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- icmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'icmp.c') diff --git a/icmp.c b/icmp.c index 9b95be2..ebfa627 100644 --- a/icmp.c +++ b/icmp.c @@ -183,7 +183,8 @@ static struct icmp_ping_flow *icmp_ping_new(const struct ctx *c, return NULL; flow_initiate_af(flow, PIF_TAP, af, saddr, id, daddr, id); - flow_target(flow, PIF_HOST); + /* FIXME: Record outbound source address when known */ + flow_target_af(flow, PIF_HOST, af, NULL, 0, daddr, 0); pingf = FLOW_SET_TYPE(flow, flowtype, ping); pingf->seq = -1; -- cgit v1.2.3