aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-29 23:33:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-29 23:33:20 -0400
commit2a26d99b251b8625d27aed14e97fc10707a3a81f (patch)
tree69eb8aa0476294236ceb8a864be9a697e2303ace /net/switchdev/switchdev.c
parenta909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff)
parentfceb9c3e38252992bbf1a3028cc2f7b871211533 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Lots of fixes, mostly drivers as is usually the case. 1) Don't treat zero DMA address as invalid in vmxnet3, from Alexey Khoroshilov. 2) Fix element timeouts in netfilter's nft_dynset, from Anders K. Pedersen. 3) Don't put aead_req crypto struct on the stack in mac80211, from Ard Biesheuvel. 4) Several uninitialized variable warning fixes from Arnd Bergmann. 5) Fix memory leak in cxgb4, from Colin Ian King. 6) Fix bpf handling of VLAN header push/pop, from Daniel Borkmann. 7) Several VRF semantic fixes from David Ahern. 8) Set skb->protocol properly in ip6_tnl_xmit(), from Eli Cooper. 9) Socket needs to be locked in udp_disconnect(), from Eric Dumazet. 10) Div-by-zero on 32-bit fix in mlx4 driver, from Eugenia Emantayev. 11) Fix stale link state during failover in NCSCI driver, from Gavin Shan. 12) Fix netdev lower adjacency list traversal, from Ido Schimmel. 13) Propvide proper handle when emitting notifications of filter deletes, from Jamal Hadi Salim. 14) Memory leaks and big-endian issues in rtl8xxxu, from Jes Sorensen. 15) Fix DESYNC_FACTOR handling in ipv6, from Jiri Bohac. 16) Several routing offload fixes in mlxsw driver, from Jiri Pirko. 17) Fix broadcast sync problem in TIPC, from Jon Paul Maloy. 18) Validate chunk len before using it in SCTP, from Marcelo Ricardo Leitner. 19) Revert a netns locking change that causes regressions, from Paul Moore. 20) Add recursion limit to GRO handling, from Sabrina Dubroca. 21) GFP_KERNEL in irq context fix in ibmvnic, from Thomas Falcon. 22) Avoid accessing stale vxlan/geneve socket in data path, from Pravin Shelar" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (189 commits) geneve: avoid using stale geneve socket. vxlan: avoid using stale vxlan socket. qede: Fix out-of-bound fastpath memory access net: phy: dp83848: add dp83822 PHY support enic: fix rq disable tipc: fix broadcast link synchronization problem ibmvnic: Fix missing brackets in init_sub_crq_irqs ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context Revert "ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context" arch/powerpc: Update parameters for csum_tcpudp_magic & csum_tcpudp_nofold net/mlx4_en: Save slave ethtool stats command net/mlx4_en: Fix potential deadlock in port statistics flow net/mlx4: Fix firmware command timeout during interrupt test net/mlx4_core: Do not access comm channel if it has not yet been initialized net/mlx4_en: Fix panic during reboot net/mlx4_en: Process all completions in RX rings after port goes up net/mlx4_en: Resolve dividing by zero in 32-bit system net/mlx4_core: Change the default value of enable_qos net/mlx4_core: Avoid setting ports to auto when only one port type is supported net/mlx4_core: Fix the resource-type enum in res tracker to conform to FW spec ...
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 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)