Closed thediveo closed 6 years ago
Arrrrgh :) Now, if I trick the message encoder as follows (notice the superfluous duplicate with a dummy FD value):
req['attrs'] = [('NETNSA_FD', netnsf.fileno()), ('NETNSA_FD', 0)]
...then the request succeeds and gives me back the expected results!
Bad. Definitively a bug. To be fixed asap.
The issue was not in the NETNSA_FD
per se, but in the rtgenmsg
padding. Fixed.
I'm trying to do a
IPRoute().nlm_request(req, RTM_GETNSID)
. I'm using pyroute2 0.5.0.The request fails with error 22, invalid argument. Strace shows this, indicating that only 25 octets are indicated in the header:
As the FD should be encoded as uint32, I would expect at least three more octets for the FD.
Comparing this to a RTM_GETNSID request from
lsns
I see that the request should have a length of 28.