fix: SIOCGIFMTU passes int* instead of ifreq* (Android)

This commit is contained in:
2026-08-06 17:01:30 +03:00
committed by andrey
parent 38253effc6
commit 27ed1bc9a7
+3 -1
View File
@@ -1207,7 +1207,9 @@ PIEthernet::InterfaceList PIEthernet::interfaces() {
if (ioctl(s, SIOCGIFHWADDR, &ir) == 0) ci.mac = macFromBytes(PIByteArray(ir.ifr_hwaddr.sa_data, 6));
if (ioctl(s, SIOCGIFADDR, &ir) >= 0) ci.address = getSockAddr(&ir.ifr_addr);
if (ioctl(s, SIOCGIFNETMASK, &ir) >= 0) ci.netmask = getSockAddr(&ir.ifr_netmask);
ioctl(s, SIOCGIFMTU, &ci.mtu);
if (ioctl(s, SIOCGIFMTU, &ir) == 0) {
ci.mtu = ir.ifr_mtu;
}
if (ci.address == "127.0.0.1") ci.flags |= PIEthernet::ifLoopback;
il << ci;
}