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 "0.0.0.0" 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 0.0.0.1 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??

Thanks,

Correction, I believe it is the libnet library that wont take 0.0.0.0 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 0.0.0.0 as a valid IP source in an IP header unless you build the Ethernet header yourself.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.