pyroute2
pyroute2 copied to clipboard
Regression in IPRoute.neigh when ext_ack + strict_check are enabled
Hello,
I'm currently not sure of what really happens, but after a pyroute2 upgrade I got a regression on neighbours dump:
ipr = IPRoute(strict_check=True, ext_ack=True)
ipr.neigh("dump", family=2)
=> NetlinkError: (22, 'Invalid values in header for neighbor dump request')
I don't have time today to debug deeper. But since I saw a recent refactoring on this method, it has perhaps a link with this issue.
Is it the master branch?
Found the commit: 9967caef4e5be365a5a0bac3950a5804554af45e
@svinota good catch, thanks! So relevant part is now in file pyroute2.core/pr2modules/iproute/req.py
:
class IPNeighRequest(IPRequest):
def fix_request(self):
if 'nud' in self:
self['state'] = self.pop('nud')
log.warning('use `state` instead of `nud`')
if 'state' not in self:
self['state'] = NUD_PERMANENT
if 'dst' in self and 'family' not in self:
self['family'] = get_address_family(self['dst'])
if isinstance(self['state'], basestring):
self['state'] = ndmsg.states_a2n(self['state'])
if 'family' not in self:
self['family'] = AF_INET
We should not set NUD_PERMANENT for dump requests. I'm not familiar with this new req module, what is the best way for you to fix this?
I'm to fix that tonight, just changed the req
module to make possible such discrimination.
Tests will follow tomorrow