diff -Nru iproute2-4.3.0/debian/changelog iproute2-4.3.0/debian/changelog --- iproute2-4.3.0/debian/changelog 2017-12-04 17:03:46.000000000 +0000 +++ iproute2-4.3.0/debian/changelog 2018-06-26 20:50:03.000000000 +0000 @@ -1,3 +1,10 @@ +iproute2 (4.3.0-1ubuntu3.16.04.4) xenial; urgency=medium + + * Add support for reading table id/name mappings (LP: #1771783) + * Add support for reading proto id/name mappings (LP: #1771783) + + -- Khalid Elmously Tue, 26 Jun 2018 20:44:53 +0000 + iproute2 (4.3.0-1ubuntu3.16.04.3) xenial; urgency=medium * Fix ip maddr show (LP: #1732032): diff -Nru iproute2-4.3.0/debian/patches/0001-add-support-for-reading-table-proto-mappings-from-dir.patch iproute2-4.3.0/debian/patches/0001-add-support-for-reading-table-proto-mappings-from-dir.patch --- iproute2-4.3.0/debian/patches/0001-add-support-for-reading-table-proto-mappings-from-dir.patch 1970-01-01 00:00:00.000000000 +0000 +++ iproute2-4.3.0/debian/patches/0001-add-support-for-reading-table-proto-mappings-from-dir.patch 2018-06-26 20:56:15.000000000 +0000 @@ -0,0 +1,112 @@ + iproute2 (4.3.0-1ubuntu3.16.04.4) UNRELEASED; urgency=medium + . + * Add support for reading table id/name mappings (LP: #1771783) + (cherry-picked from 13ada95da4f05df5993ca332358fa3f2f3a21047) + * Add support for reading proto id/name mappings (LP: #1771783) + (cherry-picked fromo 719e331ff6190add96a60479df95e791411e5fa4) +Author: Khalid Elmously +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1771783 + +--- /dev/null ++++ iproute2-4.3.0/etc/iproute2/rt_protos.d/README +@@ -0,0 +1,2 @@ ++Each file in this directory is an rt_protos configuration file. iproute2 ++commands scan this directory processing all files that end in '.conf'. +--- /dev/null ++++ iproute2-4.3.0/etc/iproute2/rt_tables.d/README +@@ -0,0 +1,2 @@ ++Each file in this directory is an rt_tables configuration file. iproute2 ++commands scan this directory processing all files that end in '.conf'. +--- iproute2-4.3.0.orig/lib/rt_names.c ++++ iproute2-4.3.0/lib/rt_names.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -143,9 +144,36 @@ static int rtnl_rtprot_init; + + static void rtnl_rtprot_initialize(void) + { ++ struct dirent *de; ++ DIR *d; ++ + rtnl_rtprot_init = 1; + rtnl_tab_initialize(CONFDIR "/rt_protos", + rtnl_rtprot_tab, 256); ++ ++ d = opendir(CONFDIR "/rt_protos.d"); ++ if (!d) ++ return; ++ ++ while ((de = readdir(d)) != NULL) { ++ char path[PATH_MAX]; ++ size_t len; ++ ++ if (*de->d_name == '.') ++ continue; ++ ++ /* only consider filenames ending in '.conf' */ ++ len = strlen(de->d_name); ++ if (len <= 5) ++ continue; ++ if (strcmp(de->d_name + len - 5, ".conf")) ++ continue; ++ ++ snprintf(path, sizeof(path), CONFDIR "/rt_protos.d/%s", ++ de->d_name); ++ rtnl_tab_initialize(path, rtnl_rtprot_tab, 256); ++ } ++ closedir(d); + } + + const char * rtnl_rtprot_n2a(int id, char *buf, int len) +@@ -339,6 +367,8 @@ static int rtnl_rttable_init; + + static void rtnl_rttable_initialize(void) + { ++ struct dirent *de; ++ DIR *d; + int i; + + rtnl_rttable_init = 1; +@@ -348,6 +378,29 @@ static void rtnl_rttable_initialize(void + } + rtnl_hash_initialize(CONFDIR "/rt_tables", + rtnl_rttable_hash, 256); ++ ++ d = opendir(CONFDIR "/rt_tables.d"); ++ if (!d) ++ return; ++ ++ while ((de = readdir(d)) != NULL) { ++ char path[PATH_MAX]; ++ size_t len; ++ ++ if (*de->d_name == '.') ++ continue; ++ ++ /* only consider filenames ending in '.conf' */ ++ len = strlen(de->d_name); ++ if (len <= 5) ++ continue; ++ if (strcmp(de->d_name + len - 5, ".conf")) ++ continue; ++ ++ snprintf(path, sizeof(path), CONFDIR "/rt_tables.d/%s", de->d_name); ++ rtnl_hash_initialize(path, rtnl_rttable_hash, 256); ++ } ++ closedir(d); + } + + const char * rtnl_rttable_n2a(__u32 id, char *buf, int len) diff -Nru iproute2-4.3.0/debian/patches/series iproute2-4.3.0/debian/patches/series --- iproute2-4.3.0/debian/patches/series 2017-12-04 17:03:46.000000000 +0000 +++ iproute2-4.3.0/debian/patches/series 2018-06-26 20:52:21.000000000 +0000 @@ -9,3 +9,4 @@ 1005-ip-maddr-fix-igmp-parsing.patch 1006-ip-maddr-avoid-uninitialized-data.patch 1007-ip-maddr-fix-filtering-by-device.patch +1008-add-support-for-reading-table-proto-mappings-from-dir.patch