vlan_netlink.c (e87a3dd33eab30b4db539500064a9584867e4f2c) | vlan_netlink.c (81adee47dfb608df3ad0b91d230fb3cef75f0060) |
---|---|
1/* 2 * VLAN netlink control interface 3 * 4 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * version 2 as published by the Free Software Foundation. --- 105 unchanged lines hidden (view full) --- 114 if (!real_dev) 115 return -ENODEV; 116 117 *num_tx_queues = real_dev->num_tx_queues; 118 *real_num_tx_queues = real_dev->real_num_tx_queues; 119 return 0; 120} 121 | 1/* 2 * VLAN netlink control interface 3 * 4 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * version 2 as published by the Free Software Foundation. --- 105 unchanged lines hidden (view full) --- 114 if (!real_dev) 115 return -ENODEV; 116 117 *num_tx_queues = real_dev->num_tx_queues; 118 *real_num_tx_queues = real_dev->real_num_tx_queues; 119 return 0; 120} 121 |
122static int vlan_newlink(struct net_device *dev, | 122static int vlan_newlink(struct net *src_net, struct net_device *dev, |
123 struct nlattr *tb[], struct nlattr *data[]) 124{ 125 struct vlan_dev_info *vlan = vlan_dev_info(dev); 126 struct net_device *real_dev; 127 int err; 128 129 if (!data[IFLA_VLAN_ID]) 130 return -EINVAL; 131 132 if (!tb[IFLA_LINK]) 133 return -EINVAL; | 123 struct nlattr *tb[], struct nlattr *data[]) 124{ 125 struct vlan_dev_info *vlan = vlan_dev_info(dev); 126 struct net_device *real_dev; 127 int err; 128 129 if (!data[IFLA_VLAN_ID]) 130 return -EINVAL; 131 132 if (!tb[IFLA_LINK]) 133 return -EINVAL; |
134 real_dev = __dev_get_by_index(dev_net(dev), nla_get_u32(tb[IFLA_LINK])); | 134 real_dev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK])); |
135 if (!real_dev) 136 return -ENODEV; 137 138 vlan->vlan_id = nla_get_u16(data[IFLA_VLAN_ID]); 139 vlan->real_dev = real_dev; 140 vlan->flags = VLAN_FLAG_REORDER_HDR; 141 142 err = vlan_check_real_dev(real_dev, vlan->vlan_id); --- 117 unchanged lines hidden --- | 135 if (!real_dev) 136 return -ENODEV; 137 138 vlan->vlan_id = nla_get_u16(data[IFLA_VLAN_ID]); 139 vlan->real_dev = real_dev; 140 vlan->flags = VLAN_FLAG_REORDER_HDR; 141 142 err = vlan_check_real_dev(real_dev, vlan->vlan_id); --- 117 unchanged lines hidden --- |