ip_fastfwd.c (155201) | ip_fastfwd.c (157833) |
---|---|
1/*- 2 * Copyright (c) 2003 Andre Oppermann, Internet Business Solutions AG 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 2003 Andre Oppermann, Internet Business Solutions AG 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/netinet/ip_fastfwd.c 155201 2006-02-02 03:13:16Z csjp $ | 29 * $FreeBSD: head/sys/netinet/ip_fastfwd.c 157833 2006-04-18 09:20:16Z glebius $ |
30 */ 31 32/* 33 * ip_fastforward gets its speed from processing the forwarded packet to 34 * completion (if_output on the other side) without any queues or netisr's. 35 * The receiving interface DMAs the packet into memory, the upper half of 36 * driver calls ip_fastforward, we do our routing table lookup and directly 37 * send it off to the outgoing interface, which DMAs the packet to the --- 433 unchanged lines hidden (view full) --- 471 RTFREE(ro.ro_rt); 472 return m; 473 } 474 /* 475 * Redo route lookup with new destination address 476 */ 477#ifdef IPFIREWALL_FORWARD 478 if (fwd_tag) { | 30 */ 31 32/* 33 * ip_fastforward gets its speed from processing the forwarded packet to 34 * completion (if_output on the other side) without any queues or netisr's. 35 * The receiving interface DMAs the packet into memory, the upper half of 36 * driver calls ip_fastforward, we do our routing table lookup and directly 37 * send it off to the outgoing interface, which DMAs the packet to the --- 433 unchanged lines hidden (view full) --- 471 RTFREE(ro.ro_rt); 472 return m; 473 } 474 /* 475 * Redo route lookup with new destination address 476 */ 477#ifdef IPFIREWALL_FORWARD 478 if (fwd_tag) { |
479 if (!in_localip(ip->ip_src) && !in_localaddr(ip->ip_dst)) 480 dest.s_addr = ((struct sockaddr_in *)(fwd_tag+1))->sin_addr.s_addr; | 479#ifndef IPFIREWALL_FORWARD_EXTENDED 480 if (!in_localip(ip->ip_src) && 481 !in_localaddr(ip->ip_dst)) 482#endif 483 dest.s_addr = ((struct sockaddr_in *) 484 (fwd_tag + 1))->sin_addr.s_addr; |
481 m_tag_delete(m, fwd_tag); 482 } 483#endif /* IPFIREWALL_FORWARD */ 484 RTFREE(ro.ro_rt); 485 if ((dst = ip_findroute(&ro, dest, m)) == NULL) 486 return NULL; /* icmp unreach already sent */ 487 ifp = ro.ro_rt->rt_ifp; 488 } --- 119 unchanged lines hidden --- | 485 m_tag_delete(m, fwd_tag); 486 } 487#endif /* IPFIREWALL_FORWARD */ 488 RTFREE(ro.ro_rt); 489 if ((dst = ip_findroute(&ro, dest, m)) == NULL) 490 return NULL; /* icmp unreach already sent */ 491 ifp = ro.ro_rt->rt_ifp; 492 } --- 119 unchanged lines hidden --- |