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 /pcap-linux.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 'pcap-linux.c')
-rw-r--r-- | pcap-linux.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index b1e31281..3cfe5686 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -2274,7 +2274,8 @@ add_linux_if(pcap_if_t **devlistp, const char *ifname, int fd, char *errbuf) /* * Add an entry for this interface, with no addresses. */ - if (pcap_add_if(devlistp, name, ifrflags.ifr_flags, NULL, + if (pcap_add_if(devlistp, name, + if_flags_to_pcap_flags(name, ifrflags.ifr_flags), NULL, errbuf) == -1) { /* * Failure. @@ -2533,7 +2534,7 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf) /* * Add the "any" device. */ - if (pcap_add_if(alldevsp, "any", IFF_UP|IFF_RUNNING, + if (pcap_add_if(alldevsp, "any", PCAP_IF_UP|PCAP_IF_RUNNING, any_descr, errbuf) < 0) return (-1); |