Skip to content

libnet_init(LIBNET_LINK, <null>): <no error message> on some macs #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ThomasHabets opened this issue Jan 20, 2020 · 23 comments
Open

Comments

@ThomasHabets
Copy link
Contributor

See ThomasHabets/arping#36

I don't have a mac, but I suspect this could be a libnet issue picking a special system interface as if it's a normal network interface, when given NULL as ifname.

Possibly only reproducible on Mac Pro with a touchbar.

@troglobit
Copy link
Collaborator

Interesting, I hadn't even considered testing on macOS until now. libnet could most definitely be the root cause for this.

@i0ntempest
Copy link

You meant MacBook Pro with touchbar.
I have a Mac mini (with T2) that have the problem and am happy to help testing if needed.

@troglobit
Copy link
Collaborator

@i0ntempest You're more than welcome to give it a go. There are some samples in the libnet tree that should be easy enough to get started with. One using NULL as interface is samples/udp1.c run it with gdb on your Mac and try to figure out where it goes wrong.

@ya0yy
Copy link

ya0yy commented Oct 23, 2022

I got a error message that is shown "libnet_open_raw4(): SOCK_RAW allocation failed: Operation not permitted", so I try running in root, it's expected

@troglobit
Copy link
Collaborator

@ThomasHabets I see this was closed in your project, would you mind sharing what the conclusion/workaround was?

@ThomasHabets
Copy link
Contributor Author

I wish I documented it at the time, but I think this may be ThomasHabets/arping@3cad228.

Basically sometimes we need to open something, just to call e.g. libnet_name2addr4(), and loopback will do.

This appears to be a failure of libnet to (quoting the manpage) If device is NULL, libnet attempts to find a suitable device to use, and failing to report why.

My workaround is simply to manually find lo0, and arping will re-run libnet_init() later with the interface that will later actually be used for raw packets, as found by getifaddrs().

My theory is that given NULL libnet "finds" the touchbar interface (maybe?) but then fails to actually open it, because it's some sort of special.

Maybe the right fix is for libnet to continue searching?

@troglobit
Copy link
Collaborator

Aha, thanks! Yeah we should probably add fallback handling, looking for something named lo* which is both IFF_LOOPBACK and has the lowest ifindex.

Just waded through the three (3!) implementations of libnet_ifaddrlist() today, responsible for locating the system interfaces on various operating systems. I'll see what I can do about this issue, but I'm adding it to the milestone planning at least.

Again, thank you so much for the quick reply!

@troglobit troglobit added this to the v1.3 milestone Dec 28, 2022
@troglobit
Copy link
Collaborator

So, I've looked into this in detail now. Wanted to make sure before I disclosed my conclusions.

  1. libnet explicitly avoids/skips any loopback interface, unless the second argument to libnet_init() is the name of loopback inteface
  2. libnet explicitly avoids/skips non AF_INET interfaces
  3. libnet explicitly avoids/skips interfaces that don't have any address set

So, your workaround, @ThomasHabets, with a second pass looking for lo0 really is the only way to do it.

We could of course change the semantics, but I'm afraid that might break quite a few use-cases out there. And if we change the semantics I'd also like to see better support for IPv6-only interfaces as well.

Hence, I'm putting this task on hold for now.

@troglobit troglobit removed this from the v1.3 milestone Jan 8, 2023
@ThomasHabets
Copy link
Contributor Author

Well, there's possibly one other way. For the cases where we are asked to search (second argument is NULL), and libnet fails on an interface, we could still try more interfaces, right?

My understanding of the Mac problem here is that we're just "unlucky" that the first scanned interface, and that we would have succeeded if we'd just continued scanning when opening the T2 interface fails.

That should be safe, right? Same semantics.

The three other avoid/skips yeah I don't think we can do anything about.

@troglobit
Copy link
Collaborator

OK, so here's how it works, pseudo code:

libnet_init()
{
    dev = libnet_select_device(dev)
    if (libnet_open_link(dev))
        return fail;
    return ok;
}

libnet_select_device()
{
    if (dev == NULL) {
        num = libnet_ifaddrlist(&list);
        if (num >= 1)
            dev = strdup(list[0].dev);
        free(list);
    }
    return dev;
}

libnet_ifaddrlist(list)
{
    ioctl(fd, SIOCGIFCONF, &ifc);
    return processing(ifc, list)
}

As you can see, the list of interfaces is discarded in libnet_select_device(), so there's no way to try the next interface when libnet_open_link() fails, at least not without some extensive refactoring. Also, how do you see that new behavior as not affecting semantics? These APIs are all open, and we don't really want to store the list in libnet_t passed from the user, so we'd have to add new APIs.

Both the libnet_ifaddrlist()1 and libnet_open_link()2 are OS-specific so there is a lot of refactoring to do. I'm not sure that's the best way to solve this, nor if it the best investment of limited time. Instead, I think a blacklist of interface names3 to check against in libnet_ifaddrlist() for macOS4 would be a safer and quicker fix. Only, I don't know the name of the interface(s) that we should avoid. I was hoping @i0ntempest or @ya0yy could have chimed in with some info on that.

Footnotes

  1. we have four of them, with slightly different semantics.

  2. we have six of these.

  3. or interface flags perhaps, dunno what a T2 device is?

  4. #ifdef since that code is shared with (at least) FreeBSD as well.

@ThomasHabets
Copy link
Contributor Author

ThomasHabets commented Jan 8, 2023

I was thinking something like:

libnet_init()
{
    for (int skip = 0;  ; skip++) {
      dev = libnet_select_device2(ifname, skip);
      if (!dev) {
         return fail;
      } 
      if (!libnet_open_link(dev))
        return ok;
      if (!ifname) {
       return fail;
     }
    }
}

libnet_select_device2(dev, skip)
{
    if (dev == NULL) {
        num = libnet_ifaddrlist(&list);
        if (num > skip)
            dev = strdup(list[skip].dev);
        free(list);
    }
    return dev;
}
libnet_select_device(dev) { return libnet_select_device2(dev, 0); }

@troglobit
Copy link
Collaborator

Yes, that's another way to do it. A few of things that don't feel right:

  1. it adds another public API to libnet, not so bad and any other solution would likely need to do the same
  2. it's wasteful, all the extra malloc/free and kernel ops to retry on failure
  3. the list of interfaces could change between invocations meaning skip would not be a consistent pointer to the last tested interface

I actually considered this approach when I wrote my previous reply, but chose not to include it since it's not just a good solution to this problem. Something similar though, where libnet_select_device() is split in two/three other functions, e.g., libnet_device_get(), libnet_device_put(), and libnet_device_iter() ... or something like that.

@ThomasHabets
Copy link
Contributor Author

It doesn't have to be a public API, but yeah that's a good point about stability.

libnet_init()
{
      devs = libnet_select_devices(ifname);
      for (...) {
        if (!libnet_open_link(dev[i])) {
          free(devs);
          return ok;
        }
     }
     free(devs);
     return fail
}
libnet_select_device(dev) { devs= libnet_select_devices(dev); return devs ? fail : devs[0]; }

But actually doing that instead of pseudocode may not be as simple.
Seems fine to push to a later release, and if anyone wants to volunteer a PR that may show how it's cleaner than we think, it can be merged.

@i0ntempest
Copy link

The interface names are all enx for eth and wifi. One way to find out the T2/ibridge interface is parsing NetworkInterfaces.plist, but that would create additional dependencies... right? Sorry I have no experience in C or low level programming.

@troglobit
Copy link
Collaborator

@i0ntempest it's fine not knowing C, I was just curious if you knew the exact interface name, or type, that was the culprit here. I know the ethernet/wifi names are enX, and I even have a bridge0 interface on my old MacBook Pro.

The output from ifconfig on an modern MacBook with this issue would be great as a start.

@i0ntempest
Copy link

i0ntempest commented Jan 10, 2023

I've attached the ifconfig output from my 2018 Mac mini (with T2). Here en7 is the T2/iBridge interface.
But speaking of "modern"... the newest Apple Silicon Macs probably do not have iBridge (M1/M2 has built in security and I'm not sure if they changed how the system communicate with the Touch Bar).
The output:

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
        inet 127.0.0.1 netmask 0xff000000 
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
        inet 127.0.0.2 netmask 0xffffffff 
        nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
XHC1: flags=0<> mtu 0
XHC20: flags=0<> mtu 0
XHC0: flags=0<> mtu 0
VHC128: flags=0<> mtu 0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=50b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV,CHANNEL_IO>
        ether 14:c2:13:ec:9f:dd 
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect (none)
        status: inactive
en6: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 9000
        options=567<RXCSUM,TXCSUM,VLAN_MTU,TSO4,TSO6,AV,CHANNEL_IO>
        ether 00:24:27:09:06:b7 
        inet6 fe80::49f:3b00:e28c:cf00%en6 prefixlen 64 secured scopeid 0x9 
        inet 192.168.0.13 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fd00:d:e:f:4d8:38dd:619f:56e3 prefixlen 64 autoconf secured 
        inet6 [Masked GUA] prefixlen 64 autoconf secured 
        inet6 [Masked GUA] prefixlen 64 deprecated autoconf temporary 
        inet6 fd00:d:e:f::9d68 prefixlen 64 dynamic 
        inet6 fdb2:2cfb:af24:4b04:1828:411b:410f:4626 prefixlen 64 autoconf secured 
        inet6 [Masked GUA] prefixlen 64 autoconf temporary 
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect (10Gbase-T <full-duplex>)
        status: active
en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether ac:de:48:00:11:22 
        inet6 fe80::aede:48ff:fe00:1122%en7 prefixlen 64 scopeid 0xa 
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect (100baseTX <full-duplex>)
        status: active
en5: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        options=460<TSO4,TSO6,CHANNEL_IO>
        ether 82:fb:4e:a7:98:04 
        media: autoselect <full-duplex>
        status: inactive
en4: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        options=460<TSO4,TSO6,CHANNEL_IO>
        ether 82:fb:4e:a7:98:05 
        media: autoselect <full-duplex>
        status: inactive
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        options=460<TSO4,TSO6,CHANNEL_IO>
        ether 82:fb:4e:a7:98:01 
        media: autoselect <full-duplex>
        status: inactive
en3: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        options=460<TSO4,TSO6,CHANNEL_IO>
        ether 82:fb:4e:a7:98:00 
        media: autoselect <full-duplex>
        status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=63<RXCSUM,TXCSUM,TSO4,TSO6>
        ether 82:fb:4e:a7:98:01 
        Configuration:
                id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
                maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
                root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
                ipfilter disabled flags 0x0
        member: en2 flags=3<LEARNING,DISCOVER>
                ifmaxaddr 0 port 13 priority 0 path cost 0
        member: en3 flags=3<LEARNING,DISCOVER>
                ifmaxaddr 0 port 14 priority 0 path cost 0
        member: en4 flags=3<LEARNING,DISCOVER>
                ifmaxaddr 0 port 12 priority 0 path cost 0
        member: en5 flags=3<LEARNING,DISCOVER>
                ifmaxaddr 0 port 11 priority 0 path cost 0
        nd6 options=201<PERFORMNUD,DAD>
        media: <unknown type>
        status: inactive
ap1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        options=400<CHANNEL_IO>
        ether f2:18:98:83:c1:9d 
        media: autoselect
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=6463<RXCSUM,TXCSUM,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
        ether f0:18:98:83:c1:9d 
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect
        status: inactive
awdl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=6463<RXCSUM,TXCSUM,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
        ether 2a:d2:30:4d:0c:59 
        inet6 fe80::28d2:30ff:fe4d:c59%awdl0 prefixlen 64 scopeid 0x12 
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect
        status: active
llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=400<CHANNEL_IO>
        ether 2a:d2:30:4d:0c:59 
        inet6 fe80::28d2:30ff:fe4d:c59%llw0 prefixlen 64 scopeid 0x13 
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect
        status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
        inet6 fe80::3b6b:a7a6:ad5f:49a1%utun0 prefixlen 64 scopeid 0x14 
        nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
        inet6 fe80::de1b:562:ce5b:5d01%utun1 prefixlen 64 scopeid 0x15 
        nd6 options=201<PERFORMNUD,DAD>
utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000
        inet6 fe80::ce81:b1c:bd2c:69e%utun2 prefixlen 64 scopeid 0x16 
        nd6 options=201<PERFORMNUD,DAD>
utun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
        inet6 fe80::fdc8:8d93:bbc3:80ae%utun3 prefixlen 64 scopeid 0x17 
        nd6 options=201<PERFORMNUD,DAD>
utun4: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
        inet6 fe80::91dd:880a:bd18:a09%utun4 prefixlen 64 scopeid 0x18 
        nd6 options=201<PERFORMNUD,DAD>
utun5: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
        inet6 fe80::44d1:12d0:ad38:9416%utun5 prefixlen 64 scopeid 0x19 
        nd6 options=201<PERFORMNUD,DAD>
utun6: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
        inet6 fe80::270a:3ae4:313a:7a2f%utun6 prefixlen 64 scopeid 0x1a 
        nd6 options=201<PERFORMNUD,DAD>
utun7: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
        inet6 fe80::7328:5e6e:b6ed:7389%utun7 prefixlen 64 scopeid 0x1b 
        nd6 options=201<PERFORMNUD,DAD>
utun8: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
        inet6 fe80::ac3e:8511:d1ac:b7d7%utun8 prefixlen 64 scopeid 0x1c 
        nd6 options=201<PERFORMNUD,DAD>

@troglobit
Copy link
Collaborator

Whoah, that's a lot of interfaces! 😮 Thank you!

How do you know en7 is the T2 interface? It doesn't seem to have any distinguishing markings, really just looks like any kind of interface. In fact, en7 would never be considered by libnet as the code looks now, because it ignores interfaces that don't have an IPv4 address.

Good point also about actual modern Macs, I guess the best approach after all is to go with something similar to what @ThomasHabets wrote.

@i0ntempest
Copy link

Whoah, that's a lot of interfaces! 😮 Thank you!

Physical interfaces+thunderbolt interfaces+thunderbolt bridge+virtual interfaces and you get that.

How do you know en7 is the T2 interface?

That is the problem. Apparently the only way is looking at /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist .

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Interfaces</key>
	<array>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en0</string>
			<key>IOBuiltin</key>
			<true/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>0</integer>
			<key>IOMACAddress</key>
			<data>
			FMIT7J/d
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP02@1C,1/IOPP/GIGE@0/BCM5701Enet/en0</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>Ethernet</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en1</string>
			<key>IOBuiltin</key>
			<true/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>1</integer>
			<key>IOMACAddress</key>
			<data>
			8BiYg8Gd
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP01@1C/IOPP/ARPT@0/AppleBCMWLANBusInterfacePCIe/AppleBCMWLANCore/AppleBCMWLANSkywalkInterface/IOSkywalkLegacyEthernet/en1</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>Wi-Fi</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>IEEE80211</string>
		</dict>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en2</string>
			<key>IOBuiltin</key>
			<true/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>2</integer>
			<key>IOMACAddress</key>
			<data>
			gvtOp5gB
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEG1@1,1/IOPP/UPSB@0/IOPP/DSB0@0/IOPP/NHI0@0/AppleThunderboltHAL/AppleThunderboltNHIType3/IOThunderboltController/IOThunderboltLocalNode/AppleThunderboltIPService/AppleThunderboltIPPort/en2</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>Thunderbolt 1</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en3</string>
			<key>IOBuiltin</key>
			<true/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>3</integer>
			<key>IOMACAddress</key>
			<data>
			gvtOp5gA
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEG1@1,1/IOPP/UPSB@0/IOPP/DSB0@0/IOPP/NHI0@0/AppleThunderboltHAL/AppleThunderboltNHIType3/IOThunderboltController/IOThunderboltLocalNode/AppleThunderboltIPService/AppleThunderboltIPPort/en3</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>Thunderbolt 2</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en4</string>
			<key>IOBuiltin</key>
			<true/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>4</integer>
			<key>IOMACAddress</key>
			<data>
			gvtOp5gF
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEG2@1,2/IOPP/UPSB@0/IOPP/DSB0@0/IOPP/NHI0@0/AppleThunderboltHAL/AppleThunderboltNHIType3/IOThunderboltController/IOThunderboltLocalNode/AppleThunderboltIPService/AppleThunderboltIPPort/en4</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>Thunderbolt 3</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en5</string>
			<key>IOBuiltin</key>
			<true/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>5</integer>
			<key>IOMACAddress</key>
			<data>
			gvtOp5gE
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEG2@1,2/IOPP/UPSB@0/IOPP/DSB0@0/IOPP/NHI0@0/AppleThunderboltHAL/AppleThunderboltNHIType3/IOThunderboltController/IOThunderboltLocalNode/AppleThunderboltIPService/AppleThunderboltIPPort/en5</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>Thunderbolt 4</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en6</string>
			<key>IOBuiltin</key>
			<false/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>6</integer>
			<key>IOMACAddress</key>
			<data>
			ACQnCQa3
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEG2@1,2/IOPP/UPSB@0/IOPP/DSB1@1/IOPP/UPS0@0/IOPP/pci-bridge@1/IOPP/ethernet@0/AppleEthernetAquantiaAqtion107/en6</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>Thunderbolt Ethernet Slot 1</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>Active</key>
			<true/>
			<key>BSD Name</key>
			<string>en7</string>
			<key>HiddenInterface</key>
			<true/>
			<key>IOBuiltin</key>
			<false/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>7</integer>
			<key>IOMACAddress</key>
			<data>
			rN5IABEi
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/RP17@1B/IOPP/IOBC@0,1/IOBufferCopyController/AppleUSBVHCIBCE@80000000/AppleUSBVHCIPort@80100000/Apple T2 Controller@80100000/NCM Data@1/AppleUSBNCMData/en7</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>iBridge</string>
				<key>idProduct</key>
				<integer>33331</integer>
				<key>idVendor</key>
				<integer>1452</integer>
				<key>kUSBProductString</key>
				<string>Apple T2 Controller</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>BSD Name</key>
			<string>en9</string>
			<key>HiddenInterface</key>
			<true/>
			<key>IOBuiltin</key>
			<false/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>9</integer>
			<key>IOMACAddress</key>
			<data>
			ym0kirUs
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/HS14@14600000/iPhone@14600000/NCM Data@5/AppleUSBNCMData/en9</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>iPhone</string>
				<key>idProduct</key>
				<integer>4776</integer>
				<key>idVendor</key>
				<integer>1452</integer>
				<key>kUSBProductString</key>
				<string>iPhone</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>BSD Name</key>
			<string>en10</string>
			<key>HiddenInterface</key>
			<true/>
			<key>IOBuiltin</key>
			<false/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>10</integer>
			<key>IOMACAddress</key>
			<data>
			Qk14aj6C
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/HS14@14600000/iPhone@14600000/NCM Data@5/AppleUSBNCMData/en10</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>iPhone</string>
				<key>idProduct</key>
				<integer>4776</integer>
				<key>idVendor</key>
				<integer>1452</integer>
				<key>kUSBProductString</key>
				<string>iPhone</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
		<dict>
			<key>BSD Name</key>
			<string>en11</string>
			<key>HiddenInterface</key>
			<true/>
			<key>IOBuiltin</key>
			<false/>
			<key>IOInterfaceNamePrefix</key>
			<string>en</string>
			<key>IOInterfaceType</key>
			<integer>6</integer>
			<key>IOInterfaceUnit</key>
			<integer>11</integer>
			<key>IOMACAddress</key>
			<data>
			JrFQhhCv
			</data>
			<key>IOPathMatch</key>
			<string>IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/SS04@14700000/iPad@14700000/NCM Data@5/AppleUSBNCMData/en11</string>
			<key>SCNetworkInterfaceInfo</key>
			<dict>
				<key>UserDefinedName</key>
				<string>iPad</string>
				<key>idProduct</key>
				<integer>4779</integer>
				<key>idVendor</key>
				<integer>1452</integer>
				<key>kUSBProductString</key>
				<string>iPad</string>
			</dict>
			<key>SCNetworkInterfaceType</key>
			<string>Ethernet</string>
		</dict>
	</array>
	<key>Model</key>
	<string>Macmini8,1</string>
	<key>__VERSION__</key>
	<integer>20191120</integer>
</dict>
</plist>

@troglobit
Copy link
Collaborator

Thanks, this will be very useful! I guess we'd need, at least, a very rudimentary xml parser if we go down the blacklisting route.

@i0ntempest
Copy link

Just a thought... how about blacklisting ACPI paths or VID/PID pairs? Both should be pretty stable and are unlikely to change. But both would require gathering info from people and hardcoding those stuff in though.

@troglobit
Copy link
Collaborator

Yeah there are many opportunities here, but they rather quickly shoot way above what libnet was intended for. But it would make for a good "plugin" or user-provided list of interfaces, somehow. That way the user can user whatever mechanism they want to steer libnet in the right direction.

@i0ntempest
Copy link

Went to the local Apple Store a few days ago - confirmed that MacBooks with Apple Silicone and touch bar do not have the iBridge interface

@troglobit
Copy link
Collaborator

Amazing, thank you for taking the time to look into this! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy