Thanks for your help.
The reason that need to write this program is that the Carrier use a
mechnism called DHCP+ Authentication to control the access to Internet.
DHCP+ extends DHCP, and the Carrier only provide Windows version and
redhat version of DHCP+ Client. But I'm using Debian.
According your advice, should I encapsulate IP header by myself?
Tauno Voipio wrote:
> (E-Mail Removed) wrote:
> > Hello, every body, I'm a newbie in linux network programming.
> > When I want to write a program that implement a request ip addr from
> > DHCP+ server, I encounter a problem.
> >
> > According to the packet that I captured from the Carrier's Login
> > utility, I need to send a UDP packet, with broadcast dest addr, and 0
> > src addr.
> > But when I configure the eth0's address as 0, i can't send out a
> > packet.
> >
> > Does anyone know what's the problem is, and how to slove it?
>
> Why? There are already good DHCP client daemons.
>
> You cannot reliably send an UDP packet with sender address
> of 0.0.0.0 (as required by DHCP) without using raw sockets.
>
> I'd recommend to tackle simpler network programming tasks first.
>
> --
>
> Tauno Voipio
> tauno voipio (at) iki fi