Skip to content
Commit 313c502f authored by Riccardo Paolo Bestetti's avatar Riccardo Paolo Bestetti Committed by David S. Miller
Browse files

ipv4: fix bind address validity regression tests

Commit 8ff978b8 ("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 b4a028c4 ("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: b4a028c4

 ("ipv4: ping: fix bind address validity check")
Reported-by: default avatarRiccardo Paolo Bestetti <pbl@bestov.io>
Signed-off-by: default avatarRiccardo Paolo Bestetti <pbl@bestov.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9926de73
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment