ND_PRINT("udp/va/vat, length %u < 2", length);
return;
}
- ND_TCHECK_2((const u_int *)hdr);
ts = GET_BE_U_2(hdr);
if ((ts & 0xf060) != 0) {
/* probably vt */
ND_PRINT("udp/vat, length %u < 8", length);
return;
}
- ND_TCHECK_4(&((const u_int *)hdr)[0]);
i0 = GET_BE_U_4(&((const u_int *)hdr)[0]);
- ND_TCHECK_4(&((const u_int *)hdr)[1]);
i1 = GET_BE_U_4(&((const u_int *)hdr)[1]);
ND_PRINT("udp/vat %u c%u %u%s",
length - 8,
if (i0 & 0x3f000000)
ND_PRINT(" s%u", (i0 >> 24) & 0x3f);
}
- return;
-
-trunc:
- nd_print_trunc(ndo);
}
static void
ND_PRINT("udp/rtp, length %u < 8", len);
return;
}
- ND_TCHECK_4(&((const u_int *)hdr)[0]);
i0 = GET_BE_U_4(&((const u_int *)hdr)[0]);
- ND_TCHECK_4(&((const u_int *)hdr)[1]);
i1 = GET_BE_U_4(&((const u_int *)hdr)[1]);
dlen = len - 8;
ip += 2;
i0 & 0xffff,
i1);
if (ndo->ndo_vflag) {
- ND_TCHECK_4(&((const u_int *)hdr)[2]);
ND_PRINT(" %u", GET_BE_U_4(&((const u_int *)hdr)[2]));
if (hasopt) {
u_int i2, optlen;
do {
- ND_TCHECK_4(ip);
i2 = GET_BE_U_4(ip);
optlen = (i2 >> 16) & 0xff;
if (optlen == 0 || optlen > len) {
}
if (hasext) {
u_int i2, extlen;
- ND_TCHECK_4(ip);
i2 = GET_BE_U_4(ip);
extlen = (i2 & 0xffff) + 1;
if (extlen > len) {
}
ip += extlen;
}
- ND_TCHECK_4(ip);
if (contype == 0x1f) /*XXX H.261 */
ND_PRINT(" 0x%04x", GET_BE_U_4(ip) >> 16);
}
- return;
-
-trunc:
- nd_print_trunc(ndo);
}
static const u_char *
if (GET_U_1(ip6->ip6_nxt) == IPPROTO_UDP) {
if (sport == -1) {
ND_PRINT("%s > %s: ",
- ip6addr_string(ndo, ip6->ip6_src),
- ip6addr_string(ndo, ip6->ip6_dst));
+ GET_IP6ADDR_STRING(ip6->ip6_src),
+ GET_IP6ADDR_STRING(ip6->ip6_dst));
} else {
ND_PRINT("%s.%s > %s.%s: ",
- ip6addr_string(ndo, ip6->ip6_src),
+ GET_IP6ADDR_STRING(ip6->ip6_src),
udpport_string(ndo, (uint16_t)sport),
- ip6addr_string(ndo, ip6->ip6_dst),
+ GET_IP6ADDR_STRING(ip6->ip6_dst),
udpport_string(ndo, (uint16_t)dport));
}
} else {
if (GET_U_1(ip->ip_p) == IPPROTO_UDP) {
if (sport == -1) {
ND_PRINT("%s > %s: ",
- ipaddr_string(ndo, ip->ip_src),
- ipaddr_string(ndo, ip->ip_dst));
+ GET_IPADDR_STRING(ip->ip_src),
+ GET_IPADDR_STRING(ip->ip_dst));
} else {
ND_PRINT("%s.%s > %s.%s: ",
- ipaddr_string(ndo, ip->ip_src),
+ GET_IPADDR_STRING(ip->ip_src),
udpport_string(ndo, (uint16_t)sport),
- ipaddr_string(ndo, ip->ip_dst),
+ GET_IPADDR_STRING(ip->ip_dst),
udpport_string(ndo, (uint16_t)dport));
}
} else {
case PT_RPC:
rp = (const struct sunrpc_msg *)cp;
- ND_TCHECK_4(rp->rm_direction);
direction = (enum sunrpc_msg_type) GET_BE_U_4(rp->rm_direction);
if (direction == SUNRPC_CALL)
sunrpc_print(ndo, (const u_char *)rp, length,
* TCP does, and we do so for UDP-over-IPv6.
*/
if (IP_V(ip) == 4 && (ndo->ndo_vflag > 1)) {
- ND_TCHECK_2(up->uh_sum);
udp_sum = GET_BE_U_2(up->uh_sum);
if (udp_sum == 0) {
ND_PRINT("[no cksum] ");
/* for IPv6, UDP checksum is mandatory */
if (ND_TTEST_LEN(cp, length)) {
sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr));
- ND_TCHECK_2(up->uh_sum);
udp_sum = GET_BE_U_2(up->uh_sum);
if (sum != 0) {
IS_SRC_OR_DST_PORT(RADIUS_NEW_ACCOUNTING_PORT) ||
IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT) ||
IS_SRC_OR_DST_PORT(RADIUS_COA_PORT) )
- radius_print(ndo, (const u_char *)(up+1), length);
+ radius_print(ndo, cp, length);
else if (dport == HSRP_PORT)
hsrp_print(ndo, cp, length);
else if (IS_SRC_OR_DST_PORT(LWRES_PORT))
else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT))
lspping_print(ndo, cp, length);
else if (sport == BCM_LI_PORT)
- bcm_li_print(ndo, (const u_char *)(up+1), length);
+ bcm_li_print(ndo, cp, length);
else if (dport == BFD_CONTROL_PORT ||
dport == BFD_MULTIHOP_PORT ||
dport == BFD_LAG_PORT ||
dport == BFD_ECHO_PORT )
- bfd_print(ndo, (const u_char *)(up+1), length, dport);
+ bfd_print(ndo, cp, length, dport);
else if (IS_SRC_OR_DST_PORT(LMP_PORT))
lmp_print(ndo, cp, length);
else if (IS_SRC_OR_DST_PORT(VQP_PORT))