提交 914c8ad2 编写于 作者: J Jiri Pirko 提交者: David S. Miller

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: NJiri Pirko <jpirko@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2a3f2790
...@@ -1734,7 +1734,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) ...@@ -1734,7 +1734,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq)
goto done; goto done;
err = -EINVAL; err = -EINVAL;
if (mreq->mr_alen > dev->addr_len) if (mreq->mr_alen != dev->addr_len)
goto done; goto done;
err = -ENOBUFS; err = -ENOBUFS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册