bridge: Move NULL mdb check into br_mdb_ip_get
Since all callers of br_mdb_ip_get need to check whether the hash table is NULL, this patch moves the check into the function. This fixes the two callers (query/leave handler) that didn't check it. Reported-by: Michael Braun <michael-dev@fami-braun.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d00561a2f6
commit
0821ec55bb
@@ -49,22 +49,23 @@ static struct net_bridge_mdb_entry *__br_mdb_ip_get(
|
|||||||
static struct net_bridge_mdb_entry *br_mdb_ip_get(
|
static struct net_bridge_mdb_entry *br_mdb_ip_get(
|
||||||
struct net_bridge_mdb_htable *mdb, __be32 dst)
|
struct net_bridge_mdb_htable *mdb, __be32 dst)
|
||||||
{
|
{
|
||||||
|
if (!mdb)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return __br_mdb_ip_get(mdb, dst, br_ip_hash(mdb, dst));
|
return __br_mdb_ip_get(mdb, dst, br_ip_hash(mdb, dst));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br,
|
struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br,
|
||||||
struct sk_buff *skb)
|
struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct net_bridge_mdb_htable *mdb = br->mdb;
|
if (br->multicast_disabled)
|
||||||
|
|
||||||
if (!mdb || br->multicast_disabled)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch (skb->protocol) {
|
switch (skb->protocol) {
|
||||||
case htons(ETH_P_IP):
|
case htons(ETH_P_IP):
|
||||||
if (BR_INPUT_SKB_CB(skb)->igmp)
|
if (BR_INPUT_SKB_CB(skb)->igmp)
|
||||||
break;
|
break;
|
||||||
return br_mdb_ip_get(mdb, ip_hdr(skb)->daddr);
|
return br_mdb_ip_get(br->mdb, ip_hdr(skb)->daddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user