ip_icmp.c (194760) | ip_icmp.c (194951) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 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 --- 16 unchanged lines hidden (view full) --- 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 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 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 --- 16 unchanged lines hidden (view full) --- 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 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet/ip_icmp.c 194760 2009-06-23 20:19:09Z rwatson $"); | 33__FBSDID("$FreeBSD: head/sys/netinet/ip_icmp.c 194951 2009-06-25 11:52:33Z rwatson $"); |
34 35#include "opt_ipsec.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/mbuf.h> 40#include <sys/protosw.h> 41#include <sys/socket.h> --- 628 unchanged lines hidden (view full) --- 670 ip->ip_dst = ip->ip_src; 671 672 /* 673 * Source selection for ICMP replies: 674 * 675 * If the incoming packet was addressed directly to one of our 676 * own addresses, use dst as the src for the reply. 677 */ | 34 35#include "opt_ipsec.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/mbuf.h> 40#include <sys/protosw.h> 41#include <sys/socket.h> --- 628 unchanged lines hidden (view full) --- 670 ip->ip_dst = ip->ip_src; 671 672 /* 673 * Source selection for ICMP replies: 674 * 675 * If the incoming packet was addressed directly to one of our 676 * own addresses, use dst as the src for the reply. 677 */ |
678 IN_IFADDR_RLOCK(); |
|
678 LIST_FOREACH(ia, INADDR_HASH(t.s_addr), ia_hash) { 679 if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr) { 680 t = IA_SIN(ia)->sin_addr; | 679 LIST_FOREACH(ia, INADDR_HASH(t.s_addr), ia_hash) { 680 if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr) { 681 t = IA_SIN(ia)->sin_addr; |
682 IN_IFADDR_RUNLOCK(); |
|
681 goto match; 682 } 683 } | 683 goto match; 684 } 685 } |
686 IN_IFADDR_RUNLOCK(); 687 |
|
684 /* 685 * If the incoming packet was addressed to one of our broadcast 686 * addresses, use the first non-broadcast address which corresponds 687 * to the incoming interface. 688 */ 689 ifp = m->m_pkthdr.rcvif; 690 if (ifp != NULL && ifp->if_flags & IFF_BROADCAST) { 691 IF_ADDR_LOCK(ifp); --- 285 unchanged lines hidden --- | 688 /* 689 * If the incoming packet was addressed to one of our broadcast 690 * addresses, use the first non-broadcast address which corresponds 691 * to the incoming interface. 692 */ 693 ifp = m->m_pkthdr.rcvif; 694 if (ifp != NULL && ifp->if_flags & IFF_BROADCAST) { 695 IF_ADDR_LOCK(ifp); --- 285 unchanged lines hidden --- |