]> The Tcpdump Group git mirrors - tcpdump/commitdiff
ICMPv6: restore Route Information option decoding
authorDenis Ovsienko <[email protected]>
Thu, 28 Nov 2013 15:10:51 +0000 (19:10 +0400)
committerDenis Ovsienko <[email protected]>
Thu, 28 Nov 2013 15:17:08 +0000 (19:17 +0400)
In May 2001 commit ea3df10 implemented support for then-current I-D on
the Route Information ICMPv6 option using type 9. In June 2001 type 9
was assigned to a completely different ICMPv6 option (Source Address
List, RFC3122). In 2005 the I-D became RFC4191 with the same option
encoding and assigned option type 24.

Update a macro to fix decoding and add a test case for it (produced
with an unconfigured instance of a development build of OpenWrt).

icmp6.h
tests/TESTLIST
tests/icmpv6_opt24-v.out [new file with mode: 0644]
tests/icmpv6_opt24.pcap [new file with mode: 0644]

diff --git a/icmp6.h b/icmp6.h
index c4d292e5966a0ba689db9bc3dcf7e39ab5656a98..310450ba423fa5bb113dc2883918b6bcc55e5066 100644 (file)
--- a/icmp6.h
+++ b/icmp6.h
@@ -275,7 +275,7 @@ struct nd_opt_hdr {         /* Neighbor discovery option header */
 #define ND_OPT_MTU                     5
 #define ND_OPT_ADVINTERVAL             7
 #define ND_OPT_HOMEAGENT_INFO          8
-#define ND_OPT_ROUTE_INFO              9       /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
+#define ND_OPT_ROUTE_INFO              24      /* RFC4191 */
 #define ND_OPT_RDNSS                   25
 #define ND_OPT_DNSSL                   31
 
index abd2132bf3f7483de909fab92ca5011532d34bae..47f4b14dc1a68cedce6c808c968dfcae6e904489 100644 (file)
@@ -94,6 +94,7 @@ igmpv3-queries  igmpv3-queries.pcap     igmpv3-queries.out      -t
 
 # ICMPv6
 icmpv6          icmpv6.pcap             icmpv6.out      -t -vv
+icmpv6_opt24-v icmpv6_opt24.pcap       icmpv6_opt24-v.out      -t -v
 
 # SPB tests
 spb                spb.pcap                spb.out -t
diff --git a/tests/icmpv6_opt24-v.out b/tests/icmpv6_opt24-v.out
new file mode 100644 (file)
index 0000000..2b7cf09
--- /dev/null
@@ -0,0 +1,16 @@
+IP6 (hlim 255, next-header ICMPv6 (58) payload length: 120) fe80::16cf:92ff:fe87:23d6 > ff02::1: [icmp6 sum ok] ICMP6, router advertisement, length 120
+       hop limit 0, Flags [managed, other stateful], pref medium, router lifetime 0s, reachable time 0s, retrans time 0s
+         source link-address option (1), length 8 (1): 14:cf:92:87:23:d6
+         mtu option (5), length 8 (1):  1500
+         prefix info option (3), length 32 (4): fd8d:4fb3:5b2e::/64, Flags [onlink, auto], valid time 7200s, pref. time 1800s
+         route info option (24), length 16 (2):  fd8d:4fb3:5b2e::/48, pref=medium, lifetime=7200s
+         rdnss option (25), length 24 (3):  lifetime 1800s, addr: fd8d:4fb3:5b2e::1
+         dnssl option (31), length 16 (2):  lifetime 1800s, domain(s): lan.
+IP6 (hlim 255, next-header ICMPv6 (58) payload length: 120) fe80::16cf:92ff:fe87:23d6 > ff02::1: [icmp6 sum ok] ICMP6, router advertisement, length 120
+       hop limit 0, Flags [managed, other stateful], pref medium, router lifetime 0s, reachable time 0s, retrans time 0s
+         source link-address option (1), length 8 (1): 14:cf:92:87:23:d6
+         mtu option (5), length 8 (1):  1500
+         prefix info option (3), length 32 (4): fd8d:4fb3:5b2e::/64, Flags [onlink, auto], valid time 7200s, pref. time 1800s
+         route info option (24), length 16 (2):  fd8d:4fb3:5b2e::/48, pref=medium, lifetime=7200s
+         rdnss option (25), length 24 (3):  lifetime 1800s, addr: fd8d:4fb3:5b2e::1
+         dnssl option (31), length 16 (2):  lifetime 1800s, domain(s): lan.
diff --git a/tests/icmpv6_opt24.pcap b/tests/icmpv6_opt24.pcap
new file mode 100644 (file)
index 0000000..974e7a3
Binary files /dev/null and b/tests/icmpv6_opt24.pcap differ