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-09 11:02:34 +1000 |
| commit | ee3090686b9184321913e351a036f17ba3a79648 (patch) | |
| tree | f7128c2196a9c9fcd04bda6cc6db0b620b2a9734 | |
| parent | 0d91b54eaf2ba12e584e6be985804b153cd792f6 (diff) | |
| download | passt-ee3090686b9184321913e351a036f17ba3a79648.tar passt-ee3090686b9184321913e351a036f17ba3a79648.tar.gz passt-ee3090686b9184321913e351a036f17ba3a79648.tar.bz2 passt-ee3090686b9184321913e351a036f17ba3a79648.tar.lz passt-ee3090686b9184321913e351a036f17ba3a79648.tar.xz passt-ee3090686b9184321913e351a036f17ba3a79648.tar.zst passt-ee3090686b9184321913e351a036f17ba3a79648.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); |
