-4.8.0-PRE-GIT
+4.9.0-PRE-GIT
--with-sandbox-capsicum use Capsicum security functions [default=yes, if
available]
--with-system-libpcap don't use local pcap library
- --with-crypto use OpenSSL libcrypto [default=yes, if available]
+ --with-crypto[=DIR] use OpenSSL/libressl libcrypto (located in directory
+ DIR, if specified) [default=yes, if available]
--with-cap-ng use libcap-ng [default=yes, if available]
Some influential environment variables:
fi
-# Check for OpenSSL libcrypto
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenSSL libcrypto" >&5
-$as_echo_n "checking whether to use OpenSSL libcrypto... " >&6; }
+# Check for OpenSSL/libressl libcrypto
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenSSL/libressl libcrypto" >&5
+$as_echo_n "checking whether to use OpenSSL/libressl libcrypto... " >&6; }
# Specify location for both includes and libraries.
want_libcrypto=ifavailable
withval=$with_crypto;
if test $withval = no
then
+ # User doesn't want to link with libcrypto.
want_libcrypto=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
elif test $withval = yes
then
+ # User wants to link with libcrypto but hasn't specified
+ # a directory.
want_libcrypto=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ else
+ # User wants to link with libcrypto and has specified
+ # a directory, so use the provided value.
+ want_libcrypto=yes
+ libcrypto_root=$withval
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, using the version installed in $withval" >&5
+$as_echo "yes, using the version installed in $withval" >&6; }
+
+ #
+ # Put the subdirectories of the libcrypto root directory
+ # at the front of the header and library search path.
+ #
+ CFLAGS="-I$withval/include $CFLAGS"
+ LIBS="-L$withval/lib $LIBS"
fi
else
#
- # Use libcrypto if it's present, otherwise don't.
+ # Use libcrypto if it's present, otherwise don't; no directory
+ # was specified.
#
want_libcrypto=ifavailable
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, if available" >&5
AC_LBL_UNALIGNED_ACCESS
-# Check for OpenSSL libcrypto
-AC_MSG_CHECKING(whether to use OpenSSL libcrypto)
+# Check for OpenSSL/libressl libcrypto
+AC_MSG_CHECKING(whether to use OpenSSL/libressl libcrypto)
# Specify location for both includes and libraries.
want_libcrypto=ifavailable
AC_ARG_WITH(crypto,
- AS_HELP_STRING([--with-crypto],
- [use OpenSSL libcrypto @<:@default=yes, if available@:>@]),
+ AS_HELP_STRING([--with-crypto]@<:@=DIR@:>@,
+ [use OpenSSL/libressl libcrypto (located in directory DIR, if specified) @<:@default=yes, if available@:>@]),
[
if test $withval = no
then
+ # User doesn't want to link with libcrypto.
want_libcrypto=no
AC_MSG_RESULT(no)
elif test $withval = yes
then
+ # User wants to link with libcrypto but hasn't specified
+ # a directory.
want_libcrypto=yes
AC_MSG_RESULT(yes)
+ else
+ # User wants to link with libcrypto and has specified
+ # a directory, so use the provided value.
+ want_libcrypto=yes
+ libcrypto_root=$withval
+ AC_MSG_RESULT([yes, using the version installed in $withval])
+
+ #
+ # Put the subdirectories of the libcrypto root directory
+ # at the front of the header and library search path.
+ #
+ CFLAGS="-I$withval/include $CFLAGS"
+ LIBS="-L$withval/lib $LIBS"
fi
],[
#
- # Use libcrypto if it's present, otherwise don't.
+ # Use libcrypto if it's present, otherwise don't; no directory
+ # was specified.
#
want_libcrypto=ifavailable
AC_MSG_RESULT([yes, if available])
* define struct in6_addr so that we can use it for IPv6 addresses.
*/
#ifndef HAVE_OS_IPV6_SUPPORT
+#ifndef AF_INET6
#define AF_INET6 24
struct in6_addr {
} __u6_addr; /* 128-bit IP6 address */
};
#endif
+#endif
#ifndef NI_MAXHOST
#define NI_MAXHOST 1025
#endif
-
+
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif
((u_char *)&addr)[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
- snprintf(buf, buflen, "%s/%d", getname(ndo, (u_char *)&addr), plen);
+ snprintf(buf, buflen, "%s/%d", ipaddr_string(ndo, &addr), plen);
return 1 + plenbytes;
trunc:
}
/* the label may get offsetted by 4 bits so lets shift it right */
snprintf(buf, buflen, "%s/%d, label:%u %s",
- getname(ndo, (u_char *)&addr),
+ ipaddr_string(ndo, &addr),
plen,
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
/* the label may get offsetted by 4 bits so lets shift it right */
snprintf(buf, buflen, "RD: %s, %s/%d, label:%u %s",
bgp_vpn_rd_print(ndo, pptr+4),
- getname(ndo, (u_char *)&addr),
+ ipaddr_string(ndo, &addr),
plen,
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
buf[0]='\0';
stringlen=snprintf(buf, buflen, "RD: %s, BGPNH: %s",
bgp_vpn_rd_print(ndo, pptr),
- /* need something like getname(ndo, ) here */
- getname(ndo, pptr+8)
+ ipaddr_string(ndo, pptr+8)
);
UPDATE_BUF_BUFLEN(buf, buflen, stringlen);
pptr+=12;
addr.s6_addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
- snprintf(buf, buflen, "%s/%d", getname6(ndo, (u_char *)&addr), plen);
+ snprintf(buf, buflen, "%s/%d", ip6addr_string(ndo, &addr), plen);
return 1 + plenbytes;
trunc:
}
/* the label may get offsetted by 4 bits so lets shift it right */
snprintf(buf, buflen, "%s/%d, label:%u %s",
- getname6(ndo, (u_char *)&addr),
+ ip6addr_string(ndo, &addr),
plen,
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
/* the label may get offsetted by 4 bits so lets shift it right */
snprintf(buf, buflen, "RD: %s, %s/%d, label:%u %s",
bgp_vpn_rd_print(ndo, pptr+4),
- getname6(ndo, (u_char *)&addr),
+ ip6addr_string(ndo, &addr),
plen,
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
ND_PRINT((ndo, "invalid len"));
else {
ND_TCHECK2(tptr[0], 4);
- ND_PRINT((ndo, "%s", getname(ndo, tptr)));
+ ND_PRINT((ndo, "%s", ipaddr_string(ndo, tptr)));
}
break;
case BGPTYPE_MULTI_EXIT_DISC:
if (len == 6) {
ND_PRINT((ndo, " AS #%s, origin %s",
as_printf(ndo, astostr, sizeof(astostr), EXTRACT_16BITS(tptr)),
- getname(ndo, tptr + 2)));
+ ipaddr_string(ndo, tptr + 2)));
} else {
ND_PRINT((ndo, " AS #%s, origin %s",
as_printf(ndo, astostr, sizeof(astostr),
- EXTRACT_32BITS(tptr)), getname(ndo, tptr + 4)));
+ EXTRACT_32BITS(tptr)), ipaddr_string(ndo, tptr + 4)));
}
break;
case BGPTYPE_AGGREGATOR4:
ND_TCHECK2(tptr[0], 8);
ND_PRINT((ndo, " AS #%s, origin %s",
as_printf(ndo, astostr, sizeof(astostr), EXTRACT_32BITS(tptr)),
- getname(ndo, tptr + 4)));
+ ipaddr_string(ndo, tptr + 4)));
break;
case BGPTYPE_COMMUNITIES:
if (len % 4) {
break;
}
ND_TCHECK2(tptr[0], 4);
- ND_PRINT((ndo, "%s",getname(ndo, tptr)));
+ ND_PRINT((ndo, "%s",ipaddr_string(ndo, tptr)));
break;
case BGPTYPE_CLUSTER_LIST:
if (len % 4) {
while (tlen>0) {
ND_TCHECK2(tptr[0], 4);
ND_PRINT((ndo, "%s%s",
- getname(ndo, tptr),
+ ipaddr_string(ndo, tptr),
(tlen>4) ? ", " : ""));
tlen -=4;
tptr +=4;
tlen = 0;
} else {
ND_TCHECK2(tptr[0], sizeof(struct in_addr));
- ND_PRINT((ndo, "%s",getname(ndo, tptr)));
+ ND_PRINT((ndo, "%s",ipaddr_string(ndo, tptr)));
tlen -= sizeof(struct in_addr);
tptr += sizeof(struct in_addr);
}
ND_TCHECK2(tptr[0], sizeof(struct in_addr)+BGP_VPN_RD_LEN);
ND_PRINT((ndo, "RD: %s, %s",
bgp_vpn_rd_print(ndo, tptr),
- getname(ndo, tptr+BGP_VPN_RD_LEN)));
+ ipaddr_string(ndo, tptr+BGP_VPN_RD_LEN)));
tlen -= (sizeof(struct in_addr)+BGP_VPN_RD_LEN);
tptr += (sizeof(struct in_addr)+BGP_VPN_RD_LEN);
}
tlen = 0;
} else {
ND_TCHECK2(tptr[0], sizeof(struct in6_addr));
- ND_PRINT((ndo, "%s", getname6(ndo, tptr)));
+ ND_PRINT((ndo, "%s", ip6addr_string(ndo, tptr)));
tlen -= sizeof(struct in6_addr);
tptr += sizeof(struct in6_addr);
}
ND_TCHECK2(tptr[0], sizeof(struct in6_addr)+BGP_VPN_RD_LEN);
ND_PRINT((ndo, "RD: %s, %s",
bgp_vpn_rd_print(ndo, tptr),
- getname6(ndo, tptr+BGP_VPN_RD_LEN)));
+ ip6addr_string(ndo, tptr+BGP_VPN_RD_LEN)));
tlen -= (sizeof(struct in6_addr)+BGP_VPN_RD_LEN);
tptr += (sizeof(struct in6_addr)+BGP_VPN_RD_LEN);
}
tlen = 0;
} else {
ND_TCHECK2(tptr[0], sizeof(struct in_addr));
- ND_PRINT((ndo, "%s", getname(ndo, tptr)));
+ ND_PRINT((ndo, "%s", ipaddr_string(ndo, tptr)));
tlen -= (sizeof(struct in_addr));
tptr += (sizeof(struct in_addr));
}
isonsap_string(ndo, tptr+BGP_VPN_RD_LEN,tlen-BGP_VPN_RD_LEN)));
/* rfc986 mapped IPv4 address ? */
if (EXTRACT_32BITS(tptr+BGP_VPN_RD_LEN) == 0x47000601)
- ND_PRINT((ndo, " = %s", getname(ndo, tptr+BGP_VPN_RD_LEN+4)));
+ ND_PRINT((ndo, " = %s", ipaddr_string(ndo, tptr+BGP_VPN_RD_LEN+4)));
/* rfc1888 mapped IPv6 address ? */
else if (EXTRACT_24BITS(tptr+BGP_VPN_RD_LEN) == 0x350000)
- ND_PRINT((ndo, " = %s", getname6(ndo, tptr+BGP_VPN_RD_LEN+3)));
+ ND_PRINT((ndo, " = %s", ip6addr_string(ndo, tptr+BGP_VPN_RD_LEN+3)));
tptr += tlen;
tlen = 0;
}
ND_PRINT((ndo, ": %u:%u (= %s)",
EXTRACT_16BITS(tptr+2),
EXTRACT_32BITS(tptr+4),
- getname(ndo, tptr+4)));
+ ipaddr_string(ndo, tptr+4)));
break;
case BGP_EXT_COM_RT_1:
case BGP_EXT_COM_RO_1:
case BGP_EXT_COM_L2VPN_RT_1:
case BGP_EXT_COM_VRF_RT_IMP:
ND_PRINT((ndo, ": %s:%u",
- getname(ndo, tptr+2),
+ ipaddr_string(ndo, tptr+2),
EXTRACT_16BITS(tptr+6)));
break;
case BGP_EXT_COM_RT_2:
case BGP_EXT_COM_VPN_ORIGIN4:
case BGP_EXT_COM_OSPF_RID:
case BGP_EXT_COM_OSPF_RID2:
- ND_PRINT((ndo, "%s", getname(ndo, tptr+2)));
+ ND_PRINT((ndo, "%s", ipaddr_string(ndo, tptr+2)));
break;
case BGP_EXT_COM_OSPF_RTYPE:
case BGP_EXT_COM_OSPF_RTYPE2:
ND_PRINT((ndo, ": area:%s, router-type:%s, metric-type:%s%s",
- getname(ndo, tptr+2),
+ ipaddr_string(ndo, tptr+2),
tok2str(bgp_extd_comm_ospf_rtype_values,
"unknown (0x%02x)",
*(tptr+6)),
ND_PRINT((ndo, "my AS %s, ",
as_printf(ndo, astostr, sizeof(astostr), ntohs(bgpo.bgpo_myas))));
ND_PRINT((ndo, "Holdtime %us, ", ntohs(bgpo.bgpo_holdtime)));
- ND_PRINT((ndo, "ID %s", getname(ndo, (u_char *)&bgpo.bgpo_id)));
+ ND_PRINT((ndo, "ID %s", ipaddr_string(ndo, &bgpo.bgpo_id)));
ND_PRINT((ndo, "\n\t Optional parameters, length: %u", bgpo.bgpo_optlen));
/* some little sanity checking */
#include "ethertype.h"
/*
- * Geneve header, draft-gross-geneve-02
+ * Geneve header, draft-ietf-nvo3-geneve
*
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
static const char *
format_opt_class(uint16_t opt_class)
{
- if (opt_class <= 0xff)
- return "Standard";
- else if (opt_class == 0xffff)
- return "Experimental";
- else
- return "Unknown";
+ switch (opt_class) {
+ case 0x0100:
+ return "Linux";
+ case 0x0101:
+ return "Open vSwitch";
+ case 0x0102:
+ return "Open Virtual Networking (OVN)";
+ case 0x0103:
+ return "In-band Network Telemetry (INT)";
+ case 0x0104:
+ return "VMware";
+ default:
+ if (opt_class <= 0x00ff)
+ return "Standard";
+ else if (opt_class >= 0xfff0)
+ return "Experimental";
+ }
+
+ return "Unknown";
}
static void
if (len < opts_len) {
ND_PRINT((ndo, " truncated-geneve - %u bytes missing",
- len - opts_len));
+ opts_len - len));
return;
}
{ 0, NULL},
};
-static void
-rpl_format_dagid(char dagid_str[65], const u_char *dagid)
-{
- char *d = dagid_str;
- int i;
-
- for(i=0;i<16;i++) {
- if(isprint(dagid[i])) {
- *d++ = dagid[i];
- } else {
- snprintf(d,5,"0x%02x", dagid[i]); /* 4 + null char */
- d += 4;
- }
- }
- *d++ = '\0';
-}
-
static void
rpl_dio_printopt(netdissect_options *ndo,
const struct rpl_dio_genoption *opt,
const u_char *bp, u_int length)
{
const struct nd_rpl_dio *dio = (const struct nd_rpl_dio *)bp;
- char dagid_str[65];
+ const char *dagid_str;
ND_TCHECK(*dio);
- rpl_format_dagid(dagid_str, dio->rpl_dagid);
+ dagid_str = ip6addr_string (ndo, dio->rpl_dagid);
ND_PRINT((ndo, " [dagid:%s,seq:%u,instance:%u,rank:%u,%smop:%s,prf:%u]",
dagid_str,
const u_char *bp, u_int length)
{
const struct nd_rpl_dao *dao = (const struct nd_rpl_dao *)bp;
- char dagid_str[65];
+ const char *dagid_str = "<elided>";
ND_TCHECK(*dao);
if (length < ND_RPL_DAO_MIN_LEN)
goto tooshort;
- strcpy(dagid_str,"<elided>");
bp += ND_RPL_DAO_MIN_LEN;
length -= ND_RPL_DAO_MIN_LEN;
if(RPL_DAO_D(dao->rpl_flags)) {
ND_TCHECK2(dao->rpl_dagid, DAGID_LEN);
if (length < DAGID_LEN)
goto tooshort;
- rpl_format_dagid(dagid_str, dao->rpl_dagid);
+ dagid_str = ip6addr_string (ndo, dao->rpl_dagid);
bp += DAGID_LEN;
length -= DAGID_LEN;
}
const u_char *bp, u_int length)
{
const struct nd_rpl_daoack *daoack = (const struct nd_rpl_daoack *)bp;
- char dagid_str[65];
+ const char *dagid_str = "<elided>";
ND_TCHECK2(*daoack, ND_RPL_DAOACK_MIN_LEN);
if (length < ND_RPL_DAOACK_MIN_LEN)
goto tooshort;
- strcpy(dagid_str,"<elided>");
bp += ND_RPL_DAOACK_MIN_LEN;
length -= ND_RPL_DAOACK_MIN_LEN;
if(RPL_DAOACK_D(daoack->rpl_flags)) {
- ND_TCHECK2(daoack->rpl_dagid, 16);
+ ND_TCHECK2(daoack->rpl_dagid, DAGID_LEN);
if (length < DAGID_LEN)
goto tooshort;
- rpl_format_dagid(dagid_str, daoack->rpl_dagid);
+ dagid_str = ip6addr_string (ndo, daoack->rpl_dagid);
bp += DAGID_LEN;
length -= DAGID_LEN;
}
case ND_REDIRECT:
#define RDR(i) ((const struct nd_redirect *)(i))
ND_TCHECK(RDR(dp)->nd_rd_dst);
- ND_PRINT((ndo,", %s", getname6(ndo, (const u_char *)&RDR(dp)->nd_rd_dst)));
+ ND_PRINT((ndo,", %s", ip6addr_string(ndo, &RDR(dp)->nd_rd_dst)));
ND_TCHECK(RDR(dp)->nd_rd_target);
ND_PRINT((ndo," to %s",
- getname6(ndo, (const u_char*)&RDR(dp)->nd_rd_target)));
+ ip6addr_string(ndo, &RDR(dp)->nd_rd_target)));
#define REDIRECTLEN 40
if (ndo->ndo_vflag) {
icmp6_opt_print(ndo, (const u_char *)dp + REDIRECTLEN,
break;
}
ND_PRINT((ndo,", subject=%s",
- getname6(ndo, (const u_char *)(ni6 + 1))));
+ ip6addr_string(ndo, ni6 + 1)));
break;
case ICMP6_NI_SUBJ_FQDN:
ND_PRINT((ndo,", subject=DNS name"));
break;
}
ND_PRINT((ndo,", subject=%s",
- getname(ndo, (const u_char *)(ni6 + 1))));
+ ipaddr_string(ndo, ni6 + 1)));
break;
default:
ND_PRINT((ndo,", unknown subject"));
while (i < siz) {
if (i + sizeof(struct in6_addr) + sizeof(int32_t) > siz)
break;
- ND_PRINT((ndo," %s", getname6(ndo, bp + i)));
+ ND_PRINT((ndo," %s", ip6addr_string(ndo, bp + i)));
i += sizeof(struct in6_addr);
ND_PRINT((ndo,"(%d)", (int32_t)EXTRACT_32BITS(bp + i)));
i += sizeof(int32_t);
switch (eid_afi) {
case IPv4_AFI:
ND_TCHECK2(*(packet_iterator + packet_offset), 4);
- ND_PRINT((ndo, " EID %s/%u,", getname(ndo,
+ ND_PRINT((ndo, " EID %s/%u,", ipaddr_string(ndo,
packet_iterator + packet_offset), mask_len));
packet_offset += 4;
break;
case IPv6_AFI:
ND_TCHECK2(*(packet_iterator + packet_offset), 16);
- ND_PRINT((ndo, " EID %s/%u,", getname6(ndo,
+ ND_PRINT((ndo, " EID %s/%u,", ip6addr_string(ndo,
packet_iterator + packet_offset), mask_len));
packet_offset += 16;
break;
switch (loc_afi) {
case IPv4_AFI:
ND_TCHECK2(*(packet_iterator + packet_offset), 4);
- ND_PRINT((ndo, " LOC %s", getname(ndo, loc_ip_pointer)));
+ ND_PRINT((ndo, " LOC %s", ipaddr_string(ndo, loc_ip_pointer)));
packet_offset += 4;
break;
case IPv6_AFI:
ND_TCHECK2(*(packet_iterator + packet_offset), 16);
- ND_PRINT((ndo, " LOC %s", getname6(ndo, loc_ip_pointer)));
+ ND_PRINT((ndo, " LOC %s", ip6addr_string(ndo, loc_ip_pointer)));
packet_offset += 16;
break;
default:
case AFNUM_INET:
if (len < 4)
return NULL;
+ /* This cannot be assigned to ipaddr_string(), which is a macro. */
pfunc = getname;
break;
case AFNUM_INET6:
if (len < 16)
return NULL;
+ /* This cannot be assigned to ip6addr_string(), which is a macro. */
pfunc = getname6;
break;
case AFNUM_802:
/* draft-ietf-ospf-mt-09 */
static const struct tok ospf_topology_values[] = {
- { 0, "default " },
- { 1, "multicast " },
- { 2, "management " },
+ { 0, "default" },
+ { 1, "multicast" },
+ { 2, "management" },
{ 0, NULL }
};
/*
* Print all the per-topology metrics.
*/
-static void
+static int
ospf_print_tos_metrics(netdissect_options *ndo,
const union un_tos *tos)
{
/*
* All but the first metric contain a valid topology id.
*/
- while (toscount) {
- ND_PRINT((ndo, "\n\t\ttopology %s(%u), metric %u",
- tok2str(ospf_topology_values, "",
+ while (toscount > 0) {
+ ND_TCHECK(*tos);
+ ND_PRINT((ndo, "\n\t\ttopology %s (%u), metric %u",
+ tok2str(ospf_topology_values, "Unknown",
metric_count ? tos->metrics.tos_type : 0),
metric_count ? tos->metrics.tos_type : 0,
EXTRACT_16BITS(&tos->metrics.tos_metric)));
tos++;
toscount--;
}
+ return 0;
+trunc:
+ return 1;
}
/*
return (ls_end);
}
- ospf_print_tos_metrics(ndo, &rlp->un_tos);
+ if (ospf_print_tos_metrics(ndo, &rlp->un_tos))
+ goto trunc;
rlp = (const struct rlalink *)((const u_char *)(rlp + 1) +
((rlp->un_tos.link.link_tos_count) * sizeof(union un_tos)));
ND_TCHECK(*lp);
ul = EXTRACT_32BITS(lp);
topology = (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS;
- ND_PRINT((ndo, "\n\t\ttopology %s(%u) metric %d",
- tok2str(ospf_topology_values, "", topology),
+ ND_PRINT((ndo, "\n\t\ttopology %s (%u) metric %d",
+ tok2str(ospf_topology_values, "Unknown", topology),
topology,
ul & SLA_MASK_METRIC));
++lp;
ND_TCHECK(*lp);
ul = EXTRACT_32BITS(lp);
topology = (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS;
- ND_PRINT((ndo, "\n\t\ttopology %s(%u) metric %d",
- tok2str(ospf_topology_values, "", topology),
+ ND_PRINT((ndo, "\n\t\ttopology %s (%u) metric %d",
+ tok2str(ospf_topology_values, "Unknown", topology),
topology,
ul & SLA_MASK_METRIC));
++lp;
ND_TCHECK(almp->asla_tosmetric);
ul = EXTRACT_32BITS(&almp->asla_tosmetric);
topology = ((ul & ASLA_MASK_TOS) >> ASLA_SHIFT_TOS);
- ND_PRINT((ndo, "\n\t\ttopology %s(%u), type %d, metric",
- tok2str(ospf_topology_values, "", topology),
+ ND_PRINT((ndo, "\n\t\ttopology %s (%u), type %d, metric",
+ tok2str(ospf_topology_values, "Unknown", topology),
topology,
(ul & ASLA_FLAG_EXTERNAL) ? 2 : 1));
if ((ul & ASLA_MASK_METRIC) == 0xffffff)
*/
#define RESP_PRINT_SEGMENT(_ndo, _bp, _len) \
ND_PRINT((_ndo, " \"")); \
- fn_printn(_ndo, _bp, _len, _ndo->ndo_snapend); \
+ if (fn_printn(_ndo, _bp, _len, _ndo->ndo_snapend)) \
+ goto trunc; \
fn_print_char(_ndo, '"');
void
ND_TCHECK2(*tptr, text_length);
if (text_length && (text_length <= tlen )) {
ND_PRINT((ndo, "%sError text: ", indent_string(indent+2)));
- fn_printn(ndo, tptr, text_length, ndo->ndo_snapend);
+ if (fn_printn(ndo, tptr, text_length, ndo->ndo_snapend))
+ goto trunc;
}
}
break;
switch(rsvp_obj_ctype) {
case RSVP_CTYPE_IPV4:
while(obj_tlen >= 4 ) {
+ u_char length;
+
+ ND_TCHECK2(*obj_tptr, 4);
+ length = *(obj_tptr + 1);
ND_PRINT((ndo, "%s Subobject Type: %s, length %u",
ident,
tok2str(rsvp_obj_xro_values,
"Unknown %u",
RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr)),
- *(obj_tptr + 1)));
+ length));
- if (*(obj_tptr+1) == 0) { /* prevent infinite loops */
+ if (length == 0) { /* prevent infinite loops */
ND_PRINT((ndo, "%s ERROR: zero length ERO subtype", ident));
break;
}
switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr)) {
+ u_char prefix_length;
+
case RSVP_OBJ_XRO_IPV4:
+ if (length != 8) {
+ ND_PRINT((ndo, " ERROR: length != 8"));
+ goto invalid;
+ }
+ ND_TCHECK2(*obj_tptr, 8);
+ prefix_length = *(obj_tptr+6);
+ if (prefix_length != 32) {
+ ND_PRINT((ndo, " ERROR: Prefix length %u != 32",
+ prefix_length));
+ goto invalid;
+ }
ND_PRINT((ndo, ", %s, %s/%u, Flags: [%s]",
RSVP_OBJ_XRO_MASK_LOOSE(*obj_tptr) ? "Loose" : "Strict",
ipaddr_string(ndo, obj_tptr+2),
*(obj_tptr + 7)))); /* rfc3209 says that this field is rsvd. */
break;
case RSVP_OBJ_XRO_LABEL:
+ if (length != 8) {
+ ND_PRINT((ndo, " ERROR: length != 8"));
+ goto invalid;
+ }
+ ND_TCHECK2(*obj_tptr, 8);
ND_PRINT((ndo, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
bittok2str(rsvp_obj_rro_label_flag_values,
"none",
case 'C':
Cflag = atoi(optarg) * 1000000;
- if (Cflag < 0)
+ if (Cflag <= 0)
error("invalid file size %s", optarg);
break;
ndo->ndo_packettype = PT_PGM_ZMTP1;
else if (ascii_strcasecmp(optarg, "lmp") == 0)
ndo->ndo_packettype = PT_LMP;
- else if (strcasecmp(optarg, "resp") == 0)
- ndo->ndo_packettype = PT_RESP;
+ else if (ascii_strcasecmp(optarg, "resp") == 0)
+ ndo->ndo_packettype = PT_RESP;
else
error("unknown packet type `%s'", optarg);
break;
case 'W':
Wflag = atoi(optarg);
- if (Wflag < 0)
+ if (Wflag <= 0)
error("invalid number of output files %s", optarg);
WflagChars = getWflagChars(Wflag);
break;
-IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:pandora is fun0x0al,seq:1,instance:1,Dagid,40]
+IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:7061:6e64:6f72:6120:6973:2066:756e:a6c,seq:1,instance:1,Dagid,40]
-IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:T10x000x000x000x000x000x000x000x000x000x000x000x000x000x00,seq:10,instance:42,Dagid,40] opt:rpltarget len:25 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0
+IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:5431::,seq:10,instance:42,Dagid,40] opt:rpltarget len:25 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0
-IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:T10x000x000x000x000x000x000x000x000x000x000x000x000x000x00,seq:10,instance:42,Dagid,40] opt:rpltarget len:25 0x0000: 0080 2001 0db8 0001 0000 0216 3eff fe11 0x0010: 3424 0000 0000 00 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0
+IP6 (hlim 64, next-header ICMPv6 (58) payload length: 56) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:5431::,seq:10,instance:42,Dagid,40] opt:rpltarget len:25 0x0000: 0080 2001 0db8 0001 0000 0216 3eff fe11 0x0010: 3424 0000 0000 00 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0 opt:pad0
-IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object Ack [dagid:thisismydicedag2,seq:11,instance:43,status:0]
+IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object Ack [dagid:7468:6973:6973:6d79:6469:6365:6461:6732,seq:11,instance:43,status:0]