diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-08-27 16:04:45 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-08-27 09:04:38 +0200 |
commit | c78b194001ec211401144e3e89071bc2f54f121d (patch) | |
tree | 36bd794f811aa2b731604a50d05a0548bec527fa | |
parent | 620e19a1b48a80abddc657b4c17f5e4920f300ec (diff) | |
download | passt-c78b194001ec211401144e3e89071bc2f54f121d.tar passt-c78b194001ec211401144e3e89071bc2f54f121d.tar.gz passt-c78b194001ec211401144e3e89071bc2f54f121d.tar.bz2 passt-c78b194001ec211401144e3e89071bc2f54f121d.tar.lz passt-c78b194001ec211401144e3e89071bc2f54f121d.tar.xz passt-c78b194001ec211401144e3e89071bc2f54f121d.tar.zst passt-c78b194001ec211401144e3e89071bc2f54f121d.zip |
udp: Remove unnnecessary local from udp_sock_init()
The 's' variable is always redundant with either 'r4' or 'r6', so remove
it.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | udp.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -714,7 +714,7 @@ int udp_sock_init(const struct ctx *c, int ns, sa_family_t af, const void *addr, const char *ifname, in_port_t port) { union udp_listen_epoll_ref uref = { .port = port }; - int s, r4 = FD_REF_MAX + 1, r6 = FD_REF_MAX + 1; + int r4 = FD_REF_MAX + 1, r6 = FD_REF_MAX + 1; ASSERT(!c->no_udp); @@ -725,29 +725,29 @@ int udp_sock_init(const struct ctx *c, int ns, sa_family_t af, if ((af == AF_INET || af == AF_UNSPEC) && c->ifi4) { if (!ns) { - r4 = s = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, - addr, ifname, port, uref.u32); + r4 = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, + addr, ifname, port, uref.u32); - udp_splice_init[V4][port] = s < 0 ? -1 : s; + udp_splice_init[V4][port] = r4 < 0 ? -1 : r4; } else { - r4 = s = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, - &in4addr_loopback, - ifname, port, uref.u32); - udp_splice_ns[V4][port] = s < 0 ? -1 : s; + r4 = sock_l4(c, AF_INET, EPOLL_TYPE_UDP_LISTEN, + &in4addr_loopback, + ifname, port, uref.u32); + udp_splice_ns[V4][port] = r4 < 0 ? -1 : r4; } } if ((af == AF_INET6 || af == AF_UNSPEC) && c->ifi6) { if (!ns) { - r6 = s = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, - addr, ifname, port, uref.u32); + r6 = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, + addr, ifname, port, uref.u32); - udp_splice_init[V6][port] = s < 0 ? -1 : s; + udp_splice_init[V6][port] = r6 < 0 ? -1 : r6; } else { - r6 = s = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, - &in6addr_loopback, - ifname, port, uref.u32); - udp_splice_ns[V6][port] = s < 0 ? -1 : s; + r6 = sock_l4(c, AF_INET6, EPOLL_TYPE_UDP_LISTEN, + &in6addr_loopback, + ifname, port, uref.u32); + udp_splice_ns[V6][port] = r6 < 0 ? -1 : r6; } } |