X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Fdhcpclient_src%2Fmain.c;h=5b1d38021ad1c54f516203dd5cc0e2a1891c8d44;hb=27cb4fff4ed854d8be598a1157265c6de8aa035a;hp=73e85d8ef5c731b41f6df35fc7258a3e0cf365d8;hpb=bbf01510accedc5e224e7b8bd7dc087932bb6233;p=tpg%2Facess2.git diff --git a/Usermode/Applications/dhcpclient_src/main.c b/Usermode/Applications/dhcpclient_src/main.c index 73e85d8e..5b1d3802 100644 --- a/Usermode/Applications/dhcpclient_src/main.c +++ b/Usermode/Applications/dhcpclient_src/main.c @@ -221,7 +221,15 @@ int Start_Interface(tInterface *Iface) fprintf(stderr, "ERROR: Unable to open '/Devices/ip'\n"); return -1; } - Iface->Num = _SysIOCtl(fd, 4, (void*)Iface->Adapter); // Create interface + struct { + const char *Device; + const char *Name; + int Type; + } ifinfo; + ifinfo.Device = Iface->Adapter; + ifinfo.Name = ""; + ifinfo.Type = 4; + Iface->Num = _SysIOCtl(fd, 4, &ifinfo); // Create interface if( Iface->Num == -1 ) { fprintf(stderr, "ERROR: Unable to create new interface\n"); return -1; @@ -235,7 +243,6 @@ int Start_Interface(tInterface *Iface) fprintf(stderr, "ERROR: Unable to open '%s'\n", path); return -1; } - tmp = 4; _SysIOCtl(fd, 4, &tmp); // Set to IPv4 _SysIOCtl(fd, 6, addr); // Set address to 0.0.0.0 tmp = 0; _SysIOCtl(fd, 7, &tmp); // Set subnet mask to 0 @@ -248,7 +255,7 @@ int Start_Interface(tInterface *Iface) } tmp = 68; _SysIOCtl(fd, 4, &tmp); // Local port tmp = 67; _SysIOCtl(fd, 5, &tmp); // Remote port - tmp = 0; _SysIOCtl(fd, 7, &tmp); // Remote addr mask bits - we don't care where the reply comes from + tmp = 0; _SysIOCtl(fd, 7, &tmp); // Remote addr mask bits - we don't care where the reply comes from addr[0] = addr[1] = addr[2] = addr[3] = 255; // 255.255.255.255 _SysIOCtl(fd, 8, addr); // Remote address