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/igmp.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/igmp.c')
-rw-r--r-- | sys/netinet/igmp.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index f1bdb2b..68bd839 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)igmp.c 8.1 (Berkeley) 7/19/93 - * $Id: igmp.c,v 1.16 1996/03/14 16:59:16 fenner Exp $ + * $Id: igmp.c,v 1.17 1996/03/26 19:16:42 fenner Exp $ */ /* @@ -422,6 +422,8 @@ igmp_slowtimo() splx(s); } +static struct route igmprt; + static void igmp_sendpkt(inm, type, addr) struct in_multi *inm; @@ -431,18 +433,13 @@ igmp_sendpkt(inm, type, addr) struct mbuf *m; struct igmp *igmp; struct ip *ip; - struct ip_moptions *imo; + struct ip_moptions imo; + struct sockaddr_in *sin; MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == NULL) return; - MALLOC(imo, struct ip_moptions *, sizeof *imo, M_IPMOPTS, M_DONTWAIT); - if (!imo) { - m_free(m); - return; - } - m->m_pkthdr.rcvif = loif; m->m_pkthdr.len = sizeof(struct ip) + IGMP_MINLEN; MH_ALIGN(m, IGMP_MINLEN + sizeof(struct ip)); @@ -465,17 +462,20 @@ igmp_sendpkt(inm, type, addr) ip->ip_src.s_addr = INADDR_ANY; ip->ip_dst.s_addr = addr ? addr : igmp->igmp_group.s_addr; - imo->imo_multicast_ifp = inm->inm_ifp; - imo->imo_multicast_ttl = 1; - imo->imo_multicast_vif = -1; + imo.imo_multicast_ifp = inm->inm_ifp; + imo.imo_multicast_ttl = 1; + imo.imo_multicast_vif = -1; /* * Request loopback of the report if we are acting as a multicast * router, so that the process-level routing demon can hear it. */ - imo->imo_multicast_loop = (ip_mrouter != NULL); + imo.imo_multicast_loop = (ip_mrouter != NULL); - ip_output(m, router_alert, (struct route *)0, 0, imo); + /* + * XXX + * Do we have to worry about reentrancy here? Don't think so. + */ + ip_output(m, router_alert, &igmprt, 0, &imo); - FREE(imo, M_IPMOPTS); ++igmpstat.igps_snd_reports; } |