Question: Could someone please explain to me why getifaddrs returns the same interface once with AF\_PACKET and second AF\_INET as two different interfaces?

When it is AF\_PACKET the MAC address can be obtain by doing a cast to sockaddr\_ll. However this struct has 20 bytes while the sockaddr\_in 16. Why is this cast safe?

Thanks,

Answer: 
This issue needs kernel config changes. 

1. For /dev/mem disable config **DEVMEM**
2. For /dev/kmem disable config **DEVKMEM**
Add these two lines in your config files

+# CONFIG\_DEVMEM is not set

+# CONFIG\_DEVKMEM is not set