Deleted Added
full compact
raw_ip6.c (160549) raw_ip6.c (166938)
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 160549 2006-07-21 17:11:15Z rwatson $
29 * $FreeBSD: head/sys/netinet6/raw_ip6.c 166938 2007-02-24 11:38:47Z bms $
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

--- 79 unchanged lines hidden (view full) ---

117extern struct inpcbhead ripcb;
118extern struct inpcbinfo ripcbinfo;
119extern u_long rip_sendspace;
120extern u_long rip_recvspace;
121
122struct rip6stat rip6stat;
123
124/*
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

--- 79 unchanged lines hidden (view full) ---

117extern struct inpcbhead ripcb;
118extern struct inpcbinfo ripcbinfo;
119extern u_long rip_sendspace;
120extern u_long rip_recvspace;
121
122struct rip6stat rip6stat;
123
124/*
125 * Hooks for multicast forwarding.
126 */
127
128struct socket *ip6_mrouter;
129
130int (*ip6_mrouter_set)(struct socket *, struct sockopt *);
131int (*ip6_mrouter_get)(struct socket *, struct sockopt *);
132int (*ip6_mrouter_done)(void);
133int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *);
134int (*mrt6_ioctl)(int, caddr_t);
135
136/*
125 * Setup generic address and protocol structures
126 * for raw_input routine, then pass them along with
127 * mbuf chain.
128 */
129int
130rip6_input(mp, offp, proto)
131 struct mbuf **mp;
132 int *offp, proto;

--- 369 unchanged lines hidden (view full) ---

502 switch (sopt->sopt_name) {
503 case MRT6_INIT:
504 case MRT6_DONE:
505 case MRT6_ADD_MIF:
506 case MRT6_DEL_MIF:
507 case MRT6_ADD_MFC:
508 case MRT6_DEL_MFC:
509 case MRT6_PIM:
137 * Setup generic address and protocol structures
138 * for raw_input routine, then pass them along with
139 * mbuf chain.
140 */
141int
142rip6_input(mp, offp, proto)
143 struct mbuf **mp;
144 int *offp, proto;

--- 369 unchanged lines hidden (view full) ---

514 switch (sopt->sopt_name) {
515 case MRT6_INIT:
516 case MRT6_DONE:
517 case MRT6_ADD_MIF:
518 case MRT6_DEL_MIF:
519 case MRT6_ADD_MFC:
520 case MRT6_DEL_MFC:
521 case MRT6_PIM:
510 error = ip6_mrouter_get(so, sopt);
522 error = ip6_mrouter_get ? ip6_mrouter_get(so, sopt) :
523 EOPNOTSUPP;
511 break;
512 case IPV6_CHECKSUM:
513 error = ip6_raw_ctloutput(so, sopt);
514 break;
515 default:
516 error = ip6_ctloutput(so, sopt);
517 break;
518 }
519 break;
520
521 case SOPT_SET:
522 switch (sopt->sopt_name) {
523 case MRT6_INIT:
524 case MRT6_DONE:
525 case MRT6_ADD_MIF:
526 case MRT6_DEL_MIF:
527 case MRT6_ADD_MFC:
528 case MRT6_DEL_MFC:
529 case MRT6_PIM:
524 break;
525 case IPV6_CHECKSUM:
526 error = ip6_raw_ctloutput(so, sopt);
527 break;
528 default:
529 error = ip6_ctloutput(so, sopt);
530 break;
531 }
532 break;
533
534 case SOPT_SET:
535 switch (sopt->sopt_name) {
536 case MRT6_INIT:
537 case MRT6_DONE:
538 case MRT6_ADD_MIF:
539 case MRT6_DEL_MIF:
540 case MRT6_ADD_MFC:
541 case MRT6_DEL_MFC:
542 case MRT6_PIM:
530 error = ip6_mrouter_set(so, sopt);
543 error = ip6_mrouter_set ? ip6_mrouter_set(so, sopt) :
544 EOPNOTSUPP;
531 break;
532 case IPV6_CHECKSUM:
533 error = ip6_raw_ctloutput(so, sopt);
534 break;
535 default:
536 error = ip6_ctloutput(so, sopt);
537 break;
538 }

--- 43 unchanged lines hidden (view full) ---

582static void
583rip6_detach(struct socket *so)
584{
585 struct inpcb *inp;
586
587 inp = sotoinpcb(so);
588 KASSERT(inp != NULL, ("rip6_detach: inp == NULL"));
589
545 break;
546 case IPV6_CHECKSUM:
547 error = ip6_raw_ctloutput(so, sopt);
548 break;
549 default:
550 error = ip6_ctloutput(so, sopt);
551 break;
552 }

--- 43 unchanged lines hidden (view full) ---

596static void
597rip6_detach(struct socket *so)
598{
599 struct inpcb *inp;
600
601 inp = sotoinpcb(so);
602 KASSERT(inp != NULL, ("rip6_detach: inp == NULL"));
603
590 /* xxx: RSVP */
591 if (so == ip6_mrouter)
604 if (so == ip6_mrouter && ip6_mrouter_done)
592 ip6_mrouter_done();
605 ip6_mrouter_done();
606 /* xxx: RSVP */
593 INP_INFO_WLOCK(&ripcbinfo);
594 INP_LOCK(inp);
595 if (inp->in6p_icmp6filt) {
596 FREE(inp->in6p_icmp6filt, M_PCB);
597 inp->in6p_icmp6filt = NULL;
598 }
599 in6_pcbdetach(inp);
600 in6_pcbfree(inp);

--- 215 unchanged lines hidden ---
607 INP_INFO_WLOCK(&ripcbinfo);
608 INP_LOCK(inp);
609 if (inp->in6p_icmp6filt) {
610 FREE(inp->in6p_icmp6filt, M_PCB);
611 inp->in6p_icmp6filt = NULL;
612 }
613 in6_pcbdetach(inp);
614 in6_pcbfree(inp);

--- 215 unchanged lines hidden ---