lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Lwip 1.1.0 upd_send


From: Paul C
Subject: Re: [lwip-users] Lwip 1.1.0 upd_send
Date: Tue, 04 Jan 2005 14:12:43 +1030

I notice that dhcp.c uses 

    /* set remote IP association to any DHCP server */
    udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
    /* broadcast to server */
    udp_sendto(dhcp->pcb, dhcp->p_out, IP_ADDR_BROADCAST,
    DHCP_SERVER_PORT);

and also 

    udp_bind(dhcp->pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
    udp_connect(dhcp->pcb, IP_ADDR_BROADCAST, DHCP_SERVER_PORT);
    LWIP_DEBUGF(DHCP_DEBUG | DBG_TRACE | DBG_STATE, ("dhcp_inform:
    INFORMING\n"));
    udp_send(dhcp->pcb, dhcp->p_out);
    udp_connect(dhcp->pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);

Is there a reason why udp_sendto(,,,) cannot be used in the second case?
What is the prefered way to send/receive a broadcast address?
1)
bind (ANY)
connect(ANY)
udp_sendto(BROADCAST)

OR 
2)
bind (ANY)
connect(BROADCAST)
udp_Send( )
connect(ANY)


On Tue, 04 Jan 2005 13:46:15 +1030, "Paul C" <address@hidden>
said:
> Hi List,
> 
> I use 
>             err = udp_connect( Shout, IP_ADDR_ANY, A_PORT);
>             err = udp_send(Shout, pcb);
> 
> With LWIP 1.1.0 release the udp is sent to 0.0.0.0 I have this patch 
> in udp.c to make it use the network address (which is what I want).
> Am I using udp_connect/ udp_send wrongly or is this a patch
> that should be in lwip? Should I really use IP_ADDR_BROADCAST here 
> instead?
> 
> Thanks 
> 
> Paul Clarke
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]