From 1ca2e08bd0616df57381408b8d4d801dc3425823 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Mon, 13 Feb 2017 12:21:53 -0800 Subject: [PATCH 1/4] ip route: Make name of protocol 0 consistent iproute2 can inconsistently show the name of protocol 0 if a route with a custom protocol is added. For example: dsa@cartman:~$ ip -6 ro ls table all | egrep 'proto none|proto unspec' local ::1 dev lo table local proto none metric 0 pref medium local fe80::225:90ff:fecb:1c18 dev lo table local proto none metric 0 pref medium local fe80::92e2:baff:fe5c:da5d dev lo table local proto none metric 0 pref medium protocol 0 is pretty printed as "none". Add a route with a custom protocol: dsa@cartman:~$ sudo ip -6 ro add 2001:db8:200::1/128 dev eth0 proto 123 And now display has switched from "none" to "unspec": dsa@cartman:~$ ip -6 ro ls table all | egrep 'proto none|proto unspec' local ::1 dev lo table local proto unspec metric 0 pref medium local fe80::225:90ff:fecb:1c18 dev lo table local proto unspec metric 0 pref medium local fe80::92e2:baff:fe5c:da5d dev lo table local proto unspec metric 0 pref medium The rt_protos file has the id to name mapping as "unspec" while rtnl_rtprot_tab[0] has "none". The presence of a custom protocol id triggers reading the rt_protos file and overwriting the string in rtnl_rtprot_tab. All of this is logic from 2004 and earlier. Update rtnl_rtprot_tab to "unspec" to match the enum value. Signed-off-by: David Ahern --- lib/rt_names.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rt_names.c b/lib/rt_names.c index 3a16d5cf..04c15ff5 100644 --- a/lib/rt_names.c +++ b/lib/rt_names.c @@ -119,7 +119,7 @@ static void rtnl_tab_initialize(const char *file, char **tab, int size) } static char *rtnl_rtprot_tab[256] = { - [RTPROT_UNSPEC] = "none", + [RTPROT_UNSPEC] = "unspec", [RTPROT_REDIRECT] = "redirect", [RTPROT_KERNEL] = "kernel", [RTPROT_BOOT] = "boot", From afdc1fed243f5499a53f5fda202031cf4c4d4044 Mon Sep 17 00:00:00 2001 From: Or Gerlitz Date: Thu, 9 Feb 2017 15:10:14 +0200 Subject: [PATCH 2/4] tc: matchall: Print skip flags when dumping a filter Print the skip flags when we dump a filter. Signed-off-by: Or Gerlitz Acked by: Yotam Gigi Reviewed-by: Simon Horman --- tc/f_matchall.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tc/f_matchall.c b/tc/f_matchall.c index 04e524e3..ac486308 100644 --- a/tc/f_matchall.c +++ b/tc/f_matchall.c @@ -130,6 +130,15 @@ static int matchall_print_opt(struct filter_util *qu, FILE *f, sprint_tc_classid(rta_getattr_u32(tb[TCA_MATCHALL_CLASSID]), b1)); } + if (tb[TCA_MATCHALL_FLAGS]) { + __u32 flags = rta_getattr_u32(tb[TCA_MATCHALL_FLAGS]); + + if (flags & TCA_CLS_FLAGS_SKIP_HW) + fprintf(f, "\n skip_hw"); + if (flags & TCA_CLS_FLAGS_SKIP_SW) + fprintf(f, "\n skip_sw"); + } + if (tb[TCA_MATCHALL_ACT]) tc_print_action(f, tb[TCA_MATCHALL_ACT]); From 3064a44c6979805a4bef836f00e854d437cc89cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Wed, 15 Feb 2017 21:26:41 +0000 Subject: [PATCH 3/4] testsuite: refactor kernel config search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Asbjørn Sloth Tønnesen --- testsuite/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/Makefile b/testsuite/Makefile index 50a7bafa..fc693368 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -17,8 +17,9 @@ ifneq (,$(wildcard /proc/config.gz)) KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG) else KVER := $(shell uname -r) -KCPATH := /lib/modules/${KVER}/config -ifneq (,$(wildcard ${KCPATH})) +KCPATHS := /lib/modules/$(KVER)/config +KCPATH := $(firstword $(wildcard $(KCPATHS))) +ifneq (,$(KCPATH)) KENV := $(shell cat ${KCPATH} | grep ^CONFIG) endif endif From d754a64aed7f29cbe917f2013cdaf2dda0407cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Wed, 15 Feb 2017 21:26:42 +0000 Subject: [PATCH 4/4] testsuite: search for kernel config in /boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for finding the kernel config in Debian and derivatives. Signed-off-by: Asbjørn Sloth Tønnesen --- testsuite/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/Makefile b/testsuite/Makefile index fc693368..055136b5 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -17,7 +17,7 @@ ifneq (,$(wildcard /proc/config.gz)) KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG) else KVER := $(shell uname -r) -KCPATHS := /lib/modules/$(KVER)/config +KCPATHS := /lib/modules/$(KVER)/config /boot/config-$(KVER) KCPATH := $(firstword $(wildcard $(KCPATHS))) ifneq (,$(KCPATH)) KENV := $(shell cat ${KCPATH} | grep ^CONFIG)