summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_core_main.c
diff options
context:
space:
mode:
authorJulian Wiedmann2018-02-27 18:58:16 +0100
committerDavid S. Miller2018-02-28 17:13:12 +0100
commitc5c48c58b259bb8f0482398370ee539d7a12df3e (patch)
tree2f6e52ac57824c75f52a3f3912521bcda9d1ed69 /drivers/s390/net/qeth_core_main.c
parentRevert "s390/qeth: fix using of ref counter for rxip addresses" (diff)
downloadkernel-qcow2-linux-c5c48c58b259bb8f0482398370ee539d7a12df3e.tar.gz
kernel-qcow2-linux-c5c48c58b259bb8f0482398370ee539d7a12df3e.tar.xz
kernel-qcow2-linux-c5c48c58b259bb8f0482398370ee539d7a12df3e.zip
s390/qeth: fix IP address lookup for L3 devices
Current code ("qeth_l3_ip_from_hash()") matches a queried address object against objects in the IP table by IP address, Mask/Prefix Length and MAC address ("qeth_l3_ipaddrs_is_equal()"). But what callers actually require is either a) "is this IP address registered" (ie. match by IP address only), before adding a new address. b) or "is this address object registered" (ie. match all relevant attributes), before deleting an address. Right now 1. the ADD path is too strict in its lookup, and eg. doesn't detect conflicts between an existing NORMAL address and a new VIPA address (because the NORMAL address will have mask != 0, while VIPA has a mask == 0), 2. the DELETE path is not strict enough, and eg. allows del_rxip() to delete a VIPA address as long as the IP address matches. Fix all this by adding helpers (_addr_match_ip() and _addr_match_all()) that do the appropriate checking. Note that the ADD path for NORMAL addresses is special, as qeth keeps track of how many times such an address is in use (and there is no immediate way of returning errors to the caller). So when a requested NORMAL address _fully_ matches an existing one, it's not considered a conflict and we merely increment the refcount. Fixes: 5f78e29ceebf ("qeth: optimize IP handling in rx_mode callback") Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core_main.c')
0 files changed, 0 insertions, 0 deletions