From ee3090686b9184321913e351a036f17ba3a79648 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 7 Jul 2026 14:00:25 +1000 Subject: udp: Validate that we have a unicast source address When creating a UDP flow from a socket we, correctly, check that the source address is unicast - multicast addresses are not valid as a source address. However, when creating a flow from tap we only check the source address is specified, not that it is unicast. Correct this. Signed-off-by: David Gibson --- udp_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udp_flow.c b/udp_flow.c index 5a59f7f..f59649f 100644 --- a/udp_flow.c +++ b/udp_flow.c @@ -307,7 +307,7 @@ flow_sidx_t udp_flow_from_tap(const struct ctx *c, ini = flow_initiate_af(flow, PIF_TAP, af, saddr, srcport, daddr, dstport); - if (inany_is_unspecified(&ini->eaddr) || ini->eport == 0 || + if (!inany_is_unicast(&ini->eaddr) || ini->eport == 0 || inany_is_unspecified(&ini->oaddr) || ini->oport == 0) { flow_dbg(flow, "Invalid endpoint on UDP packet"); flow_alloc_cancel(flow); -- cgit v1.2.3