Commit de74e92a authored by danborkmann@iogearbox.net's avatar danborkmann@iogearbox.net Committed by David S. Miller

af_packet: use sizeof instead of constant in spkt_device

This small patch removes access to the last element of the spkt_device
array through a constant. Instead, it is accessed by sizeof() to respect
possible changes in if_packet.h.
Signed-off-by: default avatarDaniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 55afabaa
...@@ -1475,7 +1475,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock, ...@@ -1475,7 +1475,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
* Find the device first to size check it * Find the device first to size check it
*/ */
saddr->spkt_device[13] = 0; saddr->spkt_device[sizeof(saddr->spkt_device) - 1] = 0;
retry: retry:
rcu_read_lock(); rcu_read_lock();
dev = dev_get_by_name_rcu(sock_net(sk), saddr->spkt_device); dev = dev_get_by_name_rcu(sock_net(sk), saddr->spkt_device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment