NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/58243: ifconfig from NetBSD 5.0 does not work under compat (getifaddrs(3) problem?)



>Number:         58243
>Category:       kern
>Synopsis:       ifconfig from NetBSD 5.0 does not work under compat (getifaddrs(3) problem?)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 11 10:40:00 +0000 2024
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.10
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD seven-days-to-the-wolves.aprisoft.de 10.99.10 NetBSD 10.99.10 (GENERIC) #707: Sat May 11 12:23:30 CEST 2024 martin%seven-days-to-the-wolves.aprisoft.de@localhost:/work/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:

While testing compatibility of old ifconfig binaries for other reasons recently
I noticed that this does not work:

On a amd64 machine running a very current GENERIC kernel (which enables all
compat built-in):

 - extract base.tgz for NetBSD 5.0 amd64 and i386 releases (into separate
   directories)

 - chroot into one of those extracted directories (the effect is the same
   for both)

 - inside the chroot try to run ifconfig by doing:

	/sbin/ifconfig -a
	/sbin/ifconfig lo0

and notice no output (or just an empty line). Ktracing shows that some ioctls
actually work and return e.g. the ifflags for lo0, but nothing is printed.

My hypothesis is that getifaddrs(3) does not work - either by failing (but
that should provoke error output), or by returning and empty list (it uses
a sysctl internally, for that likely no compat code exists and maybe even
there is no infrastructure to provide that based on the binaries version),
or the "list" returned by the sysctl uses different padding than what the
old binaries expect.

This might be a known effect (I have dim memories but couldn't find any
official statement quickly) and not be worth fixing, but Paul asked me to
file a PR so we can collect details and decide whether a fix is usefull
or reasonable.

>How-To-Repeat:
s/a

>Fix:
n/a (not sure it is possible to fix)



Home | Main Index | Thread Index | Old Index