aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-07-07 14:00:25 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2026-07-13 13:29:13 +1000
commitbe00a4c0214d04d2a945c7956c5c8f76816d9950 (patch)
tree6dce9d46c193140d39b4f4909b2affad4c522e45
parentd5754259ac9d8cd554a65354bbed5b2cab840d0e (diff)
downloadpasst-be00a4c0214d04d2a945c7956c5c8f76816d9950.tar
passt-be00a4c0214d04d2a945c7956c5c8f76816d9950.tar.gz
passt-be00a4c0214d04d2a945c7956c5c8f76816d9950.tar.bz2
passt-be00a4c0214d04d2a945c7956c5c8f76816d9950.tar.lz
passt-be00a4c0214d04d2a945c7956c5c8f76816d9950.tar.xz
passt-be00a4c0214d04d2a945c7956c5c8f76816d9950.tar.zst
passt-be00a4c0214d04d2a945c7956c5c8f76816d9950.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>
-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);