mirror of
https://passt.top/passt
synced 2024-12-22 05:35:23 +00:00
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>
This commit is contained in:
parent
620e19a1b4
commit
c78b194001
30
udp.c
30
udp.c
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user