The Pad1 TLV consists only of the Type field (RFC6126 Section 4.4.1),
thus the check for Pad1 type must be done before the Length field is
consumed, if ever. This change brings tcpdump decoder into line with the
spec and Babel implementation's own TLV iterator.
u_int type, len;
message = cp + 4 + i;
u_int type, len;
message = cp + 4 + i;
+
+ TCHECK2(*message, 1);
+ if((type = message[0]) == MESSAGE_PAD1) {
+ printf(vflag ? "\n\tPad 1" : " pad1");
+ i += 1;
+ continue;
+ }
+
TCHECK2(*message, 2);
ICHECK(i, 2);
TCHECK2(*message, 2);
ICHECK(i, 2);
len = message[1];
TCHECK2(*message, 2 + len);
ICHECK(i, 2 + len);
switch(type) {
len = message[1];
TCHECK2(*message, 2 + len);
ICHECK(i, 2 + len);
switch(type) {
- case MESSAGE_PAD1: {
- if(!vflag)
- printf(" pad1");
- else
- printf("\n\tPad 1");
- }
- break;
-
case MESSAGE_PADN: {
if(!vflag)
printf(" padN");
case MESSAGE_PADN: {
if(!vflag)
printf(" padN");
-IP6 fe80::b299:28ff:fec8:d646.6696 > ff02::1:6.6696: babel 2 (9) hello [|babel]
-IP6 fe80::b299:28ff:fec8:d646.6696 > ff02::1:6.6696: babel 2 (60) hello pad1 pad1 [|babel]
+IP6 fe80::b299:28ff:fec8:d646.6696 > ff02::1:6.6696: babel 2 (9) hello pad1
+IP6 fe80::b299:28ff:fec8:d646.6696 > ff02::1:6.6696: babel 2 (60) hello pad1 nh pad1 router-id pad1 update pad1 update pad1