X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibnet.so_src%2Fmain.c;h=b39d7548e62b4e40b3850aed65e1a1437733ceba;hb=08e1f139ca02aa899f698d90146a5bc9926c2f37;hp=7f8d04827d55a791d8b635e28d3845be8e72275a;hpb=3fd9baa3ff076bc424b77b31928a0fee34f883f9;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libnet.so_src/main.c b/Usermode/Libraries/libnet.so_src/main.c index 7f8d0482..b39d7548 100644 --- a/Usermode/Libraries/libnet.so_src/main.c +++ b/Usermode/Libraries/libnet.so_src/main.c @@ -69,6 +69,7 @@ char *Net_GetInterface(int AddressType, void *Address) // Query the route manager for the route number { char buf[sizeof(int)+size]; + uint32_t *type = (void*)buf; // Open fd = open("/Devices/ip/routes", 0); @@ -78,8 +79,8 @@ char *Net_GetInterface(int AddressType, void *Address) } // Make structure and ask - *(int*)buf = AddressType; - memcpy(&buf[sizeof(int)], Address, size); + *type = AddressType; + memcpy(type+1, Address, size); routeNum = ioctl(fd, ioctl(fd, 3, "locate_route"), buf); // Close