tcp: Fix address type for tcp_sock_init_af()
This takes a struct in_addr * (i.e. an IPv4 address), although it's explicitly supposed to handle IPv6 as well. Both its caller and sock_l4() which it calls use a void * for the address, which can be either an in_addr or an in6_addr. We get away with this, because we don't do anything with the pointer other than transfer it from the caller to sock_l4(), but it's misleading. And quite possibly technically UB, because C is like that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
4681ea09bc
commit
1f2aab8aaa
1 changed files with 1 additions and 1 deletions
2
tcp.c
2
tcp.c
|
@ -2908,7 +2908,7 @@ void tcp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events)
|
||||||
* Return: fd for the new listening socket, negative error code on failure
|
* Return: fd for the new listening socket, negative error code on failure
|
||||||
*/
|
*/
|
||||||
static int tcp_sock_init_af(const struct ctx *c, int af, in_port_t port,
|
static int tcp_sock_init_af(const struct ctx *c, int af, in_port_t port,
|
||||||
const struct in_addr *addr, const char *ifname)
|
const void *addr, const char *ifname)
|
||||||
{
|
{
|
||||||
union tcp_listen_epoll_ref tref = {
|
union tcp_listen_epoll_ref tref = {
|
||||||
.port = port + c->tcp.fwd_in.delta[port],
|
.port = port + c->tcp.fwd_in.delta[port],
|
||||||
|
|
Loading…
Reference in a new issue