#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.24 2002-08-01 08:53:10 risso Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.25 2002-08-02 04:10:14 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
#define IPPROTO_MOBILITY 62
#endif
case IPPROTO_MOBILITY:
+ /*
+ * XXX - we don't use "advance"; is this
+ * header always a final header?
+ */
advance = mobility_print(cp, (const u_char *)ip6);
nh = *cp;
goto end;
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.3 2002-08-01 08:53:19 risso Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.4 2002-08-02 04:10:14 guy Exp $";
#endif
#ifdef INET6
#define IP6MOPT_AUTH 0x5
#define IP6MOPT_AUTH_MINLEN 2 /* 2+len */
-void
+static void
mobility_opt_print(const u_char *bp, int len)
{
int i;
/* 'ep' points to the end of available data. */
ep = snapend;
- TCHECK(mh->ip6m_len);
+ if (!TTEST(mh->ip6m_len)) {
+ /*
+ * There's not enough captured data to include the
+ * mobility header length.
+ *
+ * Our caller expects us to return the length, however,
+ * so return a value that will run to the end of the
+ * captured data.
+ *
+ * XXX - "ip6_print()" doesn't do anything with the
+ * returned length, however, as it breaks out of the
+ * header-processing loop.
+ */
+ mhlen = ep - bp;
+ goto trunc;
+ }
mhlen = (int)(mh->ip6m_len << 3);
if (mhlen < IP6M_MINLEN)
mhlen = IP6M_MINLEN; /* XXX */