Bug 271613 - net/py-netif: interface flags incorrect, some flags missing
Summary: net/py-netif: interface flags incorrect, some flags missing
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-24 16:58 UTC by hartmut.brandt
Modified: 2024-02-15 23:36 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hartmut.brandt 2023-05-24 16:58:41 UTC
The flags property of the NetworkInterface class produces bogus flags for the upper half of ifru_flags. It looks like it is correctly defined in defs.pxd as short ifru_flags[2]. The __get_flags() method returns just ifru_flags[0] and ignores ifru_flags[1]. Unfortunately the short is sign expanded to uint32_t which gives a bogus return value for the flags property.

I was not able to fix that. It looks like ifru_flags[1] reads always as 0. So with correctly casting and adding the words, all the upper bits are 0.

There are also some flags missing which are defined in 14: IFF_NOGROUP and IFF_NETLINK_1, IFF_NEEDSEPOCH, IFF_STICKYARP.
Comment 1 Mina Galić freebsd_triage 2023-05-24 18:34:15 UTC
that's a very thorough analysis! 
could you report this upstream? https://github.com/truenas/py-netif
Comment 2 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2024-02-15 23:36:32 UTC
Looks like this is more or less a dead project.