aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-07-13 15:38:53 +1000
committerStefano Brivio <sbrivio@redhat.com>2026-07-15 01:22:47 +0200
commit66fdabd85c3eac3a87979f05484de2c90af9a272 (patch)
treee44042a947bb73f8fb323455c1bd4be52a0ad4e7
parent26f2130de6dc3bba45bfab435531d909d219f7a6 (diff)
downloadpasst-66fdabd85c3eac3a87979f05484de2c90af9a272.tar
passt-66fdabd85c3eac3a87979f05484de2c90af9a272.tar.gz
passt-66fdabd85c3eac3a87979f05484de2c90af9a272.tar.bz2
passt-66fdabd85c3eac3a87979f05484de2c90af9a272.tar.lz
passt-66fdabd85c3eac3a87979f05484de2c90af9a272.tar.xz
passt-66fdabd85c3eac3a87979f05484de2c90af9a272.tar.zst
passt-66fdabd85c3eac3a87979f05484de2c90af9a272.zip
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--udp_flow.c2
1 files changed, 1 insertions, 1 deletions
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);