diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-01-25 12:12:27 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-01-25 12:12:27 -0800 |
commit | 0134e333b94d846cb9eff6e96d07c72dc636afbf (patch) | |
tree | 07dc0ad385c661421825d762d66628b02a506a9c /fad-glifc.c | |
parent | 98e570c4d9708e46033a6545690ced67cca6f0cb (diff) |
Split out the UN*X flags to pcap flags mapping.
Add an if_flags_to_pcap_flags() routine to map the interface name (if
necessary) and IFF_ flags to PCAP_IF_ flags, and call that in the
platform-specific routines. That means that the calls to add to the
interface list don't need to use IFF_ flags, which are UN*Xisms.
Move the routines that update the interface list to fad-helpers.c,
leaving just the legacy APIs in inet.c.
Update finalldevstest to print out all the flags.
Diffstat (limited to 'fad-glifc.c')
-rw-r--r-- | fad-glifc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fad-glifc.c b/fad-glifc.c index af3e1dea..9107b44e 100644 --- a/fad-glifc.c +++ b/fad-glifc.c @@ -341,7 +341,8 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf) * Add information for this address to the list. */ if (add_addr_to_iflist(&devlist, ifrp->lifr_name, - ifrflags.lifr_flags, (struct sockaddr *)&ifrp->lifr_addr, + if_flags_to_pcap_flags(ifrp->lifr_name, ifrflags.lifr_flags), + (struct sockaddr *)&ifrp->lifr_addr, sizeof (struct sockaddr_storage), netmask, sizeof (struct sockaddr_storage), broadaddr, sizeof (struct sockaddr_storage), |