Modules/Tegra2Vid - Fixed out-of-date IO function prototypes
[tpg/acess2.git] / Usermode / Applications / dhcpclient_src / main.c
index ff326b0..affe1fd 100644 (file)
@@ -8,6 +8,7 @@
 #include <stdlib.h>
 #include <net.h>
 #include <acess/sys.h>
+#include <errno.h>
 
 enum {
        UDP_IOCTL_GETSETLPORT = 4,
@@ -307,16 +308,18 @@ void Send_DHCPDISCOVER(tInterface *Iface)
        msg->options[i++] =  53;        // DHCP Message Type
        msg->options[i++] =   1;
        msg->options[i++] =   1;        // - DHCPDISCOVER
-       msg->options[i++] = 255;        // End of list
+       msg->options[i  ] = 255;        // End of list
        
 
+       // UDP Header
        data[0] = 67;   data[1] = 0;    // Port
        data[2] = 4;    data[3] = 0;    // AddrType
        data[4] = 255;  data[5] = 255;  data[6] = 255;  data[7] = 255;
 
        i = _SysWrite(Iface->SocketFD, data, sizeof(data));
        if( i != sizeof(data) ) {
-               _SysDebug("_SysWrite failed (%i != %i)", i, sizeof(data));
+               _SysDebug("_SysWrite failed (%i != %i): %s", i, sizeof(data),
+                       strerror(errno));
        }
        Update_State(Iface, STATE_DISCOVER_SENT);
 }

UCC git Repository :: git.ucc.asn.au