]> git.proxmox.com Git - mirror_frr.git/commit - zebra/kernel_socket.c
build: check actually-used BSD link state fields
authorDoug VanLeuven <roamdad@sonic.net>
Wed, 10 Oct 2012 23:12:32 +0000 (16:12 -0700)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 5 Nov 2012 16:22:24 +0000 (11:22 -0500)
commit9234b382735b690f403ce018ce392316b2ad6e38
tree291a65a85584a3435453676bd8ed1ab0f70123ab
parenta05df8fd279e4af0f077de181fb6c4e7d7174267
build: check actually-used BSD link state fields

ifi_link_state missing in OS X. There could be other *BSD's that haven't
implemented it and possibly affects older implementations.

The existing HAVE_BSD_LINK_DETECT configure.ac check is only confirming
the link state detection using ifmediareq.ifm_status found in
<net/if_media.h>. This is the link state detection used in
zebra/ioctl.c. Later, *BSD redefined struct if_data in <net/if.h> and
included link state detection. This is the method used in
zebra/kernel_socket.c

Additional test defined in config.ac to test for member struct
if_data.ifi_link_state defined in <net/if.h> separate from test for
<net/if_media.h> ifmediareq.ifm_status

Fixed #ifdef's in zebra/kernel_socket.c to use the new #define
No impact on older function calls in zebra/ioctl.c

Tested on 64bit OS X 10.7, FreeBSD 9.0 amd64 & i386 (32bit)
using gcc & clang. Tested on linux 64bit.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
configure.ac
zebra/kernel_socket.c