diff options
author | wollman <wollman@FreeBSD.org> | 1996-04-18 15:41:11 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1996-04-18 15:41:11 +0000 |
commit | de80c032c5957dd5985d78273e4d3add64ac4b19 (patch) | |
tree | 332805b8f6358fa2fc7e39b810b4c1c74c6d2648 /sys/netinet/ip_mroute.c | |
parent | 0deb98a21fd8d1958148c91d4f108db34d1e45fe (diff) | |
download | FreeBSD-src-de80c032c5957dd5985d78273e4d3add64ac4b19.zip FreeBSD-src-de80c032c5957dd5985d78273e4d3add64ac4b19.tar.gz |
Always call ip_output() with a valid route pointer. For igmp, also get the
multicast option structure off the stack rather than malloc.
Diffstat (limited to 'sys/netinet/ip_mroute.c')
-rw-r--r-- | sys/netinet/ip_mroute.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index c30334a..6ab802f 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -9,7 +9,7 @@ * Modified by Bill Fenner, PARC, April 1995 * * MROUTING Revision: 3.5 - * $Id: ip_mroute.c,v 1.30 1996/03/11 17:11:23 fenner Exp $ + * $Id: ip_mroute.c,v 1.31 1996/03/26 19:16:44 fenner Exp $ */ #include "opt_mrouting.h" @@ -1906,11 +1906,12 @@ tbf_send_packet(vifp, m) { struct ip_moptions imo; int error; + static struct route ro; int s = splnet(); if (vifp->v_flags & VIFF_TUNNEL) { /* If tunnel options */ - ip_output(m, (struct mbuf *)0, (struct route *)0, + ip_output(m, (struct mbuf *)0, &vifp->v_route, IP_FORWARDING, (struct ip_moptions *)0); } else { imo.imo_multicast_ifp = vifp->v_ifp; @@ -1918,7 +1919,13 @@ tbf_send_packet(vifp, m) imo.imo_multicast_loop = 1; imo.imo_multicast_vif = -1; - error = ip_output(m, (struct mbuf *)0, (struct route *)0, + /* + * Re-entrancy should not be a problem here, because + * the packets that we send out and are looped back at us + * should get rejected because they appear to come from + * the loopback interface, thus preventing looping. + */ + error = ip_output(m, (struct mbuf *)0, &ro, IP_FORWARDING, &imo); if (mrtdebug & DEBUG_XMIT) |