macvlan.c (e3c55d406bd8df1a878546002c93db90c42be10c) macvlan.c (47d4ab91e4472723f181075c81627374ca86816c)
1/*
2 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *

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

823
824 if (vlan->mode == MACVLAN_MODE_PASSTHRU) {
825 if (port->count)
826 return -EINVAL;
827 port->passthru = true;
828 eth_hw_addr_inherit(dev, lowerdev);
829 }
830
1/*
2 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *

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

823
824 if (vlan->mode == MACVLAN_MODE_PASSTHRU) {
825 if (port->count)
826 return -EINVAL;
827 port->passthru = true;
828 eth_hw_addr_inherit(dev, lowerdev);
829 }
830
831 port->count += 1;
832 err = register_netdevice(dev);
833 if (err < 0)
834 goto destroy_port;
835
831 err = netdev_upper_dev_link(lowerdev, dev);
832 if (err)
833 goto destroy_port;
834
836 err = netdev_upper_dev_link(lowerdev, dev);
837 if (err)
838 goto destroy_port;
839
835 port->count += 1;
836 err = register_netdevice(dev);
837 if (err < 0)
838 goto upper_dev_unlink;
839
840 list_add_tail_rcu(&vlan->list, &port->vlans);
841 netif_stacked_transfer_operstate(lowerdev, dev);
842
843 return 0;
844
840
841 list_add_tail_rcu(&vlan->list, &port->vlans);
842 netif_stacked_transfer_operstate(lowerdev, dev);
843
844 return 0;
845
845upper_dev_unlink:
846 netdev_upper_dev_unlink(lowerdev, dev);
847destroy_port:
848 port->count -= 1;
849 if (!port->count)
850 macvlan_port_destroy(lowerdev);
851
852 return err;
853}
854EXPORT_SYMBOL_GPL(macvlan_common_newlink);

--- 181 unchanged lines hidden ---
846destroy_port:
847 port->count -= 1;
848 if (!port->count)
849 macvlan_port_destroy(lowerdev);
850
851 return err;
852}
853EXPORT_SYMBOL_GPL(macvlan_common_newlink);

--- 181 unchanged lines hidden ---