Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/netdump/netdump_client.c
Show First 20 Lines • Show All 551 Lines • ▼ Show 20 Lines | netdump_handle_ip(struct mbuf **mb) | ||||
} | } | ||||
/* Ignore packets with IP options. */ | /* Ignore packets with IP options. */ | ||||
if (hlen > sizeof(struct ip)) { | if (hlen > sizeof(struct ip)) { | ||||
NETDDEBUG("drop packet with IP options\n"); | NETDDEBUG("drop packet with IP options\n"); | ||||
return; | return; | ||||
} | } | ||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
if (((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || | if ((IN_LOOPBACK(ntohl(ip->ip_dst.s_addr)) || | ||||
(ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) && | IN_LOOPBACK(ntohl(ip->ip_src.s_addr))) && | ||||
(m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) { | (m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) { | ||||
NETDDEBUG("Bad IP header (RFC1122)\n"); | NETDDEBUG("Bad IP header (RFC1122)\n"); | ||||
return; | return; | ||||
} | } | ||||
#endif | #endif | ||||
/* Checksum. */ | /* Checksum. */ | ||||
if ((m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) != 0) { | if ((m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) != 0) { | ||||
▲ Show 20 Lines • Show All 740 Lines • Show Last 20 Lines |