netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 net-next] ipmroute: add support for RTNH_F_UNRESOLVED
@ 2017-01-20 14:04 Nikolay Aleksandrov
  2017-01-20 14:05 ` Nikolay Aleksandrov
  2017-01-20 14:15 ` [PATCH iproute2 net-next v2] " Nikolay Aleksandrov
  0 siblings, 2 replies; 4+ messages in thread
From: Nikolay Aleksandrov @ 2017-01-20 14:04 UTC (permalink / raw)
  To: netdev; +Cc: stephen, roopa, Nikolay Aleksandrov

This patch adds a new field that is printed in the end of the line which
denotes the real entry state. Before this patch an entry's IIF could
disappear and it would look like an unresolved one (iif = unresolved):
(3.0.16.1, 225.11.16.1)          Iif: unresolved
with no way to really distinguish it from an unresolved entry.
After the patch if the dumped entry has RTNH_F_UNRESOLVED set we get:
(3.0.16.1, 225.11.16.1)          Iif: unresolved  State: unresolved
for unresolved entries and:
(0.0.0.0, 225.11.11.11)          Iif: eth4       Oifs: eth3  State: resolved
for resolved entries after the OIF list. Note that "State:" has ':' in
it so it cannot be mistaken for an interface name.
And for the example above, we'd get:
(0.0.0.0, 225.11.11.11)          Iif: unresolved     State: resolved

Also when dumping all routes via ip route show table all, it will show
up as:
multicast 225.11.16.1/32 from 3.0.16.1/32 table default proto 17 unresolved

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 ip/ipmroute.c | 6 ++++++
 ip/iproute.c  | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/ip/ipmroute.c b/ip/ipmroute.c
index 512afcd2086e..913f3fd28e14 100644
--- a/ip/ipmroute.c
+++ b/ip/ipmroute.c
@@ -159,6 +159,12 @@ int print_mroute(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 			nh = RTNH_NEXT(nh);
 		}
 	}
+	fprintf(fp, " State: ");
+	if (r->rtm_flags & RTNH_F_UNRESOLVED)
+		fprintf(fp, "unresolved");
+	else
+		fprintf(fp, "resolved");
+
 	if (show_stats && tb[RTA_MFC_STATS]) {
 		struct rta_mfc_stats *mfcs = RTA_DATA(tb[RTA_MFC_STATS]);
 
diff --git a/ip/iproute.c b/ip/iproute.c
index e433de8be189..c19578337f71 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -448,6 +448,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 		fprintf(fp, "notify ");
 	if (r->rtm_flags & RTNH_F_LINKDOWN)
 		fprintf(fp, "linkdown ");
+	if (r->rtm_flags & RTNH_F_UNRESOLVED)
+		fprintf(fp, "unresolved ");
 	if (tb[RTA_MARK]) {
 		unsigned int mark = *(unsigned int *)RTA_DATA(tb[RTA_MARK]);
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2 net-next] ipmroute: add support for RTNH_F_UNRESOLVED
  2017-01-20 14:04 [PATCH iproute2 net-next] ipmroute: add support for RTNH_F_UNRESOLVED Nikolay Aleksandrov
@ 2017-01-20 14:05 ` Nikolay Aleksandrov
  2017-01-20 14:15 ` [PATCH iproute2 net-next v2] " Nikolay Aleksandrov
  1 sibling, 0 replies; 4+ messages in thread
From: Nikolay Aleksandrov @ 2017-01-20 14:05 UTC (permalink / raw)
  To: netdev; +Cc: stephen, roopa

On 20/01/17 15:04, Nikolay Aleksandrov wrote:
> This patch adds a new field that is printed in the end of the line which
> denotes the real entry state. Before this patch an entry's IIF could
> disappear and it would look like an unresolved one (iif = unresolved):
> (3.0.16.1, 225.11.16.1)          Iif: unresolved
> with no way to really distinguish it from an unresolved entry.
> After the patch if the dumped entry has RTNH_F_UNRESOLVED set we get:
> (3.0.16.1, 225.11.16.1)          Iif: unresolved  State: unresolved
> for unresolved entries and:
> (0.0.0.0, 225.11.11.11)          Iif: eth4       Oifs: eth3  State: resolved
> for resolved entries after the OIF list. Note that "State:" has ':' in
> it so it cannot be mistaken for an interface name.
> And for the example above, we'd get:
> (0.0.0.0, 225.11.11.11)          Iif: unresolved     State: resolved
> 
> Also when dumping all routes via ip route show table all, it will show
> up as:
> multicast 225.11.16.1/32 from 3.0.16.1/32 table default proto 17 unresolved
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> ---
>  ip/ipmroute.c | 6 ++++++
>  ip/iproute.c  | 2 ++
>  2 files changed, 8 insertions(+)
> 

Oops, sent the wrong version. v2 coming up, sorry for the noise

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH iproute2 net-next v2] ipmroute: add support for RTNH_F_UNRESOLVED
  2017-01-20 14:04 [PATCH iproute2 net-next] ipmroute: add support for RTNH_F_UNRESOLVED Nikolay Aleksandrov
  2017-01-20 14:05 ` Nikolay Aleksandrov
@ 2017-01-20 14:15 ` Nikolay Aleksandrov
  2017-01-20 17:42   ` Stephen Hemminger
  1 sibling, 1 reply; 4+ messages in thread
From: Nikolay Aleksandrov @ 2017-01-20 14:15 UTC (permalink / raw)
  To: netdev; +Cc: stephen, roopa, Nikolay Aleksandrov

This patch adds a new field that is printed in the end of the line which
denotes the real entry state. Before this patch an entry's IIF could
disappear and it would look like an unresolved one (iif = unresolved):
(3.0.16.1, 225.11.16.1)          Iif: unresolved
with no way to really distinguish it from an unresolved entry.
After the patch if the dumped entry has RTNH_F_UNRESOLVED set we get:
(3.0.16.1, 225.11.16.1)          Iif: unresolved  State: unresolved
for unresolved entries and:
(0.0.0.0, 225.11.11.11)          Iif: eth4       Oifs: eth3  State: resolved
for resolved entries after the OIF list. Note that "State:" has ':' in
it so it cannot be mistaken for an interface name.

And for the example above, we'd get:
(0.0.0.0, 225.11.11.11)          Iif: unresolved     State: resolved

Also when dumping all routes via ip route show table all, it will show
up as:
multicast 225.11.16.1/32 from 3.0.16.1/32 table default proto 17 unresolved

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
v2: sent latest version, with dumping the state in one line

 ip/ipmroute.c | 2 ++
 ip/iproute.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/ip/ipmroute.c b/ip/ipmroute.c
index 512afcd2086e..593ce3a1bd95 100644
--- a/ip/ipmroute.c
+++ b/ip/ipmroute.c
@@ -159,6 +159,8 @@ int print_mroute(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 			nh = RTNH_NEXT(nh);
 		}
 	}
+	fprintf(fp, " State: %s",
+		r->rtm_flags & RTNH_F_UNRESOLVED ? "unresolved" : "resolved");
 	if (show_stats && tb[RTA_MFC_STATS]) {
 		struct rta_mfc_stats *mfcs = RTA_DATA(tb[RTA_MFC_STATS]);
 
diff --git a/ip/iproute.c b/ip/iproute.c
index e433de8be189..c19578337f71 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -448,6 +448,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 		fprintf(fp, "notify ");
 	if (r->rtm_flags & RTNH_F_LINKDOWN)
 		fprintf(fp, "linkdown ");
+	if (r->rtm_flags & RTNH_F_UNRESOLVED)
+		fprintf(fp, "unresolved ");
 	if (tb[RTA_MARK]) {
 		unsigned int mark = *(unsigned int *)RTA_DATA(tb[RTA_MARK]);
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2 net-next v2] ipmroute: add support for RTNH_F_UNRESOLVED
  2017-01-20 14:15 ` [PATCH iproute2 net-next v2] " Nikolay Aleksandrov
@ 2017-01-20 17:42   ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-01-20 17:42 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, roopa

On Fri, 20 Jan 2017 15:15:21 +0100
Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:

> This patch adds a new field that is printed in the end of the line which
> denotes the real entry state. Before this patch an entry's IIF could
> disappear and it would look like an unresolved one (iif = unresolved):
> (3.0.16.1, 225.11.16.1)          Iif: unresolved
> with no way to really distinguish it from an unresolved entry.
> After the patch if the dumped entry has RTNH_F_UNRESOLVED set we get:
> (3.0.16.1, 225.11.16.1)          Iif: unresolved  State: unresolved
> for unresolved entries and:
> (0.0.0.0, 225.11.11.11)          Iif: eth4       Oifs: eth3  State: resolved
> for resolved entries after the OIF list. Note that "State:" has ':' in
> it so it cannot be mistaken for an interface name.
> 
> And for the example above, we'd get:
> (0.0.0.0, 225.11.11.11)          Iif: unresolved     State: resolved
> 
> Also when dumping all routes via ip route show table all, it will show
> up as:
> multicast 225.11.16.1/32 from 3.0.16.1/32 table default proto 17 unresolved
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Applied to net-next

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-20 17:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-20 14:04 [PATCH iproute2 net-next] ipmroute: add support for RTNH_F_UNRESOLVED Nikolay Aleksandrov
2017-01-20 14:05 ` Nikolay Aleksandrov
2017-01-20 14:15 ` [PATCH iproute2 net-next v2] " Nikolay Aleksandrov
2017-01-20 17:42   ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).