]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/igmp.c
xnu-1504.15.3.tar.gz
[apple/xnu.git] / bsd / netinet / igmp.c
index 004ccc9c7a9898c367894d5698e9a3ab1cd91b30..bc2b80d68cd879445b767998f93e8b4daf8564e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -479,8 +479,6 @@ igmp_slowtimo(void)
 #endif
 }
 
-static struct route igmprt;
-
 static void
 igmp_sendpkt(struct in_multi *inm, int type, uint32_t addr)
 {
@@ -488,6 +486,7 @@ igmp_sendpkt(struct in_multi *inm, int type, uint32_t addr)
         struct igmp *igmp;
         struct ip *ip;
         struct ip_moptions imo;
+       struct route ro;
 
         MGETHDR(m, M_DONTWAIT, MT_HEADER);     /* MAC-OK */
         if (m == NULL)
@@ -537,7 +536,12 @@ igmp_sendpkt(struct in_multi *inm, int type, uint32_t addr)
         * XXX
         * Do we have to worry about reentrancy here?  Don't think so.
         */
-        ip_output(m, router_alert, &igmprt, 0, &imo, NULL);
+       bzero(&ro, sizeof (ro));
+        (void) ip_output(m, router_alert, &ro, 0, &imo, NULL);
+       if (ro.ro_rt != NULL) {
+               rtfree(ro.ro_rt);
+               ro.ro_rt = NULL;
+       }
 
         ++igmpstat.igps_snd_reports;
 }