4 ms·
You might also try something like: sudo /usr/libexec/airportd en0 prefs AWDLEnabled=YES (Edit: see varenc's reply below) Or you could create a kext (using
by mrtesthah 4y ago
You might also try something like:
sudo /usr/libexec/airportd en0 prefs AWDLEnabled=YES
(Edit: see varenc's reply below)
Or you could create a kext (using deprecated KPIs) that continuously blocks the interface from coming up:
errno_t awdlblock_ioctl_handler(void *cookie, ifnet_t interface, protocol_family_t protocol, unsigned long ioctl_cmd, void *ioctl_arg) {
if (SIOCSIFFLAGS == ioctl_cmd) {
struct ifreq *ifr = (struct ifreq*)ioctl_arg;
if (ifr && ((ifr->ifr_flags) & IFF_UP) != 0) {
return EJUSTRETURN;
}
}
return ENOTSUP;
}
kern_return_t awdlblock_start(kmod_info_t * ki, void *d)
{
struct iff_filter filter = { 0 };
errno_t err = ifnet_find_by_name("awdl0", &p_ifnet);
if (err) {
printf("interface awdl0 not found\n");
return KERN_SUCCESS;
}
filter.iff_name = "AWDLBlock";
filter.iff_ioctl = awdlblock_ioctl_handler;
iflt_attach(p_ifnet, &filter, &p_filter);
return KERN_SUCCESS;
}
- varenc 4y agoWow I didn't know about that undocumented ability to change Airport prefs! I was able to somewhat disable AWDL by doing this like you suggest: sudo /usr/libexec/airportd en0 prefs AWDLEnabled=YES And then restarting airportd so that it picks up the change: sudo launchctl kickstart -k system/com.apple.airportd This worked without having to disable SIP and modify com.apple.airportd.plist It doesn't take the awdl0 interface down, and I still see some traffic on it, but I can confirm that it disables some awdl features like "Unlock with Watch" and Screen Sharing over awdl. (Screen Sharing will work over your wifi network instead, but normally it'll prefer a direct awdl link)
- mrtesthah 4y agoThat's good to hear that's all it takes! Yes, Bonjour name resolution, which Screen Sharing uses, can also run over AWDL, but of course it does not have to. There was a bug in OS X Yosemite and older versions of iOS which caused any AWDL activity to severely increase network jitter and latency; this sounds like a regression. https://medium.com/@mariociabarra/wifried-ios-8-wifi-performance-issues-3029a164ce94 https://medium.com/@mariociabarra/wifried-ios-8-wifi-perform...
- TeMPOraL 4y ago> I was able to somewhat disable AWDL by doing this like you suggest: > sudo /usr/libexec/airportd en0 prefs AWDLEnabled=YES Wait, why AWDLEnabled = YES? Is it like with those Cisco routers, where "do X" was usually done by negating "do inverse-of-X"? E.g. "no interface up foo" to bring down interface "foo".
- InvaderFizz 4y agoI suspect that in this case, they're telling MacOS to use the physical Ethernet port for awdl, which can't do airtime slicing. That prevents it from doing any WiFi direct things, but otherwise would leave it functional.
- varenc 4y agoSorry, you're 100% right. It should be AWDLEnabled=NO! (and was in my testing) Also you can check what your current prefs by just not passing any args after `prefs`: sudo /usr/libexec/airportd en0 prefs