aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet/af_packet.c
diff options
context:
space:
mode:
authordanborkmann@iogearbox.net <danborkmann@iogearbox.net>2012-06-10 04:59:28 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-11 19:51:51 -0400
commitde74e92aa8a44d0b80a53601dc4f6dd6afcb8453 (patch)
treefa880b187e38df3499e490b78f435e2c952c11c9 /net/packet/af_packet.c
parent55afabaa0df0dd139c8796a71beb43d1216fbe43 (diff)
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>
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r--net/packet/af_packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 71ac6559e0c6..8a10d5b3c832 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1475,7 +1475,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
1475 * Find the device first to size check it 1475 * Find the device first to size check it
1476 */ 1476 */
1477 1477
1478 saddr->spkt_device[13] = 0; 1478 saddr->spkt_device[sizeof(saddr->spkt_device) - 1] = 0;
1479retry: 1479retry:
1480 rcu_read_lock(); 1480 rcu_read_lock();
1481 dev = dev_get_by_name_rcu(sock_net(sk), saddr->spkt_device); 1481 dev = dev_get_by_name_rcu(sock_net(sk), saddr->spkt_device);