dect
/
linux-2.6
Archived
13
0
Fork 0

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: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
danborkmann@iogearbox.net 2012-06-10 08:59:28 +00:00 committed by David S. Miller
parent 55afabaa0d
commit de74e92aa8
1 changed files with 1 additions and 1 deletions

View File

@ -1475,7 +1475,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
* Find the device first to size check it
*/
saddr->spkt_device[13] = 0;
saddr->spkt_device[sizeof(saddr->spkt_device) - 1] = 0;
retry:
rcu_read_lock();
dev = dev_get_by_name_rcu(sock_net(sk), saddr->spkt_device);