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
--- 65 unchanged lines hidden (view full) ---
74 * Modified by Van Jacobson, LBL, January 1993
75 * Modified by Ajit Thyagarajan, PARC, August 1993
76 * Modified by Bill Fenner, PARC, April 1994
77 *
78 * MROUTING Revision: 3.5.1.2 + PIM-SMv2 (pimd) Support
79 */
80
81#include <sys/cdefs.h>
82__FBSDID("$FreeBSD: head/sys/netinet6/ip6_mroute.c 254889 2013-08-25 21:54:41Z markj $");
83
84#include "opt_inet6.h"
85#include "opt_kdtrace.h"
86
87#include <sys/param.h>
88#include <sys/callout.h>
89#include <sys/errno.h>
90#include <sys/kernel.h>
91#include <sys/lock.h>
92#include <sys/malloc.h>
93#include <sys/mbuf.h>
94#include <sys/module.h>
95#include <sys/domain.h>
96#include <sys/protosw.h>
97#include <sys/sdt.h>
98#include <sys/signalvar.h>
99#include <sys/socket.h>
100#include <sys/socketvar.h>
101#include <sys/sockio.h>
102#include <sys/sx.h>
103#include <sys/sysctl.h>
104#include <sys/syslog.h>
105#include <sys/systm.h>
--- 5 unchanged lines hidden (view full) ---
111#include <net/vnet.h>
112
113#include <netinet/in.h>
114#include <netinet/in_var.h>
115#include <netinet/icmp6.h>
116#include <netinet/ip_encap.h>
117
118#include <netinet/ip6.h>
119#include <netinet/in_kdtrace.h>
120#include <netinet6/ip6_var.h>
121#include <netinet6/scope6_var.h>
122#include <netinet6/nd6.h>
123#include <netinet6/ip6_mroute.h>
124#include <netinet6/ip6protosw.h>
125#include <netinet6/pim6.h>
126#include <netinet6/pim6_var.h>
127
--- 1514 unchanged lines hidden (view full) ---
1642 linkmtu = IN6_LINKMTU(ifp);
1643 if (mb_copy->m_pkthdr.len <= linkmtu || linkmtu < IPV6_MMTU) {
1644 struct sockaddr_in6 dst6;
1645
1646 bzero(&dst6, sizeof(dst6));
1647 dst6.sin6_len = sizeof(struct sockaddr_in6);
1648 dst6.sin6_family = AF_INET6;
1649 dst6.sin6_addr = ip6->ip6_dst;
1650
1651 IP_PROBE(send, NULL, NULL, ip6, ifp, NULL, ip6);
1652 /*
1653 * We just call if_output instead of nd6_output here, since
1654 * we need no ND for a multicast forwarded packet...right?
1655 */
1656 m_clrprotoflags(m); /* Avoid confusing lower layers. */
1657 error = (*ifp->if_output)(ifp, mb_copy,
1658 (struct sockaddr *)&dst6, NULL);
1659#ifdef MRT6DEBUG
--- 412 unchanged lines hidden ---
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
--- 65 unchanged lines hidden (view full) ---
74 * Modified by Van Jacobson, LBL, January 1993
75 * Modified by Ajit Thyagarajan, PARC, August 1993
76 * Modified by Bill Fenner, PARC, April 1994
77 *
78 * MROUTING Revision: 3.5.1.2 + PIM-SMv2 (pimd) Support
79 */
80
81#include <sys/cdefs.h>
82__FBSDID("$FreeBSD: head/sys/netinet6/ip6_mroute.c 254889 2013-08-25 21:54:41Z markj $");
83
84#include "opt_inet6.h"
85#include "opt_kdtrace.h"
86
87#include <sys/param.h>
88#include <sys/callout.h>
89#include <sys/errno.h>
90#include <sys/kernel.h>
91#include <sys/lock.h>
92#include <sys/malloc.h>
93#include <sys/mbuf.h>
94#include <sys/module.h>
95#include <sys/domain.h>
96#include <sys/protosw.h>
97#include <sys/sdt.h>
98#include <sys/signalvar.h>
99#include <sys/socket.h>
100#include <sys/socketvar.h>
101#include <sys/sockio.h>
102#include <sys/sx.h>
103#include <sys/sysctl.h>
104#include <sys/syslog.h>
105#include <sys/systm.h>
--- 5 unchanged lines hidden (view full) ---
111#include <net/vnet.h>
112
113#include <netinet/in.h>
114#include <netinet/in_var.h>
115#include <netinet/icmp6.h>
116#include <netinet/ip_encap.h>
117
118#include <netinet/ip6.h>
119#include <netinet/in_kdtrace.h>
120#include <netinet6/ip6_var.h>
121#include <netinet6/scope6_var.h>
122#include <netinet6/nd6.h>
123#include <netinet6/ip6_mroute.h>
124#include <netinet6/ip6protosw.h>
125#include <netinet6/pim6.h>
126#include <netinet6/pim6_var.h>
127
--- 1514 unchanged lines hidden (view full) ---
1642 linkmtu = IN6_LINKMTU(ifp);
1643 if (mb_copy->m_pkthdr.len <= linkmtu || linkmtu < IPV6_MMTU) {
1644 struct sockaddr_in6 dst6;
1645
1646 bzero(&dst6, sizeof(dst6));
1647 dst6.sin6_len = sizeof(struct sockaddr_in6);
1648 dst6.sin6_family = AF_INET6;
1649 dst6.sin6_addr = ip6->ip6_dst;
1650
1651 IP_PROBE(send, NULL, NULL, ip6, ifp, NULL, ip6);
1652 /*
1653 * We just call if_output instead of nd6_output here, since
1654 * we need no ND for a multicast forwarded packet...right?
1655 */
1656 m_clrprotoflags(m); /* Avoid confusing lower layers. */
1657 error = (*ifp->if_output)(ifp, mb_copy,
1658 (struct sockaddr *)&dst6, NULL);
1659#ifdef MRT6DEBUG
--- 412 unchanged lines hidden ---