Bug 26546

Summary: Add ioctl support to linux emulation and permit ethX syntax
Product: Base System Reporter: Doug Ambrisko <ambrisko>
Component: kernAssignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Doug Ambrisko 2001-04-13 23:20:01 UTC
	Running the Cisco binary only Aironet configuration tool only
	talks to "eth<d>" devices.  Since this is in the binary we 
	can't change it.  So I added a mapping function in the 
	emulation that iterates through the hardware ethernet 
	devices and use the number in "eth<d>" to count the iteration.

	Interesting side effect is that if you have a Linux version of
	ifconfig on your machine you can do ifconfig eth0 and it will
	work.

	I put this in a funtion to isolate the interface scan if
	it saw an interface argument of "eth" type.  The substition
	is then done for the real FreeBSD interface and then the
	FreeBSD ioctl is called.  When the FreeBSD ioctl returns
	it restores the original interface name and returns the 
	result.

	I also implement to "Device Private" ioctls that the Cisco
	utility uses to talk to the Aironet driver.

	With this and my Aironet changes you can run the configuration
	binaries from Cisco for Linux and do things like upgrade the
	firmware on the card and things like that.
Comment 1 Bill Fenner 2001-06-14 01:16:13 UTC
What do you think about:

- using strtoul(), to allow more than 10 eth%d's.
- The value could be the ifindex (won't change if a dynamic interface in
the middle of the list is deleted); you can then also use
ifindex2ifnet[index] (if index < if_index) instead of walking ifnet.

Advantages of using ifindex: mapping is known-map "Link#X" in netstat
-ni to "ethX", mapping doesn't change, O(1) to find the right ifnet
Disadvantage of using ifindex: you don't get to skip P2P, loopback and
non-broadcast interfaces in the mapping.
Comment 2 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-06-14 18:23:49 UTC
Responsible Changed
From-To: freebsd-bugs->des

I'll take this one.
Comment 3 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-10-15 21:52:25 UTC
State Changed
From-To: open->analyzed

Partial fix committed, more work remains to be done.
Comment 4 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-11-27 13:43:51 UTC
State Changed
From-To: analyzed->closed

Similar functionality (and more) has been added to -CURRENT and -STABLE.