version 1.61, 1998/04/29 03:45:52 |
version 1.65, 1998/05/04 19:24:53 |
|
|
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
*/ |
*/ |
|
|
|
#include "opt_gateway.h" |
#include "opt_mrouting.h" |
#include "opt_mrouting.h" |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
Line 158 int ipqmaxlen = IFQ_MAXLEN; |
|
Line 159 int ipqmaxlen = IFQ_MAXLEN; |
|
struct in_ifaddrhead in_ifaddr; |
struct in_ifaddrhead in_ifaddr; |
struct in_ifaddrhashhead *in_ifaddrhashtbl; |
struct in_ifaddrhashhead *in_ifaddrhashtbl; |
struct ifqueue ipintrq; |
struct ifqueue ipintrq; |
|
struct ipstat ipstat; |
|
u_int16_t ip_id; |
|
int ip_defttl; |
|
struct ipqhead ipq; |
|
|
/* |
/* |
* We need to save the IP options in case a protocol wants to respond |
* We need to save the IP options in case a protocol wants to respond |
|
|
m_adj(m, len - m->m_pkthdr.len); |
m_adj(m, len - m->m_pkthdr.len); |
} |
} |
|
|
|
/* |
|
* Assume that we can create a fast-forward IP flow entry |
|
* based on this packet. |
|
*/ |
|
m->m_flags |= M_CANFASTFWD; |
|
|
#ifdef PFIL_HOOKS |
#ifdef PFIL_HOOKS |
/* |
/* |
* Run through list of hooks for input packets. |
* Run through list of hooks for input packets. If there are any |
|
* filters which require that additional packets in the flow are |
|
* not fast-forwarded, they must clear the M_CANFASTFWD flag. |
|
* Note that filters must _never_ set this flag, as another filter |
|
* in the list may have previously cleared it. |
*/ |
*/ |
m0 = m; |
m0 = m; |
for (pfh = pfil_hook_get(PFIL_IN); pfh; pfh = pfh->pfil_link.tqe_next) |
for (pfh = pfil_hook_get(PFIL_IN); pfh; pfh = pfh->pfil_link.tqe_next) |
|
|
ip_freef(fp); |
ip_freef(fp); |
} |
} |
} |
} |
|
#ifdef GATEWAY |
|
ipflow_slowtimo(); |
|
#endif |
splx(s); |
splx(s); |
} |
} |
|
|
Line 1187 ip_forward(m, srcrt) |
|
Line 1205 ip_forward(m, srcrt) |
|
if (type) |
if (type) |
ipstat.ips_redirectsent++; |
ipstat.ips_redirectsent++; |
else { |
else { |
if (mcopy) |
if (mcopy) { |
|
#ifdef GATEWAY |
|
if (mcopy->m_flags & M_CANFASTFWD) |
|
ipflow_create(&ipforward_rt, mcopy); |
|
#endif |
m_freem(mcopy); |
m_freem(mcopy); |
|
} |
return; |
return; |
} |
} |
} |
} |
Line 1375 ip_sysctl(name, namelen, oldp, oldlenp, |
|
Line 1398 ip_sysctl(name, namelen, oldp, oldlenp, |
|
rt_timer_queue_change(ip_mtudisc_timeout_q, |
rt_timer_queue_change(ip_mtudisc_timeout_q, |
ip_mtudisc_timeout); |
ip_mtudisc_timeout); |
return (error); |
return (error); |
|
#ifdef GATEWAY |
|
case IPCTL_MAXFLOWS: |
|
error = sysctl_int(oldp, oldlenp, newp, newlen, |
|
&ip_maxflows); |
|
ipflow_reap(0); |
|
return (error); |
|
#endif |
default: |
default: |
return (EOPNOTSUPP); |
return (EOPNOTSUPP); |
} |
} |