* [PATCH iproute2] bridge: fix reporting of IPv6 addresses
@ 2014-03-20 11:06 Mike Rapoport
2014-03-21 21:24 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Mike Rapoport @ 2014-03-20 11:06 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Mike Rapoport
Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
---
bridge/fdb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/bridge/fdb.c b/bridge/fdb.c
index e2e53f1..9b720e3 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -103,8 +103,13 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if (tb[NDA_DST]) {
SPRINT_BUF(abuf);
+ int family = AF_INET;
+
+ if (RTA_PAYLOAD(tb[NDA_DST]) == sizeof(struct in6_addr))
+ family = AF_INET6;
+
fprintf(fp, "dst %s ",
- format_host(AF_INET,
+ format_host(family,
RTA_PAYLOAD(tb[NDA_DST]),
RTA_DATA(tb[NDA_DST]),
abuf, sizeof(abuf)));
--
1.8.1.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH iproute2] bridge: fix reporting of IPv6 addresses
2014-03-20 11:06 [PATCH iproute2] bridge: fix reporting of IPv6 addresses Mike Rapoport
@ 2014-03-21 21:24 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2014-03-21 21:24 UTC (permalink / raw)
To: Mike Rapoport; +Cc: netdev
On Thu, 20 Mar 2014 13:06:10 +0200
Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:
> Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
> ---
> bridge/fdb.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/bridge/fdb.c b/bridge/fdb.c
> index e2e53f1..9b720e3 100644
> --- a/bridge/fdb.c
> +++ b/bridge/fdb.c
> @@ -103,8 +103,13 @@ int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
>
> if (tb[NDA_DST]) {
> SPRINT_BUF(abuf);
> + int family = AF_INET;
> +
> + if (RTA_PAYLOAD(tb[NDA_DST]) == sizeof(struct in6_addr))
> + family = AF_INET6;
> +
> fprintf(fp, "dst %s ",
> - format_host(AF_INET,
> + format_host(family,
> RTA_PAYLOAD(tb[NDA_DST]),
> RTA_DATA(tb[NDA_DST]),
> abuf, sizeof(abuf)));
Looks good applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-03-21 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-20 11:06 [PATCH iproute2] bridge: fix reporting of IPv6 addresses Mike Rapoport
2014-03-21 21:24 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.