mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix local IP address validation
Previously bf9886a84393d1d1546db7e49b102e08a16a83e7 match_local has undesirable side effect that CheckedIPAddress object has set self._net from local interface. However with the recent changes, match_local is usually set to False, thus this side effect stops happening and default mask per address class is used. This causes validation error because mask on interface and mask used for provided IP addresses differ (reporducible only with classless masks). FreeIPA should compare only IP addresses with local addresses without masks https://pagure.io/freeipa/issue/4317 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
committed by
David Kupka
parent
bee3c1eccd
commit
82ad586f6c
@@ -216,10 +216,10 @@ class CheckedIPAddress(UnsafeIPAddress):
|
||||
addr=ifaddr,
|
||||
netmask=ifdata['netmask']
|
||||
))
|
||||
if ifnet == self._net or (
|
||||
self._net is None and ifnet.ip == self):
|
||||
self._net = ifnet
|
||||
|
||||
if ifnet.ip == self:
|
||||
iface = interface
|
||||
self._net = ifnet
|
||||
break
|
||||
|
||||
return iface
|
||||
|
||||
Reference in New Issue
Block a user