Package: busybox / 1:1.22.0-19

iproute-support-onelink-route-option-and-print-route-flags.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From c28e8ce195763dfc7367cbbfae91689808f2193a Mon Sep 17 00:00:00 2001
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Fri, 18 Jul 2014 13:38:41 +0400
Subject: [PATCH] iproute: support onelink route option and print route flags

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 networking/libiproute/iproute.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index ec4d8ba..273f6fe 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -298,6 +298,19 @@ static int FAST_FUNC print_route(const struct sockaddr_nl *who UNUSED_PARAM,
 	if (tb[RTA_PRIORITY]) {
 		printf(" metric %d ", *(uint32_t*)RTA_DATA(tb[RTA_PRIORITY]));
 	}
+	if (r->rtm_flags & RTNH_F_DEAD) {
+		printf("dead ");
+	}
+	if (r->rtm_flags & RTNH_F_ONLINK) {
+		printf("onlink ");
+	}
+	if (r->rtm_flags & RTNH_F_PERVASIVE) {
+		printf("pervasive ");
+	}
+	if (r->rtm_flags & RTM_F_NOTIFY) {
+		printf("notify ");
+	}
+
 	if (r->rtm_family == AF_INET6) {
 		struct rta_cacheinfo *ci = NULL;
 		if (tb[RTA_CACHEINFO]) {
@@ -330,7 +343,7 @@ static int iproute_modify(int cmd, unsigned flags, char **argv)
 {
 	static const char keywords[] ALIGN1 =
 		"src\0""via\0""mtu\0""lock\0""protocol\0"IF_FEATURE_IP_RULE("table\0")
-		"dev\0""oif\0""to\0""metric\0";
+		"dev\0""oif\0""to\0""metric\0onlink";
 	enum {
 		ARG_src,
 		ARG_via,
@@ -341,6 +354,7 @@ IF_FEATURE_IP_RULE(ARG_table,)
 		ARG_oif,
 		ARG_to,
 		ARG_metric,
+		ARG_onlink,
 	};
 	enum {
 		gw_ok = 1 << 0,
@@ -431,6 +445,8 @@ IF_FEATURE_IP_RULE(ARG_table,)
 			NEXT_ARG();
 			metric = get_u32(*argv, "metric");
 			addattr32(&req.n, sizeof(req), RTA_PRIORITY, metric);
+		} else if (arg == ARG_onlink) {
+			req.r.rtm_flags |= RTNH_F_ONLINK;
 		} else {
 			int type;
 			inet_prefix dst;
-- 
1.7.10.4