diff options
author | allfro <ndouba@gmail.com> | 2013-09-18 22:04:56 -0400 |
---|---|---|
committer | allfro <ndouba@gmail.com> | 2013-09-18 22:04:56 -0400 |
commit | 651af979838fe13dae59db57ee943e29dddbd7de (patch) | |
tree | a0b6bb7d75bdf8a98895fb1a0e8b6fc3b27502e1 | |
parent | 6abfd26cc3da1d36c23071f458d5eff85489647b (diff) | |
download | libnet-651af979838fe13dae59db57ee943e29dddbd7de.tar.gz |
Fix build error in Mac OS X
The IFT_FASTETHER, IFT_FASTETHERFX, IFT_GIGABITETHERNET constants are not defined in Mac OS X Mountain Lion. Only IFT_ETHER and IFT_L2VLAN are. This patch checks for the existence of these definitions.
-rw-r--r-- | libnet/src/libnet_link_bpf.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libnet/src/libnet_link_bpf.c b/libnet/src/libnet_link_bpf.c index ec88546..ea762f9 100644 --- a/libnet/src/libnet_link_bpf.c +++ b/libnet/src/libnet_link_bpf.c @@ -315,9 +315,16 @@ libnet_get_hwaddr(libnet_t *l) { sdl = (struct sockaddr_dl *)(ifm + 1); if (sdl->sdl_type != IFT_ETHER +#ifdef IFT_FASTETHER && sdl->sdl_type != IFT_FASTETHER +#endif +#ifdef IFT_FASTETHERFX && sdl->sdl_type != IFT_FASTETHERFX +#endif +#ifdef IFT_GIGABITETHERNET && sdl->sdl_type != IFT_GIGABITETHERNET +#endif + && sdl->sdl_type != IFT_L2VLAN) continue; if (strncmp(&sdl->sdl_data[0], l->device, sdl->sdl_nlen) == 0) |