<The real source for this is the man pages for glibc getifaddrs> When using the uClibc library function getifaddrs, a link list of structures is returned. When walking that list, records with address family AF_PACKET can have associated device statistics returned in a net_device_stats structure, and that data is pointed to with the generic void *ifa_data. glibc defines this struct in <linux/netdevice.h>. This struct definition is missing from uClibc <linux/netdevice.h>. This causes any uClibc client to getifaddrs to have to include their own struct definition.
Workaround: In a application .h: #ifdef __UCLIBC__ struct net_device_stats {unsigned long rx_packets; unsigned long tx_packets; /* and then some... */}; #endif Suggested Solution: Add the struct definition in <linux/netdevice.h> struct net_device_stats { unsigned long rx_packets; /* total packets received */ unsigned long tx_packets; /* total packets transmitted */ unsigned long rx_bytes; /* total bytes received */ unsigned long tx_bytes; /* total bytes transmitted */ unsigned long rx_errors; /* bad packets received */ unsigned long tx_errors; /* packet transmit problems */ unsigned long rx_dropped; /* no space in linux buffers */ unsigned long tx_dropped; /* no space available in linux */ unsigned long multicast; /* multicast packets received */ unsigned long collisions; /* detailed rx_errors: */ unsigned long rx_length_errors; unsigned long rx_over_errors; /* receiver ring buff overflow */ unsigned long rx_crc_errors; /* recved pkt with crc error */ unsigned long rx_frame_errors; /* recv'd frame alignment error */ unsigned long rx_fifo_errors; /* recv'r fifo overrun */ unsigned long rx_missed_errors; /* receiver missed packet */ /* detailed tx_errors */ unsigned long tx_aborted_errors; unsigned long tx_carrier_errors; unsigned long tx_fifo_errors; unsigned long tx_heartbeat_errors; unsigned long tx_window_errors; /* for cslip etc */ unsigned long rx_compressed; unsigned long tx_compressed; };
When using buildroot, uClibc needs to be configured with the UCLIBC_SUPPORT_AI_ADDRCONFIG option (make uclibc-menuconfig, then Networking/Support the AI_ADDRCONFIG flag). This is how support for getifaddrs() and <ifaddrs.h> are made available.
Upstream commit changed <linux/netdevice.h> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be1f3c2c027cc5ad735df6a45a542ed1db7ec48b Seems like I need <linux/if_link.h>, struct rtnl_link_stats instead.