I'd wrap each one of net/if.h ,  net/if_ether.h & net/ethernet.h in the appropriate #ifdef