Skip to content

Commit

Permalink
Introduce ip_fastforward and remove ip_flow.
Browse files Browse the repository at this point in the history
Short description of ip_fastforward:

 o adds full direct process-to-completion IPv4 forwarding code
 o handles ip fragmentation incl. hw support (ip_flow did not)
 o sends icmp needfrag to source if DF is set (ip_flow did not)
 o supports ipfw and ipfilter (ip_flow did not)
 o supports divert, ipfw fwd and ipfilter nat (ip_flow did not)
 o returns anything it can't handle back to normal ip_input

Enable with sysctl -w net.inet.ip.fastforwarding=1

Reviewed by:	sam (mentor)
  • Loading branch information
andreoppermann committed Nov 14, 2003
1 parent 53640e6 commit de48630
Show file tree
Hide file tree
Showing 14 changed files with 846 additions and 460 deletions.
2 changes: 1 addition & 1 deletion sys/conf/files
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ netinet/ip_ecn.c optional inet
netinet/ip_ecn.c optional inet6
netinet/ip_encap.c optional inet
netinet/ip_encap.c optional inet6
netinet/ip_flow.c optional inet
netinet/ip_fastfwd.c optional inet
netinet/ip_fw2.c optional ipfirewall
netinet/ip_icmp.c optional inet
netinet/ip_input.c optional inet
Expand Down
4 changes: 2 additions & 2 deletions sys/net/if_arcsubr.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,14 @@ arc_input(ifp, m)
#ifdef INET
case ARCTYPE_IP:
m_adj(m, ARC_HDRNEWLEN);
if (ipflow_fastforward(m))
if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;

case ARCTYPE_IP_OLD:
m_adj(m, ARC_HDRLEN);
if (ipflow_fastforward(m))
if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/if_ef.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ ef_inputEII(struct mbuf *m, struct ether_header *eh, u_short ether_type)
#endif
#ifdef INET
case ETHERTYPE_IP:
if (ipflow_fastforward(m))
if (ip_fastforward(m))
return (0);
isr = NETISR_IP;
break;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/if_ethersubr.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m)
switch (ether_type) {
#ifdef INET
case ETHERTYPE_IP:
if (ipflow_fastforward(m))
if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/if_fddisubr.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ fddi_input(ifp, m)
switch (type) {
#ifdef INET
case ETHERTYPE_IP:
if (ipflow_fastforward(m))
if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/if_iso88025subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ iso88025_input(ifp, m)
#ifdef INET
case ETHERTYPE_IP:
th->iso88025_shost[0] &= ~(TR_RII);
if (ipflow_fastforward(m))
if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/if_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ ppp_inproc(sc, m)
m->m_pkthdr.len -= PPP_HDRLEN;
m->m_data += PPP_HDRLEN;
m->m_len -= PPP_HDRLEN;
if (ipflow_fastforward(m))
if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
Expand Down
4 changes: 1 addition & 3 deletions sys/netinet/in_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,7 @@ void in_rtqdrain(void);
void ip_input(struct mbuf *);
int in_ifadown(struct ifaddr *ifa, int);
void in_ifscrub(struct ifnet *, struct in_ifaddr *);
int ipflow_fastforward(struct mbuf *);
void ipflow_create(const struct route *, struct mbuf *);
void ipflow_slowtimo(void);
int ip_fastforward(struct mbuf *);

#endif /* _KERNEL */

Expand Down

0 comments on commit de48630

Please sign in to comment.