-
CarterLiHello all! I have a question about querying network interface of default route in C.
-
CarterLiThis is what I did: github.com/fastfetch-cli/fastfetch/…common/netif/netif_apple.c#L66-L106
-
CarterLiIt compiles. However, when I ran it, I got a rtmsg_hdr result with rtm_flags equals to 0x80041
-
CarterLi0x80041 is (RTF_KERNEL | RTF_DONE | RTF_UP), while I did asks for (RTF_UP | RTF_GATEWAY)
-
CarterLiThis is what I asked: github.com/fastfetch-cli/fastfetch/…/src/common/netif/netif_apple.c#L85
-
CarterLiI got the result at: github.com/fastfetch-cli/fastfetch/…src/common/netif/netif_apple.c#L103
-
CarterLiThis test failed: github.com/fastfetch-cli/fastfetch/…src/common/netif/netif_apple.c#L106
-
CarterLiSo everything failed. Does anyone know what I did wrong?
-
CarterLiThe same code works for macOS, and the similar code even works for IPv6. It just fails for IPv4. It's really strange.
-
CarterLiIf this is not a right place to ask this kind of thing. Does anyone know where I should ask it?
-
CarterLiLooks like I'm wasting of time. Bye!
-
sommerfeldCarterLi: in case you're reading the logs, this is the right place to ask, but you may need to wait more than a few minutes for an answer.
-
sommerfeldCarterLi: you're not wasting time, you're just asking when someone who can answer isn't awake.
-
sommerfeld"route get default" on my systems shows flags: <UP,GATEWAY,DONE,STATIC>
-
sommerfeldthe system "route get" sets RTF_STATIC|RTF_GATEWAY in flags and RTA_DST|RTA_NETMASK|RTA_IFP in rtm_addr