mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-27 06:18:47 +00:00
ip: Properly display AF_BRIDGE address information for neighbor events
The vxlan driver when a neighbor add/delete event occurs sends
NDA_DST filled with a union:
union vxlan_addr {
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
struct sockaddr sa;
};
This eventually calls rt_addr_n2a_r which had no handler for the
AF_BRIDGE family and "???" was being printed.
Add code to properly display this data when requested.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
4ac152d003
commit
728eb8d00b
19
lib/utils.c
19
lib/utils.c
@ -983,6 +983,25 @@ const char *rt_addr_n2a_r(int af, int len,
|
||||
}
|
||||
case AF_PACKET:
|
||||
return ll_addr_n2a(addr, len, ARPHRD_VOID, buf, buflen);
|
||||
case AF_BRIDGE:
|
||||
{
|
||||
const union {
|
||||
struct sockaddr sa;
|
||||
struct sockaddr_in sin;
|
||||
struct sockaddr_in6 sin6;
|
||||
} *sa = addr;
|
||||
|
||||
switch (sa->sa.sa_family) {
|
||||
case AF_INET:
|
||||
return inet_ntop(AF_INET, &sa->sin.sin_addr,
|
||||
buf, buflen);
|
||||
case AF_INET6:
|
||||
return inet_ntop(AF_INET6, &sa->sin6.sin6_addr,
|
||||
buf, buflen);
|
||||
}
|
||||
|
||||
/* fallthrough */
|
||||
}
|
||||
default:
|
||||
return "???";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user