ICMPv6: restore Route Information option decoding

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).
This commit is contained in:
Denis Ovsienko 2013-11-28 19:10:51 +04:00
parent de2552832f
commit 219e43a95f
4 changed files with 18 additions and 1 deletions

View File

@ -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

View 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

16
tests/icmpv6_opt24-v.out Normal file
View File

@ -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.

BIN
tests/icmpv6_opt24.pcap Normal file

Binary file not shown.