SamuelYvon / netifaces-2

netifaces reborn
https://pypi.org/project/netifaces2/
MIT License
25 stars 8 forks source link

AF_PACKET confusion #13

Closed SamuelYvon closed 1 year ago

SamuelYvon commented 1 year ago

On some OSes (BSD IIRC) AF_LINK is used for the link layer. On linux, this is exposed through AF_PACKET. The previous netifaces corrected the values based on OS. I am not sure whether to use the same approach of monkeypatching the values based on the platform here, or to create a new, more explicit interface.

martinhoyer commented 1 year ago

AF_LINK is obsolete afaik I see, it's being used in BSD, MacOS.
Not sure what is best, I just switched to AF_PACKET as part of switching to netifaces2. Maybe it's best to just mention it in README next to the default-gateway differences.

SamuelYvon commented 1 year ago

~AF_LINK is obsolete afaik~ I see, it's being used in BSD, MacOS. Not sure what is best, I just switched to AF_PACKET as part of switching to netifaces2. Maybe it's best to just mention it in README next to the default-gateway differences.

I'd tend to agree and get a more "neutral" interface on the side. For users of netifaces2 this would be a breaking change otherwise.

SamuelYvon commented 1 year ago

Mentioned in the readme with commit 3e9367a7aa4313a5dd992a5a0d84555ddadbf470