Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_gif.c
Show First 20 Lines • Show All 512 Lines • ▼ Show 20 Lines | gif_input(struct mbuf *m, struct ifnet *ifp, int proto, uint8_t ecn) | ||||
struct etherip_header *eip; | struct etherip_header *eip; | ||||
#ifdef INET | #ifdef INET | ||||
struct ip *ip; | struct ip *ip; | ||||
#endif | #endif | ||||
#ifdef INET6 | #ifdef INET6 | ||||
struct ip6_hdr *ip6; | struct ip6_hdr *ip6; | ||||
uint32_t t; | uint32_t t; | ||||
#endif | #endif | ||||
struct gif_softc *sc; | |||||
struct ether_header *eh; | struct ether_header *eh; | ||||
struct ifnet *oldifp; | struct ifnet *oldifp; | ||||
int isr, n, af; | int isr, n, af; | ||||
if (ifp == NULL) { | if (ifp == NULL) { | ||||
/* just in case */ | /* just in case */ | ||||
m_freem(m); | m_freem(m); | ||||
return; | return; | ||||
} | } | ||||
sc = ifp->if_softc; | |||||
m->m_pkthdr.rcvif = ifp; | m->m_pkthdr.rcvif = ifp; | ||||
m_clrprotoflags(m); | m_clrprotoflags(m); | ||||
switch (proto) { | switch (proto) { | ||||
#ifdef INET | #ifdef INET | ||||
case IPPROTO_IPV4: | case IPPROTO_IPV4: | ||||
af = AF_INET; | af = AF_INET; | ||||
if (m->m_len < sizeof(struct ip)) | if (m->m_len < sizeof(struct ip)) | ||||
m = m_pullup(m, sizeof(struct ip)); | m = m_pullup(m, sizeof(struct ip)); | ||||
▲ Show 20 Lines • Show All 525 Lines • Show Last 20 Lines |