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 5a59f7f3..f59649f6 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);
--
2.55.0