version 1.21, 1995/06/07 16:01:15 |
version 1.22, 1995/06/12 00:47:41 |
Line 78 extern struct domain inetdomain; |
|
Line 78 extern struct domain inetdomain; |
|
extern struct protosw inetsw[]; |
extern struct protosw inetsw[]; |
u_char ip_protox[IPPROTO_MAX]; |
u_char ip_protox[IPPROTO_MAX]; |
int ipqmaxlen = IFQ_MAXLEN; |
int ipqmaxlen = IFQ_MAXLEN; |
struct in_ifaddr *in_ifaddr; /* first inet address */ |
struct in_ifaddrhead in_ifaddr; |
struct ifqueue ipintrq; |
struct ifqueue ipintrq; |
|
|
/* |
/* |
|
|
ipq.next = ipq.prev = &ipq; |
ipq.next = ipq.prev = &ipq; |
ip_id = time.tv_sec & 0xffff; |
ip_id = time.tv_sec & 0xffff; |
ipintrq.ifq_maxlen = ipqmaxlen; |
ipintrq.ifq_maxlen = ipqmaxlen; |
|
TAILQ_INIT(&in_ifaddr); |
} |
} |
|
|
struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; |
struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; |
|
|
* 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 (in_ifaddr == NULL) |
if (in_ifaddr.tqh_first == 0) |
goto bad; |
goto bad; |
ipstat.ips_total++; |
ipstat.ips_total++; |
if (m->m_len < sizeof (struct ip) && |
if (m->m_len < sizeof (struct ip) && |
|
|
/* |
/* |
* Check our list of addresses, to see if the packet is for us. |
* Check our list of addresses, to see if the packet is for us. |
*/ |
*/ |
for (ia = in_ifaddr; ia; ia = ia->ia_next) { |
for (ia = in_ifaddr.tqh_first; ia; ia = ia->ia_list.tqe_next) { |
if (ip->ip_dst.s_addr == ia->ia_addr.sin_addr.s_addr) |
if (ip->ip_dst.s_addr == ia->ia_addr.sin_addr.s_addr) |
goto ours; |
goto ours; |
if ( |
if ( |