]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: fix bind address validity regression tests
authorRiccardo Paolo Bestetti <pbl@bestov.io>
Sun, 19 Jun 2022 16:27:35 +0000 (18:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Jun 2022 08:58:12 +0000 (09:58 +0100)
commit26a6e1c64904656a60d1f763e1bf4a9b74bf6fc9
tree402ca7acdf073d41fd46d34ee62233da5d214edd
parent3613bbe15448f805e93ec47c1ad274e98fd1c827
ipv4: fix bind address validity regression tests

Commit 0b32c5f3f0c7 ("ipv4/raw: support binding to nonlocal addresses")
introduces support for binding to nonlocal addresses, as well as some
basic test coverage for some of the related cases.

Commit 9e0535b38d7f ("ipv4: ping: fix bind address validity check")
fixes a regression which incorrectly removed some checks for bind
address validation. In addition, it introduces regression tests for
those specific checks. However, those regression tests are defective, in
that they perform the tests using an incorrect combination of bind
flags. As a result, those tests fail when they should succeed.

This commit introduces additional regression tests for nonlocal binding
and fixes the defective regression tests. It also introduces new
set_sysctl calls for the ipv4_bind test group, as to perform the ICMP
binding tests it is necessary to allow ICMP socket creation by setting
the net.ipv4.ping_group_range knob.

Fixes: 9e0535b38d7f ("ipv4: ping: fix bind address validity check")
Reported-by: Riccardo Paolo Bestetti <pbl@bestov.io>
Signed-off-by: Riccardo Paolo Bestetti <pbl@bestov.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/fcnal-test.sh