Skip to content

Instantly share code, notes, and snippets.

@grigorye
Last active October 6, 2017 20:16
Show Gist options
  • Save grigorye/d472b76f55e5d2fa064b1d72fb2c0665 to your computer and use it in GitHub Desktop.
Save grigorye/d472b76f55e5d2fa064b1d72fb2c0665 to your computer and use it in GitHub Desktop.
Workaround for minidlna crashing on macOS 10.13 (17A405)
diff -ur minidlna-1.2.1/getifaddr.c minidlna-1.2.1-sdl_alen-0-8/getifaddr.c
--- minidlna-1.2.1/getifaddr.c 2017-08-24 19:28:25.000000000 +0200
+++ minidlna-1.2.1-sdl_alen-0-8/getifaddr.c 2017-10-06 22:05:06.000000000 +0200
@@ -206,6 +206,10 @@
#else
struct sockaddr_dl *sdl;
sdl = (struct sockaddr_dl*)p->ifa_addr;
+ if (sdl->sdl_alen == 0)
+ continue;
+ if (6 < sdl->sdl_alen)
+ continue;
memcpy(mac, LLADDR(sdl), sdl->sdl_alen);
#endif
if (MACADDR_IS_ZERO(mac))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment