summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ioctl.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2001-09-14 08:04:25 +0000
committermarcel <marcel@FreeBSD.org>2001-09-14 08:04:25 +0000
commitc7273783389ef486b17288ac2c28fa2dc4cbba50 (patch)
tree22be92fdd9e7a4a1cbf07b31bf232d373089e77a /sys/compat/linux/linux_ioctl.c
parentb6aaff7afb3a3e36dfed293ee78b59da76e23715 (diff)
downloadFreeBSD-src-c7273783389ef486b17288ac2c28fa2dc4cbba50.zip
FreeBSD-src-c7273783389ef486b17288ac2c28fa2dc4cbba50.tar.gz
Fix off by one error introduced by the use of the ifnet_byindex()
macro. The commit log clearly states that the index given to the macro is one higher than previously used to index the array. This wasn't represented in the code and resulted in kernel page faults. Reported by: Andrew Atrens <atrens@nortelnetworks.com>
Diffstat (limited to 'sys/compat/linux/linux_ioctl.c')
-rw-r--r--sys/compat/linux/linux_ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index ab80494..73d5390 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -1385,7 +1385,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args)
* structure, as Linux interface names are all different.
*/
for (ifn = 0; ifn < if_index; ifn++) {
- ifp = ifnet_byindex(ifn);
+ ifp = ifnet_byindex(ifn + 1);
if (ifp->if_type == IFT_ETHER) {
ifa = TAILQ_FIRST(&ifp->if_addrhead);
while (ifa) {
OpenPOWER on IntegriCloud