af_mpls.c (e8ba330ac0c55004e775eab53fa1e748e5d71bdb) | af_mpls.c (addd383f5a0ba9bf8336be3cc8b7a2916c08a77a) |
---|---|
1#include <linux/types.h> 2#include <linux/skbuff.h> 3#include <linux/socket.h> 4#include <linux/sysctl.h> 5#include <linux/net.h> 6#include <linux/module.h> 7#include <linux/if_arp.h> 8#include <linux/ipv6.h> --- 1249 unchanged lines hidden (view full) --- 1258 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid); 1259errout: 1260 return err; 1261} 1262 1263static int mpls_netconf_dump_devconf(struct sk_buff *skb, 1264 struct netlink_callback *cb) 1265{ | 1#include <linux/types.h> 2#include <linux/skbuff.h> 3#include <linux/socket.h> 4#include <linux/sysctl.h> 5#include <linux/net.h> 6#include <linux/module.h> 7#include <linux/if_arp.h> 8#include <linux/ipv6.h> --- 1249 unchanged lines hidden (view full) --- 1258 err = rtnl_unicast(skb, net, NETLINK_CB(in_skb).portid); 1259errout: 1260 return err; 1261} 1262 1263static int mpls_netconf_dump_devconf(struct sk_buff *skb, 1264 struct netlink_callback *cb) 1265{ |
1266 const struct nlmsghdr *nlh = cb->nlh; |
|
1266 struct net *net = sock_net(skb->sk); 1267 struct hlist_head *head; 1268 struct net_device *dev; 1269 struct mpls_dev *mdev; 1270 int idx, s_idx; 1271 int h, s_h; 1272 | 1267 struct net *net = sock_net(skb->sk); 1268 struct hlist_head *head; 1269 struct net_device *dev; 1270 struct mpls_dev *mdev; 1271 int idx, s_idx; 1272 int h, s_h; 1273 |
1274 if (cb->strict_check) { 1275 struct netlink_ext_ack *extack = cb->extack; 1276 struct netconfmsg *ncm; 1277 1278 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ncm))) { 1279 NL_SET_ERR_MSG_MOD(extack, "Invalid header for netconf dump request"); 1280 return -EINVAL; 1281 } 1282 1283 if (nlmsg_attrlen(nlh, sizeof(*ncm))) { 1284 NL_SET_ERR_MSG_MOD(extack, "Invalid data after header in netconf dump request"); 1285 return -EINVAL; 1286 } 1287 } 1288 |
|
1273 s_h = cb->args[0]; 1274 s_idx = idx = cb->args[1]; 1275 1276 for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) { 1277 idx = 0; 1278 head = &net->dev_index_head[h]; 1279 rcu_read_lock(); 1280 cb->seq = net->dev_base_seq; 1281 hlist_for_each_entry_rcu(dev, head, index_hlist) { 1282 if (idx < s_idx) 1283 goto cont; 1284 mdev = mpls_dev_get(dev); 1285 if (!mdev) 1286 goto cont; 1287 if (mpls_netconf_fill_devconf(skb, mdev, 1288 NETLINK_CB(cb->skb).portid, | 1289 s_h = cb->args[0]; 1290 s_idx = idx = cb->args[1]; 1291 1292 for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) { 1293 idx = 0; 1294 head = &net->dev_index_head[h]; 1295 rcu_read_lock(); 1296 cb->seq = net->dev_base_seq; 1297 hlist_for_each_entry_rcu(dev, head, index_hlist) { 1298 if (idx < s_idx) 1299 goto cont; 1300 mdev = mpls_dev_get(dev); 1301 if (!mdev) 1302 goto cont; 1303 if (mpls_netconf_fill_devconf(skb, mdev, 1304 NETLINK_CB(cb->skb).portid, |
1289 cb->nlh->nlmsg_seq, | 1305 nlh->nlmsg_seq, |
1290 RTM_NEWNETCONF, 1291 NLM_F_MULTI, 1292 NETCONFA_ALL) < 0) { 1293 rcu_read_unlock(); 1294 goto done; 1295 } 1296 nl_dump_check_consistent(cb, nlmsg_hdr(skb)); 1297cont: --- 1268 unchanged lines hidden --- | 1306 RTM_NEWNETCONF, 1307 NLM_F_MULTI, 1308 NETCONFA_ALL) < 0) { 1309 rcu_read_unlock(); 1310 goto done; 1311 } 1312 nl_dump_check_consistent(cb, nlmsg_hdr(skb)); 1313cont: --- 1268 unchanged lines hidden --- |