X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Fifconfig_src%2Fmain.c;h=c3ae31666fbb8617096ac249a7a72d330bdfbfe2;hb=41769c02317835472d7678d3531ecfc23df8e17a;hp=7a7fd07a8d89a26f292440c91c69625cf7e159da;hpb=a54379686bef79c24e4a1e2337611f33d33c8b4b;p=tpg%2Facess2.git diff --git a/Usermode/Applications/ifconfig_src/main.c b/Usermode/Applications/ifconfig_src/main.c index 7a7fd07a..c3ae3166 100644 --- a/Usermode/Applications/ifconfig_src/main.c +++ b/Usermode/Applications/ifconfig_src/main.c @@ -223,7 +223,7 @@ void DumpRoute(const char *Name) { int fd; int type; - char path[sizeof(IPSTACK_ROOT)+7+FILENAME_MAX+1] = IPSTACK_ROOT"/route/"; + char path[sizeof(IPSTACK_ROOT)+8+FILENAME_MAX+1] = IPSTACK_ROOT"/routes/"; strcat(path, Name); @@ -346,7 +346,7 @@ void AddRoute(const char *Interface, void *Dest, int MaskBits, void *NextHop) int DoAutoConfig(const char *Device) { int tmp, fd; - char path[sizeof(IPSTACK_ROOT)+5+1]; // ip000 + char path[sizeof(IPSTACK_ROOT)+1+4+1]; // /0000 uint8_t addr[4] = {10,0,2,55}; uint8_t gw[4] = {10,0,2,1}; int subnet = 8; @@ -373,10 +373,11 @@ int DoAutoConfig(const char *Device) // Set Subnet ioctl(fd, ioctl(fd, 3, "getset_subnet"), &subnet); - // Set Gateway + // Set routes { uint8_t net[4] = {0,0,0,0}; - AddRoute(path + sizeof(IPSTACK_ROOT) + 1, net, 0, gw); + AddRoute(path + sizeof(IPSTACK_ROOT), addr, 8, net); // This interface + AddRoute(path + sizeof(IPSTACK_ROOT), net, 0, gw); // Gateway } close(fd);