mld6.c (175162) | mld6.c (181803) |
---|---|
1/*- 2 * Copyright (C) 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 --- 51 unchanged lines hidden (view full) --- 60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62 * SUCH DAMAGE. 63 * 64 * @(#)igmp.c 8.1 (Berkeley) 7/19/93 65 */ 66 67#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 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 --- 51 unchanged lines hidden (view full) --- 60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62 * SUCH DAMAGE. 63 * 64 * @(#)igmp.c 8.1 (Berkeley) 7/19/93 65 */ 66 67#include <sys/cdefs.h> |
68__FBSDID("$FreeBSD: head/sys/netinet6/mld6.c 175162 2008-01-08 19:08:58Z obrien $"); | 68__FBSDID("$FreeBSD: head/sys/netinet6/mld6.c 181803 2008-08-17 23:27:27Z bz $"); |
69 70#include "opt_inet.h" 71#include "opt_inet6.h" 72 73#include <sys/param.h> 74#include <sys/systm.h> 75#include <sys/mbuf.h> 76#include <sys/socket.h> 77#include <sys/protosw.h> 78#include <sys/syslog.h> 79#include <sys/kernel.h> 80#include <sys/callout.h> 81#include <sys/malloc.h> | 69 70#include "opt_inet.h" 71#include "opt_inet6.h" 72 73#include <sys/param.h> 74#include <sys/systm.h> 75#include <sys/mbuf.h> 76#include <sys/socket.h> 77#include <sys/protosw.h> 78#include <sys/syslog.h> 79#include <sys/kernel.h> 80#include <sys/callout.h> 81#include <sys/malloc.h> |
82#include <sys/vimage.h> |
|
82 83#include <net/if.h> 84 85#include <netinet/in.h> 86#include <netinet/in_var.h> 87#include <netinet6/in6_var.h> 88#include <netinet/ip6.h> 89#include <netinet6/ip6_var.h> --- 33 unchanged lines hidden (view full) --- 123 124 /* XXX: grotty hard coding... */ 125 hbh_buf[2] = IP6OPT_PADN; /* 2 byte padding */ 126 hbh_buf[3] = 0; 127 hbh_buf[4] = IP6OPT_ROUTER_ALERT; 128 hbh_buf[5] = IP6OPT_RTALERT_LEN - 2; 129 bcopy((caddr_t)&rtalert_code, &hbh_buf[6], sizeof(u_int16_t)); 130 | 83 84#include <net/if.h> 85 86#include <netinet/in.h> 87#include <netinet/in_var.h> 88#include <netinet6/in6_var.h> 89#include <netinet/ip6.h> 90#include <netinet6/ip6_var.h> --- 33 unchanged lines hidden (view full) --- 124 125 /* XXX: grotty hard coding... */ 126 hbh_buf[2] = IP6OPT_PADN; /* 2 byte padding */ 127 hbh_buf[3] = 0; 128 hbh_buf[4] = IP6OPT_ROUTER_ALERT; 129 hbh_buf[5] = IP6OPT_RTALERT_LEN - 2; 130 bcopy((caddr_t)&rtalert_code, &hbh_buf[6], sizeof(u_int16_t)); 131 |
131 ip6_initpktopts(&ip6_opts); 132 ip6_opts.ip6po_hbh = hbh; | 132 ip6_initpktopts(&V_ip6_opts); 133 V_ip6_opts.ip6po_hbh = hbh; |
133} 134 135static void 136mld_starttimer(struct in6_multi *in6m) 137{ 138 struct timeval now; 139 140 microtime(&now); --- 136 unchanged lines hidden (view full) --- 277 int timer; /* timer value in the MLD query header */ 278 279#ifndef PULLDOWN_TEST 280 IP6_EXTHDR_CHECK(m, off, sizeof(*mldh),); 281 mldh = (struct mld_hdr *)(mtod(m, caddr_t) + off); 282#else 283 IP6_EXTHDR_GET(mldh, struct mld_hdr *, m, off, sizeof(*mldh)); 284 if (mldh == NULL) { | 134} 135 136static void 137mld_starttimer(struct in6_multi *in6m) 138{ 139 struct timeval now; 140 141 microtime(&now); --- 136 unchanged lines hidden (view full) --- 278 int timer; /* timer value in the MLD query header */ 279 280#ifndef PULLDOWN_TEST 281 IP6_EXTHDR_CHECK(m, off, sizeof(*mldh),); 282 mldh = (struct mld_hdr *)(mtod(m, caddr_t) + off); 283#else 284 IP6_EXTHDR_GET(mldh, struct mld_hdr *, m, off, sizeof(*mldh)); 285 if (mldh == NULL) { |
285 icmp6stat.icp6s_tooshort++; | 286 V_icmp6stat.icp6s_tooshort++; |
286 return; 287 } 288#endif 289 290 /* source address validation */ 291 ip6 = mtod(m, struct ip6_hdr *); /* in case mpullup */ 292 if (!IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src)) { 293 char ip6bufs[INET6_ADDRSTRLEN], ip6bufg[INET6_ADDRSTRLEN]; --- 211 unchanged lines hidden (view full) --- 505 506 /* 507 * Request loopback of the report if we are acting as a multicast 508 * router, so that the process-level routing daemon can hear it. 509 */ 510 im6o.im6o_multicast_loop = (ip6_mrouter != NULL); 511 512 /* increment output statictics */ | 287 return; 288 } 289#endif 290 291 /* source address validation */ 292 ip6 = mtod(m, struct ip6_hdr *); /* in case mpullup */ 293 if (!IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src)) { 294 char ip6bufs[INET6_ADDRSTRLEN], ip6bufg[INET6_ADDRSTRLEN]; --- 211 unchanged lines hidden (view full) --- 506 507 /* 508 * Request loopback of the report if we are acting as a multicast 509 * router, so that the process-level routing daemon can hear it. 510 */ 511 im6o.im6o_multicast_loop = (ip6_mrouter != NULL); 512 513 /* increment output statictics */ |
513 icmp6stat.icp6s_outhist[type]++; | 514 V_icmp6stat.icp6s_outhist[type]++; |
514 | 515 |
515 ip6_output(mh, &ip6_opts, NULL, 0, &im6o, &outif, NULL); | 516 ip6_output(mh, &V_ip6_opts, NULL, 0, &im6o, &outif, NULL); |
516 if (outif) { 517 icmp6_ifstat_inc(outif, ifs6_out_msg); 518 switch (type) { 519 case MLD_LISTENER_QUERY: 520 icmp6_ifstat_inc(outif, ifs6_out_mldquery); 521 break; 522 case MLD_LISTENER_REPORT: 523 icmp6_ifstat_inc(outif, ifs6_out_mldreport); --- 127 unchanged lines hidden --- | 517 if (outif) { 518 icmp6_ifstat_inc(outif, ifs6_out_msg); 519 switch (type) { 520 case MLD_LISTENER_QUERY: 521 icmp6_ifstat_inc(outif, ifs6_out_mldquery); 522 break; 523 case MLD_LISTENER_REPORT: 524 icmp6_ifstat_inc(outif, ifs6_out_mldreport); --- 127 unchanged lines hidden --- |