| version 1.163, 2002/11/12 02:10:13 |
version 1.164, 2003/02/26 06:31:14 |
| Line 309 static struct ip_srcrt { |
|
| Line 309 static struct ip_srcrt { |
|
| |
|
| static void save_rte __P((u_char *, struct in_addr)); |
static void save_rte __P((u_char *, struct in_addr)); |
| |
|
| |
#ifdef MBUFTRACE |
| |
struct mowner ip_rx_mowner = { "internet", "rx" }; |
| |
struct mowner ip_tx_mowner = { "internet", "tx" }; |
| |
#endif |
| |
|
| /* |
/* |
| * IP initialization: fill in IP protocol switch table. |
* IP initialization: fill in IP protocol switch table. |
| * All protocols not implemented in kernel go to raw IP protocol handler. |
* All protocols not implemented in kernel go to raw IP protocol handler. |
|
|
| evcnt_attach_static(&ip_hwcsum_ok); |
evcnt_attach_static(&ip_hwcsum_ok); |
| evcnt_attach_static(&ip_swcsum); |
evcnt_attach_static(&ip_swcsum); |
| #endif /* INET_CSUM_COUNTERS */ |
#endif /* INET_CSUM_COUNTERS */ |
| |
|
| |
#ifdef MBUFTRACE |
| |
MOWNER_ATTACH(&ip_tx_mowner); |
| |
MOWNER_ATTACH(&ip_rx_mowner); |
| |
#endif /* MBUFTRACE */ |
| } |
} |
| |
|
| struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; |
struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; |
|
|
| splx(s); |
splx(s); |
| if (m == 0) |
if (m == 0) |
| return; |
return; |
| |
MCLAIM(m, &ip_rx_mowner); |
| ip_input(m); |
ip_input(m); |
| } |
} |
| } |
} |
| Line 397 ip_input(struct mbuf *m) |
|
| Line 408 ip_input(struct mbuf *m) |
|
| int hlen = 0, mff, len; |
int hlen = 0, mff, len; |
| int downmatch; |
int downmatch; |
| |
|
| |
MCLAIM(m, &ip_rx_mowner); |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if ((m->m_flags & M_PKTHDR) == 0) |
if ((m->m_flags & M_PKTHDR) == 0) |
| panic("ipintr no HDR"); |
panic("ipintr no HDR"); |
| Line 411 ip_input(struct mbuf *m) |
|
| Line 423 ip_input(struct mbuf *m) |
|
| m->m_flags &= ~M_AUTHIPDGM; |
m->m_flags &= ~M_AUTHIPDGM; |
| } |
} |
| #endif |
#endif |
| |
|
| /* |
/* |
| * If no IP addresses have been set yet but the interfaces |
* If no IP addresses have been set yet but the interfaces |
| * are receiving, can't do anything with incoming packets yet. |
* are receiving, can't do anything with incoming packets yet. |
|
|
| if (m == 0) |
if (m == 0) |
| return ((struct mbuf *)0); |
return ((struct mbuf *)0); |
| |
|
| |
MCLAIM(m, &inetdomain.dom_mowner); |
| #define OPTSIZ (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt)) |
#define OPTSIZ (sizeof(ip_srcrt.nop) + sizeof(ip_srcrt.srcopt)) |
| |
|
| /* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */ |
/* length is (nhops+1)*sizeof(addr) + sizeof(nop + srcrt header) */ |
| Line 1509 ip_forward(m, srcrt) |
|
| Line 1523 ip_forward(m, srcrt) |
|
| #endif |
#endif |
| |
|
| /* |
/* |
| |
* We are now in the output path. |
| |
*/ |
| |
MCLAIM(m, &ip_tx_mowner); |
| |
|
| |
/* |
| * Clear any in-bound checksum flags for this packet. |
* Clear any in-bound checksum flags for this packet. |
| */ |
*/ |
| m->m_pkthdr.csum_flags = 0; |
m->m_pkthdr.csum_flags = 0; |