johnyburd / net-route

Rust crate providing a cross platform interface for interacting with the routing table
https://docs.rs/net-route/
17 stars 12 forks source link

Why doesn't macOS directly use rt_msghdr->rtm_index as the interface index? #16

Closed Skyxim closed 7 months ago

Skyxim commented 8 months ago

I'm new to this, but it seems like rt_msghdr->rtm_index in macOS is the interface index I want to get the actual interface used by each route, just like netstat -nr

I used Go before and it did the same thing https://cs.opensource.google/go/x/net/+/master:route/route_classic.go;drc=d23d9bc549229fd1a9d375dc91141fcf1385d257;l=47

johnyburd commented 7 months ago

Completed in #19 by @gregor-netdebug 👍