1

There's a problem with a device being listed twice with the same hardware port name which is causing a lot of trouble since the OS X configuration utilities (both GUI System Preferences and command-line tool networksetup) rely on the method SCNetworkInterfaceRef _SCNetworkInterfaceCreateWithEntity which tries to get an interface by its name but bails if the array matching_interfaces contains more than one device.

Issuing networksetup -listallhardwareports returns the following output:

Hardware Port: H5321 gw
Device: usbmodem
Ethernet Address: N/A

Hardware Port: H5321 gw
Device: usbmodem
Ethernet Address: N/A

Hardware Port: PCI Serial Adapter (22)
Device: pci-serial22
Ethernet Address: N/A

Hardware Port: H5321 gw
Device: wwan
Ethernet Address: N/A

Hardware Port: Ethernet
Device: en0
Ethernet Address: 28:d2:44:05:79:1c

Hardware Port: H5321 gw
Device: en1
Ethernet Address: 02:15:e0:ec:01:00

Hardware Port: 802.11n WLAN Adapter
Device: en2
Ethernet Address: 00:87:23:7a:44:9d

Hardware Port: Bluetooth PAN
Device: en3
Ethernet Address: f4:b7:e2:e8:4f:78

The culprit in this case is the interface usbmodem. While

ls /dev | grep usbmodem

lists the two entities by seperate names (the number of the second one changes upon restart)

cu.usbmodem
cu.usbmodem5
tty.usbmodem
tty.usbmodem5

the network setup utility is pointing out the problem - the same hardware port name being used twice.

All methods which rely on configd's implementation fail appending the message

more than one interface matches usbmodem

to the system log, which is why I can't use my WWAN modem.

I think having a way to rename / delete the second hardware port name might solve the problem but I don't know enough about the underlying implementations - I don't know which file or service is responsible for creating the hardware port list in the first place but maybe one of the *NIX gurus know anything about that, taking into consideration that OS X shares part of its code base with BSD.

  • I think it's a gray area when you're talking command line. networksetup is not a standard BSD command but Darwin is a BSD. Not sure if there's a hard rule. – Dee Hendrick Dec 24 '15 at 19:47
  • @DougHendrick The "on-topic" list says questions about "[t]he Unix foundation underlying OS X (but generally not frontend application questions)" are okay, so I hope this isn't OT... but I think since the program causing the problems is part of the open-source foundation of OS X, it's OK. The folks at Apple.SE didn't seem to know anything about this anyway. In fact, there's NO Google match about OS X for the exact string "more than one interface matches" apart from the Apple source so I guess I'll need to ask it SOMEwhere... but then again, might SuperUser or StackOverflow be more appropriate? – Sora. Dec 24 '15 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.