raw_ip6.c (80406) | raw_ip6.c (83130) |
---|---|
1/* 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 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) 1995, 1996, 1997, and 1998 WIDE Project. 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/netinet6/raw_ip6.c 80406 2001-07-26 19:19:49Z ume $ | 29 * $FreeBSD: head/sys/netinet6/raw_ip6.c 83130 2001-09-06 02:40:43Z jlemon $ |
30 */ 31 32/* 33 * Copyright (c) 1982, 1986, 1988, 1993 34 * The Regents of the University of California. All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions --- 332 unchanged lines hidden (view full) --- 370 struct in6_pktinfo *pi; 371 372 /* 373 * XXX Boundary check is assumed to be already done in 374 * ip6_setpktoptions(). 375 */ 376 if (optp && (pi = optp->ip6po_pktinfo) && pi->ipi6_ifindex) { 377 ip6->ip6_dst.s6_addr16[1] = htons(pi->ipi6_ifindex); | 30 */ 31 32/* 33 * Copyright (c) 1982, 1986, 1988, 1993 34 * The Regents of the University of California. All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions --- 332 unchanged lines hidden (view full) --- 370 struct in6_pktinfo *pi; 371 372 /* 373 * XXX Boundary check is assumed to be already done in 374 * ip6_setpktoptions(). 375 */ 376 if (optp && (pi = optp->ip6po_pktinfo) && pi->ipi6_ifindex) { 377 ip6->ip6_dst.s6_addr16[1] = htons(pi->ipi6_ifindex); |
378 oifp = ifindex2ifnet[pi->ipi6_ifindex]; | 378 oifp = ifnet_byindex(pi->ipi6_ifindex); |
379 } else if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && 380 in6p->in6p_moptions && 381 in6p->in6p_moptions->im6o_multicast_ifp) { 382 oifp = in6p->in6p_moptions->im6o_multicast_ifp; 383 ip6->ip6_dst.s6_addr16[1] = htons(oifp->if_index); 384 } else if (dstsock->sin6_scope_id) { 385 /* boundary check */ 386 if (dstsock->sin6_scope_id < 0 --- 18 unchanged lines hidden (view full) --- 405 &in6p->in6p_laddr, 406 &error)) == 0) { 407 if (error == 0) 408 error = EADDRNOTAVAIL; 409 goto bad; 410 } 411 ip6->ip6_src = *in6a; 412 if (in6p->in6p_route.ro_rt) | 379 } else if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && 380 in6p->in6p_moptions && 381 in6p->in6p_moptions->im6o_multicast_ifp) { 382 oifp = in6p->in6p_moptions->im6o_multicast_ifp; 383 ip6->ip6_dst.s6_addr16[1] = htons(oifp->if_index); 384 } else if (dstsock->sin6_scope_id) { 385 /* boundary check */ 386 if (dstsock->sin6_scope_id < 0 --- 18 unchanged lines hidden (view full) --- 405 &in6p->in6p_laddr, 406 &error)) == 0) { 407 if (error == 0) 408 error = EADDRNOTAVAIL; 409 goto bad; 410 } 411 ip6->ip6_src = *in6a; 412 if (in6p->in6p_route.ro_rt) |
413 oifp = ifindex2ifnet[in6p->in6p_route.ro_rt->rt_ifp->if_index]; | 413 oifp = ifnet_byindex(in6p->in6p_route.ro_rt->rt_ifp->if_index); |
414 } 415 ip6->ip6_flow = (ip6->ip6_flow & ~IPV6_FLOWINFO_MASK) | 416 (in6p->in6p_flowinfo & IPV6_FLOWINFO_MASK); 417 ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | 418 (IPV6_VERSION & IPV6_VERSION_MASK); 419 /* ip6_plen will be filled in ip6_output, so not fill it here. */ 420 ip6->ip6_nxt = in6p->in6p_ip6_nxt; 421 ip6->ip6_hlim = in6_selecthlim(in6p, oifp); --- 309 unchanged lines hidden --- | 414 } 415 ip6->ip6_flow = (ip6->ip6_flow & ~IPV6_FLOWINFO_MASK) | 416 (in6p->in6p_flowinfo & IPV6_FLOWINFO_MASK); 417 ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | 418 (IPV6_VERSION & IPV6_VERSION_MASK); 419 /* ip6_plen will be filled in ip6_output, so not fill it here. */ 420 ip6->ip6_nxt = in6p->in6p_ip6_nxt; 421 ip6->ip6_hlim = in6_selecthlim(in6p, oifp); --- 309 unchanged lines hidden --- |