linux/drivers
Andy Gospodarek eaddcd7690 bonding: remove entries for master_ip and vlan_ip and query devices instead
The following patch aimed to resolve an issue where secondary, tertiary,
etc. addresses added to bond interfaces could overwrite the
bond->master_ip and vlan_ip values.

        commit 917fbdb32f
        Author: Henrik Saavedra Persson <henrik.e.persson@ericsson.com>
        Date:   Wed Nov 23 23:37:15 2011 +0000

            bonding: only use primary address for ARP

That patch was good because it prevented bonds using ARP monitoring from
sending frames with an invalid source IP address.  Unfortunately, it
didn't always work as expected.

When using an ioctl (like ifconfig does) to set the IP address and
netmask, 2 separate ioctls are actually called to set the IP and netmask
if the mask chosen doesn't match the standard mask for that class of
address.  The first ioctl did not have a mask that matched the one in
the primary address and would still cause the device address to be
overwritten.  The second ioctl that was called to set the mask would
then detect as secondary and ignored, but the damage was already done.

This was not an issue when using an application that used netlink
sockets as the setting of IP and netmask came down at once.  The
inconsistent behavior between those two interfaces was something that
needed to be resolved.

While I was thinking about how I wanted to resolve this, Ralf Zeidler
came with a patch that resolved this on a RHEL kernel by keeping a full
shadow of the entries in dev->ifa_list for the bonding device and vlan
devices in the bonding driver.  I didn't like the duplication of the
list as I want to see the 'bonding' struct and code shrink rather than
grow, but liked the general idea.

As the Subject indicates this patch drops the master_ip and vlan_ip
elements from the 'bonding' and 'vlan_entry' structs, respectively.
This can be done because a device's address-list is now traversed to
determine the optimal source IP address for ARP requests and for checks
to see if the bonding device has a particular IP address.  This code
could have all be contained inside the bonding driver, but it made more
sense to me to EXPORT and call inet_confirm_addr since it did exactly
what was needed.

I tested this and a backported patch and everything works as expected.
Ralf also helped with verification of the backported patch.

Thanks to Ralf for all his help on this.

v2: Whitespace and organizational changes based on suggestions from Jay
Vosburgh and Dave Miller.

v3: Fixup incorrect usage of rcu_read_unlock based on Dave Miller's
suggestion.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
CC: Ralf Zeidler <ralf.zeidler@nsn.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-22 22:36:17 -04:00
..
accessibility vt:tackle kbd_table 2012-03-08 10:50:35 -08:00
acpi
amba
ata ata: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
atm eni: fix driver remove function and driver probe error path. 2012-03-16 23:13:20 -07:00
auxdisplay
base Core device tree changes for Linux v3.4 2012-03-21 10:30:03 -07:00
bcma bcma: silence PMU warning for BCM4331 2012-03-07 13:56:37 -05:00
block Merge branch 'kmap_atomic' of git://github.com/congwang/linux 2012-03-21 09:40:26 -07:00
bluetooth Bluetooth: Adding USB device 13d3:3375 as an Atheros AR3012. 2012-03-08 02:16:24 -03:00
cdrom
char Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2012-03-21 13:25:04 -07:00
clk
clocksource Power management updates for 3.4 2012-03-21 10:15:51 -07:00
connector
cpufreq
cpuidle Merge branch 'perf/urgent' into perf/core 2012-03-05 09:20:08 +01:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2012-03-21 13:20:43 -07:00
dca
devfreq PM / devfreq: add relation of recommended frequency. 2012-03-17 21:51:34 +01:00
dio
dma Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
edac edac: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:17 +08:00
eisa
firewire
firmware
gpio
gpu Merge branch 'kmap_atomic' of git://github.com/congwang/linux 2012-03-21 09:40:26 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2012-03-20 21:11:42 -07:00
hv Tools: hv: Support enumeration from all the pools 2012-03-16 13:36:04 -07:00
hwmon hwmon changes for v3.4 2012-03-21 10:37:25 -07:00
hwspinlock
i2c i2c-algo-bit: Fix spurious SCL timeouts under heavy load 2012-03-15 18:11:05 +01:00
ide ide: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:17 +08:00
idle
ieee802154
infiniband InfiniBand/RDMA changes for the 3.4 merge window. Nothing big really 2012-03-21 10:33:42 -07:00
input driver core merge for 3.4-rc1 2012-03-20 11:16:20 -07:00
iommu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
leds
lguest
macintosh Core device tree changes for Linux v3.4 2012-03-21 10:30:03 -07:00
mca
md Merge branch 'kmap_atomic' of git://github.com/congwang/linux 2012-03-21 09:40:26 -07:00
media Merge branch 'kmap_atomic' of git://github.com/congwang/linux 2012-03-21 09:40:26 -07:00
memstick memstick: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:19 +08:00
message
mfd regulator: Updates for 3.4 2012-03-21 10:34:56 -07:00
misc tty and serial merge for 3.4-rc1 2012-03-20 11:24:39 -07:00
mmc Power management updates for 3.4 2012-03-21 10:15:51 -07:00
mtd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
net bonding: remove entries for master_ip and vlan_ip and query devices instead 2012-03-22 22:36:17 -04:00
nfc NFC: Remove the rf mode parameter from the DEP link up routine 2012-03-06 15:16:23 -05:00
nubus
of Core device tree changes for Linux v3.4 2012-03-21 10:30:03 -07:00
oprofile
parisc [PARISC] include <linux/prefetch.h> in drivers/parisc/iommu-helpers.h 2012-02-27 09:44:15 -06:00
parport
pci Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
pcmcia Merge 3.3-rc6 into driver-core-next 2012-03-09 12:35:53 -08:00
pinctrl
platform Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
pnp
power Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
pps pps: class_create() returns an ERR_PTR, not NULL 2012-03-05 15:49:43 -08:00
ps3
ptp phc: Update author's email address. 2012-03-17 01:41:43 -07:00
rapidio rapidio/tsi721: fix bug in register offset definitions 2012-03-15 17:03:03 -07:00
regulator regulator: Updates for 3.4 2012-03-21 10:34:56 -07:00
rtc Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-20 10:32:09 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
sbus
scsi cnic: Fix parity error code conflict 2012-03-21 21:57:36 -04:00
sfi
sh
sn
spi SPI changes for v3.4. 2012-03-21 10:32:00 -07:00
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
staging Merge branch 'kmap_atomic' of git://github.com/congwang/linux 2012-03-21 09:40:26 -07:00
target Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2012-03-21 13:25:04 -07:00
tc
thermal
tty Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-03-20 21:12:50 -07:00
uio
usb USB merge for 3.4-rc1 2012-03-20 11:26:30 -07:00
uwb
vhost vhost: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:21 +08:00
video drivers/video/backlight/s6e63m0.c: fix corruption storing gamma mode 2012-03-15 17:03:04 -07:00
virt
virtio virtio: balloon: leak / fill balloon across S4 2012-03-01 09:28:41 +10:30
vlynq
w1 DS2781 Maxim Stand-Alone Fuel Gauge battery and w1 slave drivers 2012-03-08 11:15:33 -08:00
watchdog watchdog: fix GETTIMEOUT ioctl in booke_wdt 2012-02-29 09:46:13 +01:00
xen Merge branch 'pm-sleep' 2012-03-04 23:11:14 +01:00
zorro
Kconfig
Makefile