Skip to content

Commit 2abf6a8

Browse files
committed
IPv6 mobility: Print the protocol name before the checks
Use nd_print_protocol(). Update a test output.
1 parent a9f3e09 commit 2abf6a8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

print-mobility.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ mobility_print(netdissect_options *ndo,
208208
uint8_t type;
209209

210210
ndo->ndo_protocol = "mobility";
211+
nd_print_protocol(ndo);
212+
ND_PRINT(": ");
211213
mh = (const struct ip6_mobility *)bp;
212214

213215
/* 'ep' points to the end of available data. */
@@ -238,7 +240,7 @@ mobility_print(netdissect_options *ndo,
238240
ND_PRINT("(header length %u is too small for type %u)", mhlen, type);
239241
goto trunc;
240242
}
241-
ND_PRINT("mobility: %s", tok2str(ip6m_str, "type-#%u", type));
243+
ND_PRINT("%s", tok2str(ip6m_str, "type-#%u", type));
242244
switch (type) {
243245
case IP6M_BINDING_REQUEST:
244246
hlen = IP6M_MINLEN;

tests/cve2015-0261-ipv6.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
1 2002-12-31 13:55:31.300000 IP6 [header+payload length 26510 > length 185] (invalid) (class 0x76, flowlabel 0x76767, hlim 103, next-header Mobility (135), payload length 26470) 6767:6767:6767:6767:6767:6767:6767:6767 > 6767:6767:6767:6767:6767:6767:6767:6705: mobility: BU seq#=26471 HL lifetime=105884(type-0x67: len=103) [|mobility]
2-
2 2003-03-06 15:21:11.300000 IP6 [header+payload length 26510 > length 185] (invalid) (class 0x76, flowlabel 0x76767, hlim 103, next-header Mobility (135), payload length 26470) 6767:6767:6767:6767:6767:6767:6767:6767 > 6767:6767:4f67:6767:6767:6767:6767:6767: (header length 8 is too small for type 6) [|mobility]
2+
2 2003-03-06 15:21:11.300000 IP6 [header+payload length 26510 > length 185] (invalid) (class 0x76, flowlabel 0x76767, hlim 103, next-header Mobility (135), payload length 26470) 6767:6767:6767:6767:6767:6767:6767:6767 > 6767:6767:4f67:6767:6767:6767:6767:6767: mobility: (header length 8 is too small for type 6) [|mobility]

0 commit comments

Comments
 (0)