ip_output.c (71999) | ip_output.c (72012) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 |
34 * $FreeBSD: head/sys/netinet/ip_output.c 71999 2001-02-04 13:13:25Z phk $ | 34 * $FreeBSD: head/sys/netinet/ip_output.c 72012 2001-02-04 16:08:18Z phk $ |
35 */ 36 37#define _IP_VHL 38 39#include "opt_ipfw.h" 40#include "opt_ipdn.h" 41#include "opt_ipdivert.h" 42#include "opt_ipfilter.h" --- 266 unchanged lines hidden (view full) --- 309 } 310 /* 311 * If source address not specified yet, use address 312 * of outgoing interface. 313 */ 314 if (ip->ip_src.s_addr == INADDR_ANY) { 315 register struct in_ifaddr *ia1; 316 | 35 */ 36 37#define _IP_VHL 38 39#include "opt_ipfw.h" 40#include "opt_ipdn.h" 41#include "opt_ipdivert.h" 42#include "opt_ipfilter.h" --- 266 unchanged lines hidden (view full) --- 309 } 310 /* 311 * If source address not specified yet, use address 312 * of outgoing interface. 313 */ 314 if (ip->ip_src.s_addr == INADDR_ANY) { 315 register struct in_ifaddr *ia1; 316 |
317 for (ia1 = TAILQ_FIRST(&in_ifaddrhead); ia1; 318 ia1 = TAILQ_NEXT(ia1, ia_link)) | 317 TAILQ_FOREACH(ia1, &in_ifaddrhead, ia_link) |
319 if (ia1->ia_ifp == ifp) { 320 ip->ip_src = IA_SIN(ia1)->sin_addr; 321 break; 322 } 323 } 324 325 IN_LOOKUP_MULTI(ip->ip_dst, ifp, inm); 326 if (inm != NULL && --- 249 unchanged lines hidden (view full) --- 576 * because it may be dificult to identify the packets 577 * you want to forward until they are being output 578 * and have selected an interface. (e.g. locally 579 * initiated packets) If we used the loopback inteface, 580 * we would not be able to control what happens 581 * as the packet runs through ip_input() as 582 * it is done through a ISR. 583 */ | 318 if (ia1->ia_ifp == ifp) { 319 ip->ip_src = IA_SIN(ia1)->sin_addr; 320 break; 321 } 322 } 323 324 IN_LOOKUP_MULTI(ip->ip_dst, ifp, inm); 325 if (inm != NULL && --- 249 unchanged lines hidden (view full) --- 575 * because it may be dificult to identify the packets 576 * you want to forward until they are being output 577 * and have selected an interface. (e.g. locally 578 * initiated packets) If we used the loopback inteface, 579 * we would not be able to control what happens 580 * as the packet runs through ip_input() as 581 * it is done through a ISR. 582 */ |
584 for (ia = TAILQ_FIRST(&in_ifaddrhead); ia; 585 ia = TAILQ_NEXT(ia, ia_link)) { | 583 TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) { |
586 /* 587 * If the addr to forward to is one 588 * of ours, we pretend to 589 * be the destination for this packet. 590 */ 591 if (IA_SIN(ia)->sin_addr.s_addr == 592 dst->sin_addr.s_addr) 593 break; --- 1326 unchanged lines hidden --- | 584 /* 585 * If the addr to forward to is one 586 * of ours, we pretend to 587 * be the destination for this packet. 588 */ 589 if (IA_SIN(ia)->sin_addr.s_addr == 590 dst->sin_addr.s_addr) 591 break; --- 1326 unchanged lines hidden --- |