aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet/af_packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r--net/packet/af_packet.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ad0052524e88..745e2cb87c96 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -347,7 +347,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
347 */ 347 */
348 348
349 saddr->spkt_device[13] = 0; 349 saddr->spkt_device[13] = 0;
350 dev = dev_get_by_name(saddr->spkt_device); 350 dev = dev_get_by_name(&init_net, saddr->spkt_device);
351 err = -ENODEV; 351 err = -ENODEV;
352 if (dev == NULL) 352 if (dev == NULL)
353 goto out_unlock; 353 goto out_unlock;
@@ -742,7 +742,7 @@ static int packet_sendmsg(struct kiocb *iocb, struct socket *sock,
742 } 742 }
743 743
744 744
745 dev = dev_get_by_index(ifindex); 745 dev = dev_get_by_index(&init_net, ifindex);
746 err = -ENXIO; 746 err = -ENXIO;
747 if (dev == NULL) 747 if (dev == NULL)
748 goto out_unlock; 748 goto out_unlock;
@@ -937,7 +937,7 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add
937 return -EINVAL; 937 return -EINVAL;
938 strlcpy(name,uaddr->sa_data,sizeof(name)); 938 strlcpy(name,uaddr->sa_data,sizeof(name));
939 939
940 dev = dev_get_by_name(name); 940 dev = dev_get_by_name(&init_net, name);
941 if (dev) { 941 if (dev) {
942 err = packet_do_bind(sk, dev, pkt_sk(sk)->num); 942 err = packet_do_bind(sk, dev, pkt_sk(sk)->num);
943 dev_put(dev); 943 dev_put(dev);
@@ -964,7 +964,7 @@ static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len
964 964
965 if (sll->sll_ifindex) { 965 if (sll->sll_ifindex) {
966 err = -ENODEV; 966 err = -ENODEV;
967 dev = dev_get_by_index(sll->sll_ifindex); 967 dev = dev_get_by_index(&init_net, sll->sll_ifindex);
968 if (dev == NULL) 968 if (dev == NULL)
969 goto out; 969 goto out;
970 } 970 }
@@ -1161,7 +1161,7 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
1161 return -EOPNOTSUPP; 1161 return -EOPNOTSUPP;
1162 1162
1163 uaddr->sa_family = AF_PACKET; 1163 uaddr->sa_family = AF_PACKET;
1164 dev = dev_get_by_index(pkt_sk(sk)->ifindex); 1164 dev = dev_get_by_index(&init_net, pkt_sk(sk)->ifindex);
1165 if (dev) { 1165 if (dev) {
1166 strlcpy(uaddr->sa_data, dev->name, 15); 1166 strlcpy(uaddr->sa_data, dev->name, 15);
1167 dev_put(dev); 1167 dev_put(dev);
@@ -1186,7 +1186,7 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
1186 sll->sll_family = AF_PACKET; 1186 sll->sll_family = AF_PACKET;
1187 sll->sll_ifindex = po->ifindex; 1187 sll->sll_ifindex = po->ifindex;
1188 sll->sll_protocol = po->num; 1188 sll->sll_protocol = po->num;
1189 dev = dev_get_by_index(po->ifindex); 1189 dev = dev_get_by_index(&init_net, po->ifindex);
1190 if (dev) { 1190 if (dev) {
1191 sll->sll_hatype = dev->type; 1191 sll->sll_hatype = dev->type;
1192 sll->sll_halen = dev->addr_len; 1192 sll->sll_halen = dev->addr_len;
@@ -1238,7 +1238,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq)
1238 rtnl_lock(); 1238 rtnl_lock();
1239 1239
1240 err = -ENODEV; 1240 err = -ENODEV;
1241 dev = __dev_get_by_index(mreq->mr_ifindex); 1241 dev = __dev_get_by_index(&init_net, mreq->mr_ifindex);
1242 if (!dev) 1242 if (!dev)
1243 goto done; 1243 goto done;
1244 1244
@@ -1292,7 +1292,7 @@ static int packet_mc_drop(struct sock *sk, struct packet_mreq_max *mreq)
1292 if (--ml->count == 0) { 1292 if (--ml->count == 0) {
1293 struct net_device *dev; 1293 struct net_device *dev;
1294 *mlp = ml->next; 1294 *mlp = ml->next;
1295 dev = dev_get_by_index(ml->ifindex); 1295 dev = dev_get_by_index(&init_net, ml->ifindex);
1296 if (dev) { 1296 if (dev) {
1297 packet_dev_mc(dev, ml, -1); 1297 packet_dev_mc(dev, ml, -1);
1298 dev_put(dev); 1298 dev_put(dev);
@@ -1320,7 +1320,7 @@ static void packet_flush_mclist(struct sock *sk)
1320 struct net_device *dev; 1320 struct net_device *dev;
1321 1321
1322 po->mclist = ml->next; 1322 po->mclist = ml->next;
1323 if ((dev = dev_get_by_index(ml->ifindex)) != NULL) { 1323 if ((dev = dev_get_by_index(&init_net, ml->ifindex)) != NULL) {
1324 packet_dev_mc(dev, ml, -1); 1324 packet_dev_mc(dev, ml, -1);
1325 dev_put(dev); 1325 dev_put(dev);
1326 } 1326 }