Skip to contentSkip to conversation

ip6_dst_dev for IPv4

DISCUSSION Mattias Rönnblom 1 participant 1 message Mar 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I'm implemeting per-interface SNMP-style network statistics for IPv4, just like what already exists in the current kernel for IPv6 (/proc/net/dev_snmp6).

For output packets one needs to determine the output interface, and the v6 statistics uses the ip6_dst_idev() function (ip6_fib.h). I can't seem to find a corresponding function for IPv4. Is there?

Would someting like:
struct in_device* out_dev = in_dev_get(skb_dst(skb)->dev); work?

Best regards,
Mattias