summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2006-05-18 19:51:08 +0000
committerbms <bms@FreeBSD.org>2006-05-18 19:51:08 +0000
commitc18ccfca54edd73996fead5c2b7535b03d8864fa (patch)
tree8884cc5d737d630c671336a4c6ff106b2b886819 /sys/netinet
parent9f2c58752f9697d3dbdf228d9da57a063799c25b (diff)
downloadFreeBSD-src-c18ccfca54edd73996fead5c2b7535b03d8864fa.zip
FreeBSD-src-c18ccfca54edd73996fead5c2b7535b03d8864fa.tar.gz
Initialize the new members of struct ip_moptions as
a defensive programming measure. Note that whilst these members are not used by the ip_output() path, we are passing an instance of struct ip_moptions here which is declared on the stack (which could be considered a bad thing). ip_output() does not consume struct ip_moptions, but in case it does in future, declare an in_multi vector on the stack too to behave more like ip_findmoptions() does.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_mroute.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 6472f76..c5f686e 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -2116,6 +2116,7 @@ tbf_send_packet(struct vif *vifp, struct mbuf *m)
ip_output(m, NULL, &vifp->v_route, IP_FORWARDING, NULL, NULL);
else {
struct ip_moptions imo;
+ struct in_multi *imm[2];
int error;
static struct route ro; /* XXX check this */
@@ -2123,6 +2124,9 @@ tbf_send_packet(struct vif *vifp, struct mbuf *m)
imo.imo_multicast_ttl = mtod(m, struct ip *)->ip_ttl - 1;
imo.imo_multicast_loop = 1;
imo.imo_multicast_vif = -1;
+ imo.imo_num_memberships = 0;
+ imo.imo_max_memberships = 2;
+ imo.imo_membership = &imm[0];
/*
* Re-entrancy should not be a problem here, because
OpenPOWER on IntegriCloud