From 29e0d65d7a6bff9008cdb2f72b29e91aad1a99f8 Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Fri, 16 Jan 2015 10:09:28 +0000 Subject: [PATCH] Eliminate SIOCGIFADDR handling in bpf. Quoting 19 years bpf.4 manual from bpf-1.2a1: " (SIOCGIFADDR is obsolete under BSD systems. SIOCGIFCONF should be used to query link-level addresses.) " * SIOCGIFADDR was not imported in NetBSD (bpf.c 1.36) and OpenBSD. * Last bits (e.g. manpage claiming SIOCGIFADDR exists) was cleaned from NetBSD via kern/21513 5 years ago, from OpenBSD via documentation/6352 5 years ago. --- share/man/man4/bpf.4 | 2 -- sys/net/bpf.c | 14 -------------- 2 files changed, 16 deletions(-) diff --git a/share/man/man4/bpf.4 b/share/man/man4/bpf.4 index 072f8e099f42..01cd0eaef7db 100644 --- a/share/man/man4/bpf.4 +++ b/share/man/man4/bpf.4 @@ -290,8 +290,6 @@ and .Pp In addition to .Dv FIONREAD -and -.Dv SIOCGIFADDR , the following commands may be applied to any open .Nm file. diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 156153953498..a04fdef436f4 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1192,7 +1192,6 @@ reset_d(struct bpf_d *d) /* * FIONREAD Check for read packet available. - * SIOCGIFADDR Get interface address - convenient hook to driver. * BIOCGBLEN Get buffer len [for read()]. * BIOCSETF Set read filter. * BIOCSETFNR Set read filter without resetting descriptor. @@ -1322,19 +1321,6 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, break; } - case SIOCGIFADDR: - { - struct ifnet *ifp; - - if (d->bd_bif == NULL) - error = EINVAL; - else { - ifp = d->bd_bif->bif_ifp; - error = (*ifp->if_ioctl)(ifp, cmd, addr); - } - break; - } - /* * Get buffer len [for read()]. */