diff options
Diffstat (limited to 'net/switchdev/switchdev.c')
| -rw-r--r-- | net/switchdev/switchdev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 02beb35f577f..3b95fe980fa2 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
| @@ -771,6 +771,9 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
| 771 | u32 mask = BR_LEARNING | BR_LEARNING_SYNC | BR_FLOOD; | 771 | u32 mask = BR_LEARNING | BR_LEARNING_SYNC | BR_FLOOD; |
| 772 | int err; | 772 | int err; |
| 773 | 773 | ||
| 774 | if (!netif_is_bridge_port(dev)) | ||
| 775 | return -EOPNOTSUPP; | ||
| 776 | |||
| 774 | err = switchdev_port_attr_get(dev, &attr); | 777 | err = switchdev_port_attr_get(dev, &attr); |
| 775 | if (err && err != -EOPNOTSUPP) | 778 | if (err && err != -EOPNOTSUPP) |
| 776 | return err; | 779 | return err; |
| @@ -926,6 +929,9 @@ int switchdev_port_bridge_setlink(struct net_device *dev, | |||
| 926 | struct nlattr *afspec; | 929 | struct nlattr *afspec; |
| 927 | int err = 0; | 930 | int err = 0; |
| 928 | 931 | ||
| 932 | if (!netif_is_bridge_port(dev)) | ||
| 933 | return -EOPNOTSUPP; | ||
| 934 | |||
| 929 | protinfo = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), | 935 | protinfo = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), |
| 930 | IFLA_PROTINFO); | 936 | IFLA_PROTINFO); |
| 931 | if (protinfo) { | 937 | if (protinfo) { |
| @@ -959,6 +965,9 @@ int switchdev_port_bridge_dellink(struct net_device *dev, | |||
| 959 | { | 965 | { |
| 960 | struct nlattr *afspec; | 966 | struct nlattr *afspec; |
| 961 | 967 | ||
| 968 | if (!netif_is_bridge_port(dev)) | ||
| 969 | return -EOPNOTSUPP; | ||
| 970 | |||
| 962 | afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), | 971 | afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), |
| 963 | IFLA_AF_SPEC); | 972 | IFLA_AF_SPEC); |
| 964 | if (afspec) | 973 | if (afspec) |
