]> The Tcpdump Group git mirrors - tcpdump/commitdiff
print-dhcp6.c: Fix bugs in DH6OPT_IA_NA, DH6OPT_IA_PD, DH6OPT_IA_TA, DH6OPT_IA_ADDR...
authorfxlb <[email protected]>
Mon, 26 Nov 2012 16:39:09 +0000 (17:39 +0100)
committerfxlb <[email protected]>
Mon, 26 Nov 2012 16:39:09 +0000 (17:39 +0100)
print-dhcp6.c
tests/TESTLIST
tests/dhcpv6-AFTR-Name-RFC6334.out
tests/dhcpv6-ia-na.out [new file with mode: 0644]
tests/dhcpv6-ia-na.pcap [new file with mode: 0644]
tests/dhcpv6-ia-pd.out [new file with mode: 0644]
tests/dhcpv6-ia-pd.pcap [new file with mode: 0644]
tests/dhcpv6-ia-ta.out [new file with mode: 0644]
tests/dhcpv6-ia-ta.pcap [new file with mode: 0644]

index 8cdd887cc61bd2440c2ec21262707579066a22d0..8f3a43a51e6ede491d368c586065ba99d884043f 100644 (file)
@@ -415,7 +415,7 @@ dhcp6opt_print(const u_char *cp, const u_char *ep)
                            EXTRACT_32BITS(&tp[20]));
                        if (optlen > 24) {
                                /* there are sub-options */
-                               dhcp6opt_print(tp + 24, tp + 24 + optlen);
+                               dhcp6opt_print(tp + 24, tp + optlen);
                        }
                        printf(")");
                        break;
@@ -615,7 +615,7 @@ dhcp6opt_print(const u_char *cp, const u_char *ep)
                            EXTRACT_32BITS(&tp[8]));
                        if (optlen > 12) {
                                /* there are sub-options */
-                               dhcp6opt_print(tp + 12, tp + 12 + optlen);
+                               dhcp6opt_print(tp + 12, tp + optlen);
                        }
                        printf(")");
                        break;
@@ -628,7 +628,7 @@ dhcp6opt_print(const u_char *cp, const u_char *ep)
                        printf(" IAID:%u", EXTRACT_32BITS(tp));
                        if (optlen > 4) {
                                /* there are sub-options */
-                               dhcp6opt_print(tp + 4, tp + 4 + optlen);
+                               dhcp6opt_print(tp + 4, tp + optlen);
                        }
                        printf(")");
                        break;
@@ -644,7 +644,7 @@ dhcp6opt_print(const u_char *cp, const u_char *ep)
                            EXTRACT_32BITS(&tp[4]));
                        if (optlen > 25) {
                                /* there are sub-options */
-                               dhcp6opt_print(tp + 25, tp + 25 + optlen);
+                               dhcp6opt_print(tp + 25, tp + optlen);
                        }
                        printf(")");
                        break;
index c8c6c47af15fee0b966e5a9055cc264578571c78..600e3ca5ecddfe53484a119e6aee95f08ca80594 100644 (file)
@@ -77,3 +77,6 @@ ripv2_auth      ripv2_auth.pcap         ripv2_auth.out  -t -v
 
 # DHCPv6 tests
 dhcpv6-aftr-name       dhcpv6-AFTR-Name-RFC6334.pcap   dhcpv6-AFTR-Name-RFC6334.out    -t -v
+dhcpv6-ia-na   dhcpv6-ia-na.pcap       dhcpv6-ia-na.out        -t -v
+dhcpv6-ia-pd   dhcpv6-ia-pd.pcap       dhcpv6-ia-pd.out        -t -v
+dhcpv6-ia-ta   dhcpv6-ia-ta.pcap       dhcpv6-ia-ta.out        -t -v
index c52e37ae2e0a5da666b74a5f75425f05474e05d3..13f6a4fae568cb6308389897d9797f711042ce1f 100644 (file)
@@ -1,4 +1,4 @@
 IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 56) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 solicit (xid=d81eb8 (client-ID hwaddr type 1 000102030405) (option-request DNS-server AFTR-Name) (elapsed-time 0) (IA_PD IAID:33752069 T1:3600 T2:5400))
-IP6 (hlim 64, next-header UDP (17) payload length: 142) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 advertise (xid=d81eb8 (IA_PD IAID:33752069 T1:150 T2:250 (IA_PD-prefix 2a00:1:1:100::/56 pltime:250 vltime:300)[|dhcp6ext]) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 406802160 001122334455) (preference 10) (DNS-server 2a01::1) (AFTR-Name aftr-name.mydomain.net))
-IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 103) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 request (xid=1e291d (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 406802160 001122334455) (option-request DNS-server AFTR-Name) (elapsed-time 0) (IA_PD IAID:33752069 T1:3600 T2:5400 (IA_PD-prefix 2a00:1:1:100::/56 pltime:7200 vltime:7500)[|dhcp6ext]))
-IP6 (hlim 64, next-header UDP (17) payload length: 142) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 reply (xid=1e291d (IA_PD IAID:33752069 T1:150 T2:250 (IA_PD-prefix 2a00:1:1:100::/56 pltime:250 vltime:300)[|dhcp6ext]) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 406802160 001122334455) (preference 10) (DNS-server 2a01::1) (AFTR-Name aftr-name.mydomain.net))
+IP6 (hlim 64, next-header UDP (17) payload length: 142) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 advertise (xid=d81eb8 (IA_PD IAID:33752069 T1:150 T2:250 (IA_PD-prefix 2a00:1:1:100::/56 pltime:250 vltime:300)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 406802160 001122334455) (preference 10) (DNS-server 2a01::1) (AFTR-Name aftr-name.mydomain.net))
+IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 103) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 request (xid=1e291d (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 406802160 001122334455) (option-request DNS-server AFTR-Name) (elapsed-time 0) (IA_PD IAID:33752069 T1:3600 T2:5400 (IA_PD-prefix 2a00:1:1:100::/56 pltime:7200 vltime:7500)))
+IP6 (hlim 64, next-header UDP (17) payload length: 142) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 reply (xid=1e291d (IA_PD IAID:33752069 T1:150 T2:250 (IA_PD-prefix 2a00:1:1:100::/56 pltime:250 vltime:300)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 406802160 001122334455) (preference 10) (DNS-server 2a01::1) (AFTR-Name aftr-name.mydomain.net))
diff --git a/tests/dhcpv6-ia-na.out b/tests/dhcpv6-ia-na.out
new file mode 100644 (file)
index 0000000..b1dd0f0
--- /dev/null
@@ -0,0 +1,4 @@
+IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 56) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 solicit (xid=90b45c (client-ID hwaddr type 1 000102030405) (option-request DNS-server DNS-search-list) (elapsed-time 0) (IA_NA IAID:33752069 T1:3600 T2:5400))
+IP6 (hlim 64, next-header UDP (17) payload length: 88) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 advertise (xid=90b45c (IA_NA IAID:33752069 T1:3600 T2:5400 (IA_ADDR 2a00:1:1:200:38e6:b22e:c440:acdf pltime:4500 vltime:7200)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259276 001122334455))
+IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 102) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 request (xid=2ffdd1 (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259276 001122334455) (option-request DNS-server DNS-search-list) (elapsed-time 0) (IA_NA IAID:33752069 T1:3600 T2:5400 (IA_ADDR 2a00:1:1:200:38e6:b22e:c440:acdf pltime:7200 vltime:7500)))
+IP6 (hlim 64, next-header UDP (17) payload length: 88) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 reply (xid=2ffdd1 (IA_NA IAID:33752069 T1:3600 T2:5400 (IA_ADDR 2a00:1:1:200:38e6:b22e:c440:acdf pltime:4500 vltime:7200)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259276 001122334455))
diff --git a/tests/dhcpv6-ia-na.pcap b/tests/dhcpv6-ia-na.pcap
new file mode 100644 (file)
index 0000000..3cafdc5
Binary files /dev/null and b/tests/dhcpv6-ia-na.pcap differ
diff --git a/tests/dhcpv6-ia-pd.out b/tests/dhcpv6-ia-pd.out
new file mode 100644 (file)
index 0000000..f230467
--- /dev/null
@@ -0,0 +1,4 @@
+IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 56) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 solicit (xid=e1e093 (client-ID hwaddr type 1 000102030405) (option-request DNS-server DNS-search-list) (elapsed-time 0) (IA_PD IAID:33752069 T1:3600 T2:5400))
+IP6 (hlim 64, next-header UDP (17) payload length: 89) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 advertise (xid=e1e093 (IA_PD IAID:33752069 T1:3600 T2:5400 (IA_PD-prefix 2a00:1:1:100::/56 pltime:4500 vltime:7200)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259545 001122334455))
+IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 103) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 request (xid=12b08a (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259545 001122334455) (option-request DNS-server DNS-search-list) (elapsed-time 0) (IA_PD IAID:33752069 T1:3600 T2:5400 (IA_PD-prefix 2a00:1:1:100::/56 pltime:7200 vltime:7500)))
+IP6 (hlim 64, next-header UDP (17) payload length: 89) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 reply (xid=12b08a (IA_PD IAID:33752069 T1:3600 T2:5400 (IA_PD-prefix 2a00:1:1:100::/56 pltime:4500 vltime:7200)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259545 001122334455))
diff --git a/tests/dhcpv6-ia-pd.pcap b/tests/dhcpv6-ia-pd.pcap
new file mode 100644 (file)
index 0000000..5fdd067
Binary files /dev/null and b/tests/dhcpv6-ia-pd.pcap differ
diff --git a/tests/dhcpv6-ia-ta.out b/tests/dhcpv6-ia-ta.out
new file mode 100644 (file)
index 0000000..5a8acef
--- /dev/null
@@ -0,0 +1,4 @@
+IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 48) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 solicit (xid=28b040 (client-ID hwaddr type 1 000102030405) (option-request DNS-server DNS-search-list) (elapsed-time 0) (IA_TA IAID:33752069))
+IP6 (hlim 64, next-header UDP (17) payload length: 80) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 advertise (xid=28b040 (IA_TA IAID:33752069 (IA_ADDR 2a00:1:1:200:5da2:f920:84c4:88cc pltime:4500 vltime:7200)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259120 001122334455))
+IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 94) fe80::201:2ff:fe03:405.546 > ff02::1:2.547: [udp sum ok] dhcp6 request (xid=2b0e45 (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259120 001122334455) (option-request DNS-server DNS-search-list) (elapsed-time 0) (IA_TA IAID:33752069 (IA_ADDR 2a00:1:1:200:5da2:f920:84c4:88cc pltime:7200 vltime:7500)))
+IP6 (hlim 64, next-header UDP (17) payload length: 80) fe80::211:22ff:fe33:4455.547 > fe80::201:2ff:fe03:405.546: [udp sum ok] dhcp6 reply (xid=2b0e45 (IA_TA IAID:33752069 (IA_ADDR 2a00:1:1:200:5da2:f920:84c4:88cc pltime:4500 vltime:7200)) (client-ID hwaddr type 1 000102030405) (server-ID hwaddr/time type 1 time 407259120 001122334455))
diff --git a/tests/dhcpv6-ia-ta.pcap b/tests/dhcpv6-ia-ta.pcap
new file mode 100644 (file)
index 0000000..b91f8b7
Binary files /dev/null and b/tests/dhcpv6-ia-ta.pcap differ