lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Loopback problems


From: Fabian Koch
Subject: [lwip-users] Loopback problems
Date: Mon, 3 Aug 2009 14:20:14 +0200


Hey all,

I still have the Problem that I can't determine a Broadcast on higher levels (netconn/netbuf), which I need.
I saw the SOF_BROADCAST option added in 1.3.1, but that won't help me unless I'm willing to rewrite a lot of our code (which I'm not).
The other problem is that we treat LwIP as external software and thus don't change the code. So I need to ask you whether you could take the following changes into mainline.


udp.h: Lines 66-69
...
#define UDP_FLAGS_NOCHKSUM 0x01U
#define UDP_FLAGS_UDPLITE  0x02U
#define UDP_FLAGS_CONNECTED  0x04U
+ #define UDP_FLAGS_IS_BROADCAST  0x08U
...

udp.c: Lines 280-290
...
    if (pcb != NULL) {
      snmp_inc_udpindatagrams();
+      if(broadcast){
+        udp_setflags(pcb, udp_flags(pcb) | UDP_FLAGS_IS_BROADCAST);
+      } else {
+        udp_setflags(pcb, udp_flags(pcb) & ~UDP_FLAGS_IS_BROADCAST);
+      }
      /* callback */
      if (pcb->recv != NULL) {
        /* now the recv function is responsible for freeing p */
        pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), src);
...

does this make sense for you?
Is the use of the flags field okay for this?

regards,
Fabian

reply via email to

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