rtnetlink.c (b429f71bca5a4ddd914350a39572692e2ea211e0) rtnetlink.c (0e1d6eca5113858ed2caea61a5adc03c595f6096)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 1884 unchanged lines hidden (view full) ---

1893 hdrlen = nlmsg_len(cb->nlh) < sizeof(struct ifinfomsg) ?
1894 sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg);
1895
1896 if (nlmsg_parse(cb->nlh, hdrlen, tb, IFLA_MAX,
1897 ifla_policy, NULL) >= 0) {
1898 if (tb[IFLA_IF_NETNSID]) {
1899 netnsid = nla_get_s32(tb[IFLA_IF_NETNSID]);
1900 tgt_net = get_target_net(skb->sk, netnsid);
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 1884 unchanged lines hidden (view full) ---

1893 hdrlen = nlmsg_len(cb->nlh) < sizeof(struct ifinfomsg) ?
1894 sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg);
1895
1896 if (nlmsg_parse(cb->nlh, hdrlen, tb, IFLA_MAX,
1897 ifla_policy, NULL) >= 0) {
1898 if (tb[IFLA_IF_NETNSID]) {
1899 netnsid = nla_get_s32(tb[IFLA_IF_NETNSID]);
1900 tgt_net = get_target_net(skb->sk, netnsid);
1901 if (IS_ERR(tgt_net)) {
1902 tgt_net = net;
1903 netnsid = -1;
1904 }
1901 if (IS_ERR(tgt_net))
1902 return PTR_ERR(tgt_net);
1905 }
1906
1907 if (tb[IFLA_EXT_MASK])
1908 ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
1909
1910 if (tb[IFLA_MASTER])
1911 master_idx = nla_get_u32(tb[IFLA_MASTER]);
1912

--- 919 unchanged lines hidden (view full) ---

2832 else if (ops->get_num_tx_queues)
2833 num_tx_queues = ops->get_num_tx_queues();
2834
2835 if (tb[IFLA_NUM_RX_QUEUES])
2836 num_rx_queues = nla_get_u32(tb[IFLA_NUM_RX_QUEUES]);
2837 else if (ops->get_num_rx_queues)
2838 num_rx_queues = ops->get_num_rx_queues();
2839
1903 }
1904
1905 if (tb[IFLA_EXT_MASK])
1906 ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
1907
1908 if (tb[IFLA_MASTER])
1909 master_idx = nla_get_u32(tb[IFLA_MASTER]);
1910

--- 919 unchanged lines hidden (view full) ---

2830 else if (ops->get_num_tx_queues)
2831 num_tx_queues = ops->get_num_tx_queues();
2832
2833 if (tb[IFLA_NUM_RX_QUEUES])
2834 num_rx_queues = nla_get_u32(tb[IFLA_NUM_RX_QUEUES]);
2835 else if (ops->get_num_rx_queues)
2836 num_rx_queues = ops->get_num_rx_queues();
2837
2838 if (num_tx_queues < 1 || num_tx_queues > 4096)
2839 return ERR_PTR(-EINVAL);
2840
2841 if (num_rx_queues < 1 || num_rx_queues > 4096)
2842 return ERR_PTR(-EINVAL);
2843
2840 dev = alloc_netdev_mqs(ops->priv_size, ifname, name_assign_type,
2841 ops->setup, num_tx_queues, num_rx_queues);
2842 if (!dev)
2843 return ERR_PTR(-ENOMEM);
2844
2845 dev_net_set(dev, net);
2846 dev->rtnl_link_ops = ops;
2847 dev->rtnl_link_state = RTNL_LINK_INITIALIZING;

--- 1989 unchanged lines hidden ---
2844 dev = alloc_netdev_mqs(ops->priv_size, ifname, name_assign_type,
2845 ops->setup, num_tx_queues, num_rx_queues);
2846 if (!dev)
2847 return ERR_PTR(-ENOMEM);
2848
2849 dev_net_set(dev, net);
2850 dev->rtnl_link_ops = ops;
2851 dev->rtnl_link_state = RTNL_LINK_INITIALIZING;

--- 1989 unchanged lines hidden ---