lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] UDP not accepting repsonses to a broadcast


From: Paul
Subject: [lwip-users] UDP not accepting repsonses to a broadcast
Date: Wed, 10 Mar 2004 21:34:12 +1030
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

Hi everyone,

I am using LWIP   0_7_1   and I want to do the following

Send out a packet to a port using a broadcast address.

The packet goes out ok but the replies I get back never get back to the udp receive function.

I believe that the problem is in src/core/udp.c
udp_input()
....

      /* PCB remote port matches UDP source port? */
   if ((pcb->remote_port == src) &&
      /* PCB local port matches UDP destination port? */
      (pcb->local_port == dest) &&
      /* accepting from any remote (source) IP address? or... */
      (ip_addr_isany(&pcb->remote_ip) ||
      /* PCB remote IP address matches UDP source IP address? */
       ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src))) &&
      /* accepting on any local (netif) IP address? or... */
      (ip_addr_isany(&pcb->local_ip) ||
      /* PCB local IP address matches UDP destination IP address? */
       ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest)))) {
#ifdef SO_REUSE

The issue is with pcb->remote_ip set to IP_ADDR_BROADCAST  then
ip_addr_isany(&pcb->remote_ip)   fails so the input is rejected.

The alternative is to set pcb->remote_ip to IP_ADDR_ANY but then
the udp packet is sent to  0.0.0.0 and no hosts reply (only windows tested).

Can anyone make a suggestion on how to fix or work around this?

Thanks

Paul



reply via email to

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