uint16_t
nextproto4_cksum(netdissect_options *ndo,
const struct ip *ip, const uint8_t *data,
- u_int len, u_int covlen, u_int next_proto)
+ u_int len, u_int covlen, uint8_t next_proto)
{
struct phdr {
uint32_t src;
uint32_t dst;
- u_char mbz;
- u_char proto;
+ uint8_t mbz;
+ uint8_t proto;
uint16_t len;
} ph;
struct cksum_vec vec[2];
u_int length)
{
const struct ip *ip;
- const u_char *ipend;
u_int off;
u_int hlen;
u_int len;
/*
* Cut off the snapshot length to the end of the IP payload.
*/
- ipend = bp + len;
- if (ipend < ndo->ndo_snapend)
- ndo->ndo_snapend = ipend;
+ nd_push_snapend(ndo, bp + len);
len -= hlen;
* fragments.
*/
if ((off & IP_OFFMASK) == 0) {
- u_int nh = GET_U_1(ip->ip_p);
+ uint8_t nh = GET_U_1(ip->ip_p);
if (nh != IPPROTO_TCP && nh != IPPROTO_UDP &&
nh != IPPROTO_SCTP && nh != IPPROTO_DCCP) {
* Ultra quiet now means that all this stuff should be
* suppressed.
*/
- if (ndo->ndo_qflag > 1)
+ if (ndo->ndo_qflag > 1) {
+ nd_pop_packet_info(ndo);
return;
+ }
/*
* This isn't the first frag, so we're missing the
else
ND_PRINT(" ip-proto-%u", ip_proto);
}
+ nd_pop_packet_info(ndo);
return;
trunc:
nd_print_trunc(ndo);
+ nd_pop_packet_info(ndo);
return;
}