raw_ip6.c (257176) | raw_ip6.c (269699) |
---|---|
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 --- 46 unchanged lines hidden (view full) --- 55 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * SUCH DAMAGE. 58 * 59 * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 60 */ 61 62#include <sys/cdefs.h> | 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 --- 46 unchanged lines hidden (view full) --- 55 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * SUCH DAMAGE. 58 * 59 * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 60 */ 61 62#include <sys/cdefs.h> |
63__FBSDID("$FreeBSD: head/sys/netinet6/raw_ip6.c 257176 2013-10-26 17:58:36Z glebius $"); | 63__FBSDID("$FreeBSD: head/sys/netinet6/raw_ip6.c 269699 2014-08-08 01:57:15Z kevlo $"); |
64 65#include "opt_ipsec.h" 66#include "opt_inet6.h" 67 68#include <sys/param.h> 69#include <sys/errno.h> 70#include <sys/jail.h> 71#include <sys/kernel.h> --- 313 unchanged lines hidden (view full) --- 385 (const struct sockaddr *)sa6_src, 0, cmd, cmdarg, notify); 386} 387 388/* 389 * Generate IPv6 header and pass packet to ip6_output. Tack on options user 390 * may have setup with control call. 391 */ 392int | 64 65#include "opt_ipsec.h" 66#include "opt_inet6.h" 67 68#include <sys/param.h> 69#include <sys/errno.h> 70#include <sys/jail.h> 71#include <sys/kernel.h> --- 313 unchanged lines hidden (view full) --- 385 (const struct sockaddr *)sa6_src, 0, cmd, cmdarg, notify); 386} 387 388/* 389 * Generate IPv6 header and pass packet to ip6_output. Tack on options user 390 * may have setup with control call. 391 */ 392int |
393#if __STDC__ 394rip6_output(struct mbuf *m, ...) 395#else 396rip6_output(m, va_alist) 397 struct mbuf *m; 398 va_dcl 399#endif | 393rip6_output(struct mbuf *m, struct socket *so, ...) |
400{ 401 struct mbuf *control; 402 struct m_tag *mtag; | 394{ 395 struct mbuf *control; 396 struct m_tag *mtag; |
403 struct socket *so; | |
404 struct sockaddr_in6 *dstsock; 405 struct in6_addr *dst; 406 struct ip6_hdr *ip6; 407 struct inpcb *in6p; 408 u_int plen = m->m_pkthdr.len; 409 int error = 0; 410 struct ip6_pktopts opt, *optp; 411 struct ifnet *oifp = NULL; 412 int type = 0, code = 0; /* for ICMPv6 output statistics only */ 413 int scope_ambiguous = 0; 414 int use_defzone = 0; 415 struct in6_addr in6a; 416 va_list ap; 417 | 397 struct sockaddr_in6 *dstsock; 398 struct in6_addr *dst; 399 struct ip6_hdr *ip6; 400 struct inpcb *in6p; 401 u_int plen = m->m_pkthdr.len; 402 int error = 0; 403 struct ip6_pktopts opt, *optp; 404 struct ifnet *oifp = NULL; 405 int type = 0, code = 0; /* for ICMPv6 output statistics only */ 406 int scope_ambiguous = 0; 407 int use_defzone = 0; 408 struct in6_addr in6a; 409 va_list ap; 410 |
418 va_start(ap, m); 419 so = va_arg(ap, struct socket *); | 411 va_start(ap, so); |
420 dstsock = va_arg(ap, struct sockaddr_in6 *); 421 control = va_arg(ap, struct mbuf *); 422 va_end(ap); 423 424 in6p = sotoinpcb(so); 425 INP_WLOCK(in6p); 426 427 dst = &dstsock->sin6_addr; --- 513 unchanged lines hidden --- | 412 dstsock = va_arg(ap, struct sockaddr_in6 *); 413 control = va_arg(ap, struct mbuf *); 414 va_end(ap); 415 416 in6p = sotoinpcb(so); 417 INP_WLOCK(in6p); 418 419 dst = &dstsock->sin6_addr; --- 513 unchanged lines hidden --- |