diff options
Diffstat (limited to 'net/bridge/br_multicast.c')
-rw-r--r-- | net/bridge/br_multicast.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 977c3ee02e65..1093c89095d8 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -622,7 +622,7 @@ out: | |||
622 | struct net_bridge_port_group *br_multicast_new_port_group( | 622 | struct net_bridge_port_group *br_multicast_new_port_group( |
623 | struct net_bridge_port *port, | 623 | struct net_bridge_port *port, |
624 | struct br_ip *group, | 624 | struct br_ip *group, |
625 | struct net_bridge_port_group *next) | 625 | struct net_bridge_port_group __rcu *next) |
626 | { | 626 | { |
627 | struct net_bridge_port_group *p; | 627 | struct net_bridge_port_group *p; |
628 | 628 | ||
@@ -632,7 +632,7 @@ struct net_bridge_port_group *br_multicast_new_port_group( | |||
632 | 632 | ||
633 | p->addr = *group; | 633 | p->addr = *group; |
634 | p->port = port; | 634 | p->port = port; |
635 | p->next = next; | 635 | rcu_assign_pointer(p->next, next); |
636 | hlist_add_head(&p->mglist, &port->mglist); | 636 | hlist_add_head(&p->mglist, &port->mglist); |
637 | setup_timer(&p->timer, br_multicast_port_group_expired, | 637 | setup_timer(&p->timer, br_multicast_port_group_expired, |
638 | (unsigned long)p); | 638 | (unsigned long)p); |
@@ -1138,7 +1138,7 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
1138 | struct sk_buff *skb) | 1138 | struct sk_buff *skb) |
1139 | { | 1139 | { |
1140 | const struct ipv6hdr *ip6h = ipv6_hdr(skb); | 1140 | const struct ipv6hdr *ip6h = ipv6_hdr(skb); |
1141 | struct mld_msg *mld = (struct mld_msg *) icmp6_hdr(skb); | 1141 | struct mld_msg *mld; |
1142 | struct net_bridge_mdb_entry *mp; | 1142 | struct net_bridge_mdb_entry *mp; |
1143 | struct mld2_query *mld2q; | 1143 | struct mld2_query *mld2q; |
1144 | struct net_bridge_port_group *p; | 1144 | struct net_bridge_port_group *p; |
@@ -1165,6 +1165,7 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
1165 | if (max_delay) | 1165 | if (max_delay) |
1166 | group = &mld->mld_mca; | 1166 | group = &mld->mld_mca; |
1167 | } else if (skb->len >= sizeof(*mld2q)) { | 1167 | } else if (skb->len >= sizeof(*mld2q)) { |
1168 | u16 mrc; | ||
1168 | if (!pskb_may_pull(skb, sizeof(*mld2q))) { | 1169 | if (!pskb_may_pull(skb, sizeof(*mld2q))) { |
1169 | err = -EINVAL; | 1170 | err = -EINVAL; |
1170 | goto out; | 1171 | goto out; |
@@ -1172,7 +1173,8 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
1172 | mld2q = (struct mld2_query *)icmp6_hdr(skb); | 1173 | mld2q = (struct mld2_query *)icmp6_hdr(skb); |
1173 | if (!mld2q->mld2q_nsrcs) | 1174 | if (!mld2q->mld2q_nsrcs) |
1174 | group = &mld2q->mld2q_mca; | 1175 | group = &mld2q->mld2q_mca; |
1175 | max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(mld2q->mld2q_mrc) : 1; | 1176 | mrc = ntohs(mld2q->mld2q_mrc); |
1177 | max_delay = mrc ? MLDV2_MRC(mrc) : 1; | ||
1176 | } | 1178 | } |
1177 | 1179 | ||
1178 | if (!group) | 1180 | if (!group) |