sourcefilter.c (191654) | sourcefilter.c (235640) |
---|---|
1/*- 2 * Copyright (c) 2007-2009 Bruce Simpson. 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2007-2009 Bruce Simpson. 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/lib/libc/net/sourcefilter.c 191654 2009-04-29 09:58:31Z bms $"); | 28__FBSDID("$FreeBSD: head/lib/libc/net/sourcefilter.c 235640 2012-05-19 02:39:43Z marcel $"); |
29 30#include "namespace.h" 31 32#include <sys/types.h> 33#include <sys/param.h> 34#include <sys/ioctl.h> 35#include <sys/socket.h> 36 --- 78 unchanged lines hidden (view full) --- 115 * Pass #2: Find the index of the interface matching the name 116 * we obtained from looking up the IPv4 ifaddr in pass #1. 117 * There must be a better way of doing this. 118 */ 119 for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { 120 psu = (sockunion_t *)ifa->ifa_addr; 121 if (psu && psu->ss.ss_family == AF_LINK && 122 strcmp(ifa->ifa_name, ifname) == 0) { | 29 30#include "namespace.h" 31 32#include <sys/types.h> 33#include <sys/param.h> 34#include <sys/ioctl.h> 35#include <sys/socket.h> 36 --- 78 unchanged lines hidden (view full) --- 115 * Pass #2: Find the index of the interface matching the name 116 * we obtained from looking up the IPv4 ifaddr in pass #1. 117 * There must be a better way of doing this. 118 */ 119 for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { 120 psu = (sockunion_t *)ifa->ifa_addr; 121 if (psu && psu->ss.ss_family == AF_LINK && 122 strcmp(ifa->ifa_name, ifname) == 0) { |
123 ifindex = psu->sdl.sdl_index; | 123 ifindex = LLINDEX(&psu->sdl); |
124 break; 125 } 126 } 127 assert(ifindex != 0); 128 129out: 130 freeifaddrs(ifaddrs); 131 return (ifindex); --- 271 unchanged lines hidden --- | 124 break; 125 } 126 } 127 assert(ifindex != 0); 128 129out: 130 freeifaddrs(ifaddrs); 131 return (ifindex); --- 271 unchanged lines hidden --- |