aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r--net/switchdev/switchdev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 6f145b592a53..017801f9dbaa 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -768,6 +768,9 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
768 u32 mask = BR_LEARNING | BR_LEARNING_SYNC | BR_FLOOD; 768 u32 mask = BR_LEARNING | BR_LEARNING_SYNC | BR_FLOOD;
769 int err; 769 int err;
770 770
771 if (!netif_is_bridge_port(dev))
772 return -EOPNOTSUPP;
773
771 err = switchdev_port_attr_get(dev, &attr); 774 err = switchdev_port_attr_get(dev, &attr);
772 if (err && err != -EOPNOTSUPP) 775 if (err && err != -EOPNOTSUPP)
773 return err; 776 return err;
@@ -923,6 +926,9 @@ int switchdev_port_bridge_setlink(struct net_device *dev,
923 struct nlattr *afspec; 926 struct nlattr *afspec;
924 int err = 0; 927 int err = 0;
925 928
929 if (!netif_is_bridge_port(dev))
930 return -EOPNOTSUPP;
931
926 protinfo = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), 932 protinfo = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg),
927 IFLA_PROTINFO); 933 IFLA_PROTINFO);
928 if (protinfo) { 934 if (protinfo) {
@@ -956,6 +962,9 @@ int switchdev_port_bridge_dellink(struct net_device *dev,
956{ 962{
957 struct nlattr *afspec; 963 struct nlattr *afspec;
958 964
965 if (!netif_is_bridge_port(dev))
966 return -EOPNOTSUPP;
967
959 afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), 968 afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg),
960 IFLA_AF_SPEC); 969 IFLA_AF_SPEC);
961 if (afspec) 970 if (afspec)