linux/drivers
Jie Wang 4e5bd03ae3 net: bonding: fix bond_xmit_broadcast return value error bug
In Linux bonding scenario, one packet is copied to several copies and sent
by all slave device of bond0 in mode 3(broadcast mode). The mode 3 xmit
function bond_xmit_broadcast() only ueses the last slave device's tx result
as the final result. In this case, if the last slave device is down, then
it always return NET_XMIT_DROP, even though the other slave devices xmit
success. It may cause the tx statistics error, and cause the application
(e.g. scp) consider the network is unreachable.

For example, use the following command to configure server A.

echo 3 > /sys/class/net/bond0/bonding/mode
ifconfig bond0 up
ifenslave bond0 eth0 eth1
ifconfig bond0 192.168.1.125
ifconfig eth0 up
ifconfig eth1 down
The slave device eth0 and eth1 are connected to server B(192.168.1.107).
Run the ping 192.168.1.107 -c 3 -i 0.2 command, the following information
is displayed.

PING 192.168.1.107 (192.168.1.107) 56(84) bytes of data.
64 bytes from 192.168.1.107: icmp_seq=1 ttl=64 time=0.077 ms
64 bytes from 192.168.1.107: icmp_seq=2 ttl=64 time=0.056 ms
64 bytes from 192.168.1.107: icmp_seq=3 ttl=64 time=0.051 ms

 192.168.1.107 ping statistics
0 packets transmitted, 3 received

Actually, the slave device eth0 of the bond successfully sends three
ICMP packets, but the result shows that 0 packets are transmitted.

Also if we use scp command to get remote files, the command end with the
following printings.

ssh_exchange_identification: read: Connection timed out

So this patch modifies the bond_xmit_broadcast to return NET_XMIT_SUCCESS
if one slave device in the bond sends packets successfully. If all slave
devices send packets fail, the discarded packets stats is increased. The
skb is released when there is no slave device in the bond or the last slave
device is down.

Fixes: ae46f184bc ("bonding: propagate transmit status")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-01-12 14:46:39 +00:00
..
accessibility
acpi Power management updates for 5.17-rc1 2022-01-10 20:34:00 -08:00
amba
android binder: fix async_free_space accounting for empty parcels 2021-12-21 11:07:34 +01:00
ata libata: if T_LENGTH is zero, dma direction should be DMA_NONE 2021-12-17 09:32:13 +09:00
atm
auxdisplay auxdisplay: charlcd: checking for pointer reference before dereferencing 2021-11-24 11:46:52 +01:00
base Device properties framework updates for 5.17-rc1 2022-01-10 20:48:19 -08:00
bcma pci-v5.16-changes 2021-11-06 14:36:12 -07:00
block xen/blkfront: harden blkfront against event channel storms 2021-12-16 08:24:08 +01:00
bluetooth Bluetooth: btqca: sequential validation 2022-01-07 08:32:55 +01:00
bus ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
cdrom for-5.16/cdrom-2021-10-29 2021-11-01 10:09:14 -07:00
char drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
clk drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
clocksource clocksource/drivers/arm_arch_timer: Force inlining of erratum_set_next_event_generic() 2021-12-10 17:47:00 +01:00
comedi comedi: dt9812: fix DMA buffers on stack 2021-10-30 10:54:47 +02:00
connector
counter
cpufreq cpufreq: amd-pstate: Fix Kconfig dependencies for AMD P-State 2022-01-06 18:31:33 +01:00
cpuidle cpuidle: use default_groups in kobj_type 2022-01-05 18:31:17 +01:00
crypto s390 updates for 5.17 merge window 2022-01-10 08:58:16 -08:00
cxl cxl for v5.16 2021-11-08 11:49:48 -08:00
dax
dca
devfreq PM / devfreq: Reduce log severity for informative message 2021-12-16 11:29:54 +09:00
dio
dma dmaengine: st_fdma: fix MODULE_ALIAS 2021-12-13 13:18:48 +05:30
dma-buf Linux 5.16-rc5 2021-12-14 10:24:28 +01:00
edac - Add support for version 3 of the Synopsys DDR controller to synopsys_edac 2022-01-10 11:45:23 -08:00
eisa
extcon
firewire SCSI misc on 20211105 2021-11-05 08:42:02 -07:00
firmware ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
fpga
fsi
gnss
gpio gpio: gpio-aspeed-sgpio: Fix wrong hwirq base in irq handler 2022-01-03 10:50:12 +01:00
gpu Revert "drm/amd/display: Fix for otg synchronization logic" 2022-01-10 18:50:10 -08:00
greybus
hid HID: potential dereference of null pointer 2021-12-20 11:26:14 +01:00
hsi HSI changes for the 5.16 series 2021-11-04 13:56:55 -07:00
hv random: remove unused irq_flags argument from add_interrupt_randomness() 2022-01-07 00:25:25 +01:00
hwmon hwmon: (lm90) Do not report 'busy' status bit as alarm 2021-12-12 16:22:53 -08:00
hwspinlock
hwtracing
i2c ACPI updates for 5.17-rc1 2022-01-10 20:26:56 -08:00
i3c
idle
iio iio: trigger: stm32-timer: fix MODULE_ALIAS 2021-12-04 15:37:02 +00:00
infiniband Networking changes for 5.17. 2022-01-10 19:06:09 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2022-01-09 10:49:12 -08:00
interconnect
iommu s390/pci: use physical addresses in DMA tables 2021-12-06 14:42:26 +01:00
ipack
irqchip irqchip/irq-bcm7120-l2: Add put_device() after of_find_device_by_node() 2021-12-10 13:23:13 +00:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-30 12:12:12 -08:00
leds
macintosh Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
mailbox mailbox: imx: support i.MX8ULP S4 MU 2021-10-29 23:03:09 -05:00
mcb
md block-5.16-2022-01-07 2022-01-07 13:28:20 -08:00
media media: ipu3-cio2: Add support for instantiating i2c-clients for VCMs 2021-12-16 20:58:56 +01:00
memory ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
memstick
message pci-v5.16-changes 2021-11-06 14:36:12 -07:00
mfd chrome platform changes for 5.16 2021-11-10 11:36:43 -08:00
misc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-16 16:13:19 -08:00
mmc Power management updates for 5.17-rc1 2022-01-10 20:34:00 -08:00
most
mtd ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
mux
net net: bonding: fix bond_xmit_broadcast return value error bug 2022-01-12 14:46:39 +00:00
nfc nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION 2022-01-12 14:17:45 +00:00
ntb
nubus
nvdimm libnvdimm for v5.16 2021-11-10 10:56:02 -08:00
nvme nvmet-tcp: fix possible list corruption for unexpected command failure 2021-12-08 16:36:58 +01:00
nvmem
of Merge drm/drm-next into drm-misc-next 2021-12-16 14:48:27 +01:00
opp
parisc
parport
pci Device properties framework updates for 5.17-rc1 2022-01-10 20:48:19 -08:00
pcmcia pcmcia: hide the MAC address helpers if !NET 2021-11-22 14:02:52 +00:00
perf drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check 2022-01-04 13:58:17 +00:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-16 16:13:19 -08:00
pinctrl SoC: Add support for StarFive JH7100 RISC-V SoC 2022-01-10 08:32:37 -08:00
platform media updates for v5.17-rc1 2022-01-10 18:55:43 -08:00
pnp
power power: reset: ltc2952: Fix use of floating point literals 2021-11-16 15:22:39 +01:00
powercap Merge back earlier power capping changes for v5.17 2021-12-27 16:51:12 +01:00
pps
ps3
ptp net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets 2022-01-06 12:18:08 +00:00
pwm drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
rapidio rapidio: avoid bogus __alloc_size warning 2021-11-06 13:30:33 -07:00
ras RAS/CEC: Remove a repeated 'an' in a comment 2021-12-11 11:55:27 +01:00
regulator - Remove Drivers 2021-11-08 12:07:52 -08:00
remoteproc
reset SoC: Add support for StarFive JH7100 RISC-V SoC 2022-01-10 08:32:37 -08:00
rpmsg remoteproc updates for v5.16 2021-11-10 09:07:26 -08:00
rtc RTC for 5.16 2021-11-12 11:44:31 -08:00
s390 Networking changes for 5.17. 2022-01-10 19:06:09 -08:00
sbus
scsi SCSI fixes on 20211231 2021-12-31 09:22:25 -08:00
sh
siox
slimbus
soc ARM: SoC devicetree changes for v5.17 2022-01-10 08:24:40 -08:00
soundwire
spi ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
spmi
ssb
staging Device properties framework updates for 5.17-rc1 2022-01-10 20:48:19 -08:00
target scsi: target: configfs: Delete unnecessary checks for NULL 2021-11-18 23:07:02 -05:00
tc
tee ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
thermal Thermal control updates for 5.17-rc1 2022-01-10 20:43:54 -08:00
thunderbolt
tty ACPI updates for 5.17-rc1 2022-01-10 20:26:56 -08:00
uio Drivers: hv: vmbus: Mark vmbus ring buffer visible to host in Isolation VM 2021-10-28 11:22:23 +00:00
usb ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
vdpa vdpa: Consider device id larger than 31 2021-12-08 15:41:50 -05:00
vfio vfio/pci: Fix OpRegion read 2021-11-30 11:41:49 -07:00
vhost vdpa: check that offsets are within bounds 2021-12-08 14:53:15 -05:00
video drm for 5.17-rc1 2022-01-10 12:58:46 -08:00
virt nitro_enclaves: Use get_user_pages_unlocked() call to handle mmap assert 2021-12-21 11:08:19 +01:00
virtio virtio_ring: Fix querying of maximum DMA mapping size for virtio device 2021-12-08 15:04:06 -05:00
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.16-rc1 tag 2021-11-10 09:41:22 -08:00
xen xen/console: harden hvc_xen against event channel storms 2021-12-16 08:24:08 +01:00
zorro
Kconfig
Makefile virtio: always enter drivers/virtio/ 2021-12-08 14:53:15 -05:00