]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fixup the previous commit.
authorDenis Ovsienko <[email protected]>
Sun, 2 Apr 2017 21:43:49 +0000 (21:43 +0000)
committerDenis Ovsienko <[email protected]>
Sun, 2 Apr 2017 21:45:56 +0000 (21:45 +0000)
Add a comment about a minor nit and squelch a compiler warning:

./tcpdump.c:1104:4: warning: implicit declaration of function
'sysctlbyname' is invalid in C99
      [-Wimplicit-function-declaration]
                        sysctlbyname(sysctl, parent, &s, NULL, 0);

tcpdump.c

index b69de64e70e8e6ffa30a181c4c4f472e5af9f899..2ac7757f7a06fd6271447318c4780df9661adb87 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -114,6 +114,10 @@ The Regents of the University of California.  All rights reserved.\n";
 #endif /* HAVE_CAP_NG_H */
 #endif /* HAVE_LIBCAP_NG */
 
+#ifdef __FreeBSD__
+#include <sys/sysctl.h>
+#endif /* __FreeBSD__ */
+
 #include "netdissect.h"
 #include "interface.h"
 #include "addrtoname.h"
@@ -1104,6 +1108,10 @@ open_interface(const char *device, netdissect_options *ndo, char *ebuf)
                        sysctlbyname(sysctl, parent, &s, NULL, 0);
                        strlcpy(newdev, device, sizeof(newdev));
                        /* Suggest a new wlan device. */
+                       /* FIXME: incrementing the index this way is not going to work well
+                        * when the index is 9 or greater but the only consequence in this
+                        * specific case would be an error message that looks a bit odd.
+                        */
                        newdev[strlen(newdev)-1]++;
                        error("%s is not a monitor mode VAP\n"
                            "To create a new monitor mode VAP use:\n"