summaryrefslogtreecommitdiffstats
path: root/lib/route
diff options
context:
space:
mode:
authorIlya Pronin <ipronin@twitter.com>2020-04-04 03:00:37 (GMT)
committerThomas Haller <thaller@redhat.com>2020-04-16 15:16:45 (GMT)
commitbab9e77c87d3b596e77d669b0a827b50e725bb62 (patch)
treeeb18b109b4a2c57d18a67ca5a4663756a6627842 /lib/route
parentbae11ec1a2e1e0421dc10cfc5cbc2aeb80791aab (diff)
downloadlibnl-bab9e77c87d3b596e77d669b0a827b50e725bb62.zip
libnl-bab9e77c87d3b596e77d669b0a827b50e725bb62.tar.gz
libnl-bab9e77c87d3b596e77d669b0a827b50e725bb62.tar.bz2
route/link: add RTNL_LINK_REASM_OVERLAPS stat
The new stat exposes IPSTATS_MIB_REASM_OVERLAPS link stat. However, the original motivation for this change was fixing the issue with missing RX packets link stat. The regression was introduced in version 3.5.0 with commit 73c1d047, that added a new enum constant IPSTATS_MIB_REASM_OVERLAPS. Without this patch, IPSTATS_MIB_REASM_OVERLAPS is missing from map_stat_id_from_IPSTATS_MIB_v2 and is mapped by it to 0. This tricks inet6_parse_protinfo() into erroneously overwriting RTNL_LINK_RX_PACKETS stat, which happens to have value 0, when it tries to set IPSTATS_MIB_REASM_OVERLAPS. Fixes: 73c1d0479643 ('Sync linux headers to 4.19.66') https://github.com/thom311/libnl/pull/235
Diffstat (limited to 'lib/route')
-rw-r--r--lib/route/link.c1
-rw-r--r--lib/route/link/inet6.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/route/link.c b/lib/route/link.c
index 9439fe6..ed6f455 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -3007,6 +3007,7 @@ static const struct trans_tbl link_stats[] = {
__ADD(RTNL_LINK_IP6_ECT0PKTS, Ip6_InECT0Pkts),
__ADD(RTNL_LINK_IP6_CEPKTS, Ip6_InCEPkts),
__ADD(RTNL_LINK_RX_NOHANDLER, rx_nohandler),
+ __ADD(RTNL_LINK_REASM_OVERLAPS, ReasmOverlaps),
};
char *rtnl_link_stat2str(int st, char *buf, size_t len)
diff --git a/lib/route/link/inet6.c b/lib/route/link/inet6.c
index c977b61..1ad49bf 100644
--- a/lib/route/link/inet6.c
+++ b/lib/route/link/inet6.c
@@ -135,6 +135,7 @@ static const uint8_t map_stat_id_from_IPSTATS_MIB_v2[__IPSTATS_MIB_MAX] = {
[33] = RTNL_LINK_IP6_ECT1PKTS, /* IPSTATS_MIB_ECT1PKTS */
[34] = RTNL_LINK_IP6_ECT0PKTS, /* IPSTATS_MIB_ECT0PKTS */
[35] = RTNL_LINK_IP6_CEPKTS, /* IPSTATS_MIB_CEPKTS */
+ [36] = RTNL_LINK_REASM_OVERLAPS, /* IPSTATS_MIB_REASM_OVERLAPS */
};
static int inet6_parse_protinfo(struct rtnl_link *link, struct nlattr *attr,