Deleted Added
full compact
ip_mroute.c (50477) ip_mroute.c (55009)
1/*
2 * IP multicast forwarding procedures
3 *
4 * Written by David Waitzman, BBN Labs, August 1988.
5 * Modified by Steve Deering, Stanford, February 1989.
6 * Modified by Mark J. Steiglitz, Stanford, May, 1991
7 * Modified by Van Jacobson, LBL, January 1993
8 * Modified by Ajit Thyagarajan, PARC, August 1993
9 * Modified by Bill Fenner, PARC, April 1995
10 *
11 * MROUTING Revision: 3.5
1/*
2 * IP multicast forwarding procedures
3 *
4 * Written by David Waitzman, BBN Labs, August 1988.
5 * Modified by Steve Deering, Stanford, February 1989.
6 * Modified by Mark J. Steiglitz, Stanford, May, 1991
7 * Modified by Van Jacobson, LBL, January 1993
8 * Modified by Ajit Thyagarajan, PARC, August 1993
9 * Modified by Bill Fenner, PARC, April 1995
10 *
11 * MROUTING Revision: 3.5
12 * $FreeBSD: head/sys/netinet/ip_mroute.c 50477 1999-08-28 01:08:13Z peter $
12 * $FreeBSD: head/sys/netinet/ip_mroute.c 55009 1999-12-22 19:13:38Z shin $
13 */
14
15#include "opt_mrouting.h"
16
17#include <sys/param.h>
18#include <sys/systm.h>
19#include <sys/malloc.h>
20#include <sys/mbuf.h>

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

112_mrt_ioctl(int req, caddr_t data, struct proc *p)
113{
114 return EOPNOTSUPP;
115}
116
117int (*mrt_ioctl)(int, caddr_t, struct proc *) = _mrt_ioctl;
118
119void
13 */
14
15#include "opt_mrouting.h"
16
17#include <sys/param.h>
18#include <sys/systm.h>
19#include <sys/malloc.h>
20#include <sys/mbuf.h>

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

112_mrt_ioctl(int req, caddr_t data, struct proc *p)
113{
114 return EOPNOTSUPP;
115}
116
117int (*mrt_ioctl)(int, caddr_t, struct proc *) = _mrt_ioctl;
118
119void
120rsvp_input(m, iphlen) /* XXX must fixup manually */
120rsvp_input(m, off, proto) /* XXX must fixup manually */
121 struct mbuf *m;
121 struct mbuf *m;
122 int iphlen;
122 int off;
123 int proto;
123{
124 /* Can still get packets with rsvp_on = 0 if there is a local member
125 * of the group to which the RSVP packet is addressed. But in this
126 * case we want to throw the packet away.
127 */
128 if (!rsvp_on) {
129 m_freem(m);
130 return;
131 }
132
133 if (ip_rsvpd != NULL) {
134 if (rsvpdebug)
135 printf("rsvp_input: Sending packet up old-style socket\n");
124{
125 /* Can still get packets with rsvp_on = 0 if there is a local member
126 * of the group to which the RSVP packet is addressed. But in this
127 * case we want to throw the packet away.
128 */
129 if (!rsvp_on) {
130 m_freem(m);
131 return;
132 }
133
134 if (ip_rsvpd != NULL) {
135 if (rsvpdebug)
136 printf("rsvp_input: Sending packet up old-style socket\n");
136 rip_input(m, iphlen);
137 rip_input(m, off, proto);
137 return;
138 }
139 /* Drop the packet */
140 m_freem(m);
141}
142
138 return;
139 }
140 /* Drop the packet */
141 m_freem(m);
142}
143
143void ipip_input(struct mbuf *m, int iphlen) { /* XXX must fixup manually */
144 rip_input(m, iphlen);
144void ipip_input(struct mbuf *m, int off, int proto) { /* XXX must fixup manually */
145 rip_input(m, off, proto);
145}
146
147int (*legal_vif_num)(int) = 0;
148
149/*
150 * This should never be called, since IP_MULTICAST_VIF should fail, but
151 * just in case it does get called, the code a little lower in ip_output
152 * will assign the packet a local address.

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

1604
1605/*
1606 * De-encapsulate a packet and feed it back through ip input (this
1607 * routine is called whenever IP gets a packet with proto type
1608 * ENCAP_PROTO and a local destination address).
1609 */
1610void
1611#ifdef MROUTE_LKM
146}
147
148int (*legal_vif_num)(int) = 0;
149
150/*
151 * This should never be called, since IP_MULTICAST_VIF should fail, but
152 * just in case it does get called, the code a little lower in ip_output
153 * will assign the packet a local address.

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

1605
1606/*
1607 * De-encapsulate a packet and feed it back through ip input (this
1608 * routine is called whenever IP gets a packet with proto type
1609 * ENCAP_PROTO and a local destination address).
1610 */
1611void
1612#ifdef MROUTE_LKM
1612X_ipip_input(m, iphlen)
1613X_ipip_input(m, off, proto)
1613#else
1614#else
1614ipip_input(m, iphlen)
1615ipip_input(m, off, proto)
1615#endif
1616 register struct mbuf *m;
1616#endif
1617 register struct mbuf *m;
1617 int iphlen;
1618 int off;
1619 int proto;
1618{
1619 struct ifnet *ifp = m->m_pkthdr.rcvif;
1620 register struct ip *ip = mtod(m, struct ip *);
1621 register int hlen = ip->ip_hl << 2;
1622 register int s;
1623 register struct ifqueue *ifq;
1624 register struct vif *vifp;
1625
1626 if (!have_encap_tunnel) {
1620{
1621 struct ifnet *ifp = m->m_pkthdr.rcvif;
1622 register struct ip *ip = mtod(m, struct ip *);
1623 register int hlen = ip->ip_hl << 2;
1624 register int s;
1625 register struct ifqueue *ifq;
1626 register struct vif *vifp;
1627
1628 if (!have_encap_tunnel) {
1627 rip_input(m, iphlen);
1629 rip_input(m, off, proto);
1628 return;
1629 }
1630 /*
1631 * dump the packet if it's not to a multicast destination or if
1632 * we don't have an encapsulating tunnel with the source.
1633 * Note: This code assumes that the remote site IP address
1634 * uniquely identifies the tunnel (i.e., that this site has
1635 * at most one tunnel with the remote site).

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

2114 }
2115 }
2116
2117 splx(s);
2118 return;
2119}
2120
2121void
1630 return;
1631 }
1632 /*
1633 * dump the packet if it's not to a multicast destination or if
1634 * we don't have an encapsulating tunnel with the source.
1635 * Note: This code assumes that the remote site IP address
1636 * uniquely identifies the tunnel (i.e., that this site has
1637 * at most one tunnel with the remote site).

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

2116 }
2117 }
2118
2119 splx(s);
2120 return;
2121}
2122
2123void
2122rsvp_input(m, iphlen)
2124rsvp_input(m, off, proto)
2123 struct mbuf *m;
2125 struct mbuf *m;
2124 int iphlen;
2126 int off;
2127 int proto;
2125{
2126 int vifi;
2127 register struct ip *ip = mtod(m, struct ip *);
2128 static struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET };
2129 register int s;
2130 struct ifnet *ifp;
2131
2132 if (rsvpdebug)

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

2142 }
2143
2144 /* If the old-style non-vif-associated socket is set, then use
2145 * it and ignore the new ones.
2146 */
2147 if (ip_rsvpd != NULL) {
2148 if (rsvpdebug)
2149 printf("rsvp_input: Sending packet up old-style socket\n");
2128{
2129 int vifi;
2130 register struct ip *ip = mtod(m, struct ip *);
2131 static struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET };
2132 register int s;
2133 struct ifnet *ifp;
2134
2135 if (rsvpdebug)

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

2145 }
2146
2147 /* If the old-style non-vif-associated socket is set, then use
2148 * it and ignore the new ones.
2149 */
2150 if (ip_rsvpd != NULL) {
2151 if (rsvpdebug)
2152 printf("rsvp_input: Sending packet up old-style socket\n");
2150 rip_input(m, iphlen);
2153 rip_input(m, off, proto); /* xxx */
2151 return;
2152 }
2153
2154 s = splnet();
2155
2156 if (rsvpdebug)
2157 printf("rsvp_input: check vifs\n");
2158

--- 123 unchanged lines hidden ---
2154 return;
2155 }
2156
2157 s = splnet();
2158
2159 if (rsvpdebug)
2160 printf("rsvp_input: check vifs\n");
2161

--- 123 unchanged lines hidden ---