raw_ip6.c (144261) | raw_ip6.c (148242) |
---|---|
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 144261 2005-03-29 01:26:27Z sam $ | 29 * $FreeBSD: head/sys/netinet6/raw_ip6.c 148242 2005-07-21 15:06:32Z ume $ |
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 --- 303 unchanged lines hidden (view full) --- 341 INP_LOCK(in6p); 342 stickyopt = in6p->in6p_outputopts; 343 344 priv = 0; 345 if (so->so_cred->cr_uid == 0) 346 priv = 1; 347 dst = &dstsock->sin6_addr; 348 if (control) { | 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 --- 303 unchanged lines hidden (view full) --- 341 INP_LOCK(in6p); 342 stickyopt = in6p->in6p_outputopts; 343 344 priv = 0; 345 if (so->so_cred->cr_uid == 0) 346 priv = 1; 347 dst = &dstsock->sin6_addr; 348 if (control) { |
349 if ((error = ip6_setpktoptions(control, &opt, 350 stickyopt, priv, 0, 351 so->so_proto->pr_protocol)) | 349 if ((error = ip6_setpktopts(control, &opt, 350 stickyopt, priv, 0, so->so_proto->pr_protocol)) |
352 != 0) { 353 goto bad; 354 } 355 in6p->in6p_outputopts = &opt; 356 } 357 358 /* 359 * For an ICMPv6 packet, we should know its type and code --- 29 unchanged lines hidden (view full) --- 389 * 390 * XXX advanced-api value overrides sin6_scope_id 391 */ 392 if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst)) { 393 struct in6_pktinfo *pi; 394 395 /* 396 * XXX Boundary check is assumed to be already done in | 351 != 0) { 352 goto bad; 353 } 354 in6p->in6p_outputopts = &opt; 355 } 356 357 /* 358 * For an ICMPv6 packet, we should know its type and code --- 29 unchanged lines hidden (view full) --- 388 * 389 * XXX advanced-api value overrides sin6_scope_id 390 */ 391 if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst)) { 392 struct in6_pktinfo *pi; 393 394 /* 395 * XXX Boundary check is assumed to be already done in |
397 * ip6_setpktoptions(). | 396 * ip6_setpktopts(). |
398 */ 399 if (in6p->in6p_outputopts && 400 (pi = in6p->in6p_outputopts->ip6po_pktinfo) && 401 pi->ipi6_ifindex) { 402 ip6->ip6_dst.s6_addr16[1] = htons(pi->ipi6_ifindex); 403 oifp = ifnet_byindex(pi->ipi6_ifindex); 404 } else if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && 405 in6p->in6p_moptions && --- 390 unchanged lines hidden --- | 397 */ 398 if (in6p->in6p_outputopts && 399 (pi = in6p->in6p_outputopts->ip6po_pktinfo) && 400 pi->ipi6_ifindex) { 401 ip6->ip6_dst.s6_addr16[1] = htons(pi->ipi6_ifindex); 402 oifp = ifnet_byindex(pi->ipi6_ifindex); 403 } else if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && 404 in6p->in6p_moptions && --- 390 unchanged lines hidden --- |