batctl: Merge bugfixes from 2020.4 620/head
authorSven Eckelmann <sven@narfation.org>
Sat, 24 Oct 2020 19:40:40 +0000 (21:40 +0200)
committerSven Eckelmann <sven@narfation.org>
Sat, 24 Oct 2020 19:45:15 +0000 (21:45 +0200)
* tcpdump: Fix endianness in ICMPv6 Echo Request/Reply parsing

Signed-off-by: Sven Eckelmann <sven@narfation.org>
batctl/Makefile
batctl/patches/0009-batctl-tcpdump-Fix-endianness-in-ICMPv6-Echo-Request.patch [new file with mode: 0644]

index 2772b1cc40aaac08a3a9bd27bf94b9503eea9705..97be7f3645e8d4a4aa7480d1f761e6475ca68979 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=batctl
 
 PKG_VERSION:=2019.2
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 PKG_HASH:=fb656208ff7d4cd8b1b422f60c9e6d8747302a347cbf6c199d7afa9b80f80ea3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/batctl/patches/0009-batctl-tcpdump-Fix-endianness-in-ICMPv6-Echo-Request.patch b/batctl/patches/0009-batctl-tcpdump-Fix-endianness-in-ICMPv6-Echo-Request.patch
new file mode 100644 (file)
index 0000000..145c9b1
--- /dev/null
@@ -0,0 +1,39 @@
+From: Linus Lüssing <linus.luessing@c0d3.blue>
+Date: Sun, 13 Sep 2020 23:30:19 +0200
+Subject: batctl: tcpdump: Fix endianness in ICMPv6 Echo Request/Reply parsing
+
+The ICMPv6 Echo Request/Reply sequence number and id as well as the
+IPv6 header length are two byte long fields and therefore might need a
+conversion on a little endian system. Otherwise the output will be
+broken on such a machine.
+
+Fixes: 35b37756f4a3 ("add IPv6 support to tcpdump parser")
+Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+
+Origin: upstream, https://git.open-mesh.org/batctl.git/commit/e42f73d0d2a04edfbed1b9d0ad9fd57af9e90faf
+
+diff --git a/tcpdump.c b/tcpdump.c
+index 72c1869eb50d25c1f6b1e1fcae42199b9337cb4e..f3b1b8bd536e83e583bc535d01630843b80a558d 100644
+--- a/tcpdump.c
++++ b/tcpdump.c
+@@ -537,13 +537,15 @@ static void dump_ipv6(unsigned char *packet_buff, ssize_t buff_len,
+                       break;
+               case ICMP6_ECHO_REQUEST:
+                       printf(" echo request, id: %d, seq: %d, length: %hu\n",
+-                             icmphdr->icmp6_id, icmphdr->icmp6_seq,
+-                             iphdr->ip6_plen);
++                             ntohs(icmphdr->icmp6_id),
++                             ntohs(icmphdr->icmp6_seq),
++                             ntohs(iphdr->ip6_plen));
+                       break;
+               case ICMP6_ECHO_REPLY:
+                       printf(" echo reply, id: %d, seq: %d, length: %hu\n",
+-                             icmphdr->icmp6_id, icmphdr->icmp6_seq,
+-                             iphdr->ip6_plen);
++                             ntohs(icmphdr->icmp6_id),
++                             ntohs(icmphdr->icmp6_seq),
++                             ntohs(iphdr->ip6_plen));
+                       break;
+               case ICMP6_TIME_EXCEEDED:
+                       printf(" time exceeded in-transit, length %zu\n",