diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-07-07 14:00:25 +1000 |
|---|---|---|
| committer | David Gibson <david@gibson.dropbear.id.au> | 2026-07-13 13:29:13 +1000 |
| commit | be00a4c0214d04d2a945c7956c5c8f76816d9950 (patch) | |
| tree | 6dce9d46c193140d39b4f4909b2affad4c522e45 | |
| parent | d5754259ac9d8cd554a65354bbed5b2cab840d0e (diff) | |
| download | passt-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |
