From: Jiri Pirko Date: Wed, 24 Feb 2010 23:57:04 +0000 (+0000) Subject: af_packet: do not accept mc address smaller then dev->addr_len in packet_mc_add() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=914c8ad2d18b62ad1420f518c0cab0b0b90ab308;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git af_packet: do not accept mc address smaller then dev->addr_len in packet_mc_add() There is no point of accepting an address of smaller length than dev->addr_len here. Therefore change this for stonger check. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 2f0369367ee0..e2d1def70841 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1734,7 +1734,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) goto done; err = -EINVAL; - if (mreq->mr_alen > dev->addr_len) + if (mreq->mr_alen != dev->addr_len) goto done; err = -ENOBUFS;