From 8badcba229b0ba3d469934f4315b736b0c712fbd Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 26 Sep 2016 18:00:37 +0200 Subject: iproute: properly support high routing table IDs The Linux kernel uses two distinct fields to denote the routing table ID in use by network routes; the 8 bit `rtm_table` member of `struct rtmsg` and the 32 bit `RTA_TABLE` netlink attribute. If a routing table ID is larger than 255, the `RT_TABLE` attribute must be used and the `rtm_table` field has to be set to the special `RT_TABLE_UNSPEC` value. This commit adds a patch which... - switches the *_n2a() and *_a2n() functions of rt_names.c to use dynamically sized, name-sorted arrays instead of fixed arrays limited to 1024 slots in order to support IDs up to 65535 - adds proper handling of high table IDs to iprule.c and iproute.c when adding, removing and dumping ip rules and network routes After this change, the Busybox ip applet fully supports IP rules with high ID numbers, using the same logic as the full iproute2. Signed-off-by: Jo-Philipp Wich --- ...libiproute-fix-displaying-route-table-for.patch | 23 ---------------------- 1 file changed, 23 deletions(-) delete mode 100644 package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch (limited to 'package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch') diff --git a/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch b/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch deleted file mode 100644 index 68754de..0000000 --- a/package/utils/busybox/patches/020-networking-libiproute-fix-displaying-route-table-for.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Felix Fietkau -Date: Sun, 7 Feb 2016 21:11:21 +0100 -Subject: [PATCH] networking/libiproute: fix displaying route table for rules - -r->rtm_table only supports a 8 bit table id, prefer RTA_TABLE if -present. - -Signed-off-by: Felix Fietkau ---- - ---- a/networking/libiproute/iprule.c -+++ b/networking/libiproute/iprule.c -@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const st - printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF])); - } - -- if (r->rtm_table) -+ if (tb[RTA_TABLE]) -+ printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE]))); -+ else if (r->rtm_table) - printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); - - if (tb[RTA_FLOW]) { -- cgit v1.1