Im new to C, this will probably become apparent. I've been working on this program for about two months now and im getting to the final stages of it being completed. I just need to clean a few things up.

Anyways, one of the functions my program does is sends out dhcp discovers, listens for dhcp offers, and sends back dhcp request. I have all that working fine except one thing.

I've noticed struct in_addr refuses to take "" as a valid ip, instead it returns my local ip. I've tried using inet_addr(), inet_aton(), inet_pton(). as of now i've been stuck with using and its been driving me up the wall.

Im at the point now where im about to build everything from the ethernet header down by hand, but I really dont want to if I dont have to, please help??


Correction, I believe it is the libnet library that wont take as a valid ip. it changes it to my local ip.

Nevermind, I figured it out! :)

Incase anyone else needs to know. Libnet will not accept as a valid IP source in an IP header unless you build the Ethernet header yourself.