Skip to content

Commit 65403c7

Browse files
committed
IPv6 mobility: Delete an useless custom check
The truncation is handled by the GET_U_1(). In any case, after 66df248, the 'mhlen = (unsigned)(ep - bp)' was useless, because: ... Also, change mobility_print() to return -1 if it runs up against the end of the packet, and stop dissecting if it does so. ...
1 parent 4114d55 commit 65403c7

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

print-mobility.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ mobility_print(netdissect_options *ndo,
203203
const u_char *bp, const u_char *bp2 _U_)
204204
{
205205
const struct ip6_mobility *mh;
206-
const u_char *ep;
207206
unsigned mhlen, hlen;
208207
uint8_t pproto, type;
209208

@@ -217,25 +216,6 @@ mobility_print(netdissect_options *ndo,
217216
ND_PRINT("(payload protocol %u should be %u) ", pproto,
218217
IPPROTO_NONE);
219218

220-
/* 'ep' points to the end of available data. */
221-
ep = ndo->ndo_snapend;
222-
223-
if (!ND_TTEST_1(mh->ip6m_len)) {
224-
/*
225-
* There's not enough captured data to include the
226-
* mobility header length.
227-
*
228-
* Our caller expects us to return the length, however,
229-
* so return a value that will run to the end of the
230-
* captured data.
231-
*
232-
* XXX - "ip6_print()" doesn't do anything with the
233-
* returned length, however, as it breaks out of the
234-
* header-processing loop.
235-
*/
236-
mhlen = (unsigned)(ep - bp);
237-
goto trunc;
238-
}
239219
mhlen = (GET_U_1(mh->ip6m_len) + 1) << 3;
240220

241221
/* XXX ip6m_cksum */

0 commit comments

Comments
 (0)