linux/net
Roopa Prabhu 02dba4388d bridge: fix setlink/dellink notifications
problems with bridge getlink/setlink notifications today:
        - bridge setlink generates two notifications to userspace
                - one from the bridge driver
                - one from rtnetlink.c (rtnl_bridge_notify)
        - dellink generates one notification from rtnetlink.c. Which
	means bridge setlink and dellink notifications are not
	consistent

        - Looking at the code it appears,
	If both BRIDGE_FLAGS_MASTER and BRIDGE_FLAGS_SELF were set,
        the size calculation in rtnl_bridge_notify can be wrong.
        Example: if you set both BRIDGE_FLAGS_MASTER and BRIDGE_FLAGS_SELF
        in a setlink request to rocker dev, rtnl_bridge_notify will
	allocate skb for one set of bridge attributes, but,
	both the bridge driver and rocker dev will try to add
	attributes resulting in twice the number of attributes
	being added to the skb.  (rocker dev calls ndo_dflt_bridge_getlink)

There are multiple options:
1) Generate one notification including all attributes from master and self:
   But, I don't think it will work, because both master and self may use
   the same attributes/policy. Cannot pack the same set of attributes in a
   single notification from both master and slave (duplicate attributes).

2) Generate one notification from master and the other notification from
   self (This seems to be ideal):
     For master: the master driver will send notification (bridge in this
	example)
     For self: the self driver will send notification (rocker in the above
	example. It can use helpers from rtnetlink.c to do so. Like the
	ndo_dflt_bridge_getlink api).

This patch implements 2) (leaving the 'rtnl_bridge_notify' around to be used
with 'self').

v1->v2 :
	- rtnl_bridge_notify is now called only for self,
	so, remove 'BRIDGE_FLAGS_SELF' check and cleanup a few things
	- rtnl_bridge_dellink used to always send a RTM_NEWLINK msg
	earlier. So, I have changed the notification from br_dellink to
	go as RTM_NEWLINK

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-17 23:49:51 -05:00
..
6lowpan
9p
802
8021q net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
appletalk
atm
ax25
batman-adv batman-adv: Kconfig, Add missing DEBUG_FS dependency 2015-01-07 22:17:11 +01:00
bluetooth
bridge bridge: fix setlink/dellink notifications 2015-01-17 23:49:51 -05:00
caif
can
ceph libceph: fix sparse endianness warnings 2015-01-08 20:36:57 +03:00
core bridge: fix setlink/dellink notifications 2015-01-17 23:49:51 -05:00
dcb
dccp
decnet net: tcp: add RTAX_CC_ALGO fib handling 2015-01-05 22:55:24 -05:00
dns_resolver
dsa
ethernet
hsr
ieee802154
ipv4 ipv4: per cpu uncached list 2015-01-15 18:26:16 -05:00
ipv6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
ipx
irda
iucv
key
l2tp
lapb
llc
mac80211 mac80211: don't defer scans in case of radar detection 2015-01-14 09:37:07 +01:00
mac802154
mpls
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2015-01-15 01:50:25 -05:00
netlabel
netlink netlink: Fix netlink_insert EADDRINUSE error 2015-01-16 02:38:07 -05:00
netrom
nfc
openvswitch openvswitch: Support VXLAN Group Policy extension 2015-01-15 01:11:41 -05:00
packet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
phonet
rds
rfkill
rose
rxrpc
sched net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
sctp
sunrpc rpc: fix xdr_truncate_encode to handle buffer ending on page boundary 2015-01-07 14:03:58 -05:00
switchdev
tipc tipc: correctly handle releasing a not fully initialized sock 2015-01-13 17:26:27 -05:00
unix
vmw_vsock
wimax
wireless Here's a big pile of changes for this round. 2015-01-15 19:16:56 -05:00
x25
xfrm net: xfrm: xfrm_algo: Remove unused function 2015-01-12 16:50:46 -05:00
compat.c
Kconfig
Makefile
socket.c socket: use iov_length() 2015-01-15 13:56:15 -05:00
sysctl_net.c