aboutsummaryrefslogtreecommitdiff
path: root/pcap-linux.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-11-08 20:01:00 -0800
committerGuy Harris <guy@alum.mit.edu>2019-11-08 20:01:00 -0800
commitee86e4a5300baa0b85544fde82ce34ee3dfd7c48 (patch)
tree8c1c9626a2f044f39a8ec69906ef37e1fa5b6711 /pcap-linux.c
parentca73e1eb38426d78f72a574774008f9d9fc179aa (diff)
Get rid of a no-longer-used routine.
Diffstat (limited to 'pcap-linux.c')
-rw-r--r--pcap-linux.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index 444d509c..32f016bc 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -2212,77 +2212,6 @@ pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats)
return 0;
}
-static int
-add_linux_if(pcap_if_list_t *devlistp, const char *ifname, int fd, char *errbuf)
-{
- const char *p;
- char name[512]; /* XXX - pick a size */
- char *q, *saveq;
- struct ifreq ifrflags;
-
- /*
- * Get the interface name.
- */
- p = ifname;
- q = &name[0];
- while (*p != '\0' && *p != ' ' && *p != '\t' && *p != '\n') {
- if (*p == ':') {
- /*
- * This could be the separator between a
- * name and an alias number, or it could be
- * the separator between a name with no
- * alias number and the next field.
- *
- * If there's a colon after digits, it
- * separates the name and the alias number,
- * otherwise it separates the name and the
- * next field.
- */
- saveq = q;
- while (PCAP_ISDIGIT(*p))
- *q++ = *p++;
- if (*p != ':') {
- /*
- * That was the next field,
- * not the alias number.
- */
- q = saveq;
- }
- break;
- } else
- *q++ = *p++;
- }
- *q = '\0';
-
- /*
- * Get the flags for this interface.
- */
- pcap_strlcpy(ifrflags.ifr_name, name, sizeof(ifrflags.ifr_name));
- if (ioctl(fd, SIOCGIFFLAGS, (char *)&ifrflags) < 0) {
- if (errno == ENXIO || errno == ENODEV)
- return (0); /* device doesn't actually exist - ignore it */
- pcap_fmt_errmsg_for_errno(errbuf, PCAP_ERRBUF_SIZE,
- errno, "SIOCGIFFLAGS: %.*s",
- (int)sizeof(ifrflags.ifr_name),
- ifrflags.ifr_name);
- return (-1);
- }
-
- /*
- * Add an entry for this interface, with no addresses, if it's
- * not already in the list.
- */
- if (find_or_add_if(devlistp, name, ifrflags.ifr_flags,
- get_if_flags, errbuf) == NULL) {
- /*
- * Failure.
- */
- return (-1);
- }
-
- return (0);
-}
-
/*
* Description string for the "any" device.
*/