macvlan.c (2871f352c600d36b1b8ba57c79029cf8aa512948) macvlan.c (8a50f11c3b176d7a1df8cd5e29cbe965905e51ee)
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 *

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

734static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
735 struct net_device *dev,
736 const unsigned char *addr,
737 u16 flags)
738{
739 struct macvlan_dev *vlan = netdev_priv(dev);
740 int err = -EINVAL;
741
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 *

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

734static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
735 struct net_device *dev,
736 const unsigned char *addr,
737 u16 flags)
738{
739 struct macvlan_dev *vlan = netdev_priv(dev);
740 int err = -EINVAL;
741
742 if (!vlan->port->passthru)
742 /* Support unicast filter only on passthru devices.
743 * Multicast filter should be allowed on all devices.
744 */
745 if (!vlan->port->passthru && is_unicast_ether_addr(addr))
743 return -EOPNOTSUPP;
744
745 if (flags & NLM_F_REPLACE)
746 return -EOPNOTSUPP;
747
748 if (is_unicast_ether_addr(addr))
749 err = dev_uc_add_excl(dev, addr);
750 else if (is_multicast_ether_addr(addr))

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

755
756static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
757 struct net_device *dev,
758 const unsigned char *addr)
759{
760 struct macvlan_dev *vlan = netdev_priv(dev);
761 int err = -EINVAL;
762
746 return -EOPNOTSUPP;
747
748 if (flags & NLM_F_REPLACE)
749 return -EOPNOTSUPP;
750
751 if (is_unicast_ether_addr(addr))
752 err = dev_uc_add_excl(dev, addr);
753 else if (is_multicast_ether_addr(addr))

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

758
759static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
760 struct net_device *dev,
761 const unsigned char *addr)
762{
763 struct macvlan_dev *vlan = netdev_priv(dev);
764 int err = -EINVAL;
765
763 if (!vlan->port->passthru)
766 /* Support unicast filter only on passthru devices.
767 * Multicast filter should be allowed on all devices.
768 */
769 if (!vlan->port->passthru && is_unicast_ether_addr(addr))
764 return -EOPNOTSUPP;
765
766 if (is_unicast_ether_addr(addr))
767 err = dev_uc_del(dev, addr);
768 else if (is_multicast_ether_addr(addr))
769 err = dev_mc_del(dev, addr);
770
771 return err;

--- 485 unchanged lines hidden ---
770 return -EOPNOTSUPP;
771
772 if (is_unicast_ether_addr(addr))
773 err = dev_uc_del(dev, addr);
774 else if (is_multicast_ether_addr(addr))
775 err = dev_mc_del(dev, addr);
776
777 return err;

--- 485 unchanged lines hidden ---