udp: Remove unnecessary test for unspecified addr_out
If the configured output address is unspecified, we don't set the bind address to it when creating a new socket in udp_tap_handler(). That sounds sensible, but what we're leaving the bind address as is, exactly, the unspecified address, so this test makes no difference. Remove it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
745fa38169
commit
90f1d3b354
1 changed files with 2 additions and 4 deletions
6
udp.c
6
udp.c
|
@ -878,8 +878,7 @@ int udp_tap_handler(struct ctx *c, uint8_t pif,
|
||||||
if (!IN4_IS_ADDR_LOOPBACK(&s_in.sin_addr))
|
if (!IN4_IS_ADDR_LOOPBACK(&s_in.sin_addr))
|
||||||
bind_if = c->ip4.ifname_out;
|
bind_if = c->ip4.ifname_out;
|
||||||
|
|
||||||
if (!IN4_IS_ADDR_UNSPECIFIED(&c->ip4.addr_out) &&
|
if (!IN4_IS_ADDR_LOOPBACK(&s_in.sin_addr))
|
||||||
!IN4_IS_ADDR_LOOPBACK(&s_in.sin_addr))
|
|
||||||
bind_addr = c->ip4.addr_out;
|
bind_addr = c->ip4.addr_out;
|
||||||
|
|
||||||
s = sock_l4(c, AF_INET, IPPROTO_UDP, &bind_addr,
|
s = sock_l4(c, AF_INET, IPPROTO_UDP, &bind_addr,
|
||||||
|
@ -930,8 +929,7 @@ int udp_tap_handler(struct ctx *c, uint8_t pif,
|
||||||
if (!IN6_IS_ADDR_LOOPBACK(&s_in6.sin6_addr))
|
if (!IN6_IS_ADDR_LOOPBACK(&s_in6.sin6_addr))
|
||||||
bind_if = c->ip6.ifname_out;
|
bind_if = c->ip6.ifname_out;
|
||||||
|
|
||||||
if (!IN6_IS_ADDR_UNSPECIFIED(&c->ip6.addr_out) &&
|
if (!IN6_IS_ADDR_LOOPBACK(&s_in6.sin6_addr) &&
|
||||||
!IN6_IS_ADDR_LOOPBACK(&s_in6.sin6_addr) &&
|
|
||||||
!IN6_IS_ADDR_LINKLOCAL(&s_in6.sin6_addr))
|
!IN6_IS_ADDR_LINKLOCAL(&s_in6.sin6_addr))
|
||||||
bind_addr = &c->ip6.addr_out;
|
bind_addr = &c->ip6.addr_out;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue