[lwip-users] shutdown sequence?

2008-10-30 Thread fabian . koch
Hey Guys, I was just wondering: is there a defined shutdown sequence for LwIP? I need to be able to completely shut down all LwIP Threads and release all memory and resources that were hogged. I didn't find any function for that. My plan so far is to have a handle list for all resources that are

RE: [lwip-users] Rapid tcp sending leads to a very long chain of pbufs

2008-11-25 Thread fabian . koch
Hey, that is the LwIP implementation of the Nagle Algorithm. There were some discussions on this list about it already. You can use TCP_NODELAY socketoption in sequential APIs. (setsockopt) Also TCP_SND_QUEUELEN calculates the number of pbufs for tcp communication, AFAIK. regards, Fabian [EM

Re: [lwip-users] Security implemented in LWIP

2009-01-28 Thread fabian . koch
Hey, we performed pretty thorough Tests with the Stack (including the usual stuff like SYN-Floods) and found the TCP Options-bug. I would give LwIP a pretty good grade there. The Stack itself is very robust. The problematic part is always the driver implementation. And that is where LwIP could

Re: [lwip-users] Security implemented in LWIP

2009-01-28 Thread fabian . koch
Hey, lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 28.01.2009 12:43:22: > Where? Is it a lwip bug? is it already solved in current cvs? (i'm > using last 1.3.0 release) Yes it was a bug in LwIP. See: http://savannah.nongnu.org/bugs/index.php?24596 > which tool i can use to sim

Re: [lwip-users] Routing in lwIP.

2009-01-29 Thread fabian . koch
Hey guys, lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 30.01.2009 02:53:21: > But I think the original pointer is interested in more complicated > routing, possibly even dynamic routing. I think that would require a fair > bit of new code in lwIP. I think the project shouldn'

[lwip-users] enum netconn_state

2009-01-30 Thread fabian . koch
Hey guys, I am using the netconn API and I want at some point to have an output function similar to the "netstat" command in unix and windows. My Problem is the last info in netstat that shows the current state of the TCP connection. The netconn API has not enough states to show the TCP state m

Re: [lwip-users] low_level_output question

2009-04-07 Thread Fabian Koch
Hello everyone, > Hi, > I'm porting lwip (using an RTOS and the socket API) and I have a > question regarding the low_level_output function. > If I can't send the pbuf immediately (netif busy), to avoid copying > the pbuf, I'd like to do the following: > * Increment the reference count to

Re: [lwip-users] lwIP 1.3.1 second release candidate

2009-07-28 Thread Fabian Koch
Hey there, I still get a compile error in "inet_checksum.c" Line 292 for the "NULL" that is not defined. Even though in "lwip/inet_checksum.h" the include of stddef.h should do the trick... Am I missing something? regards, Fabian___ lwip-users mailin

[lwip-users] [OT] why raw API?

2009-07-28 Thread Fabian Koch
Hey all, a slightly off-topic question that kept stirring in my head: Why do nearly all people on this list seem to use the raw API instead of netconn or sockets? Performance-gain? Flexibility? regards, Fabian___ lwip-users mailing list lwip-users@non

Re: [lwip-users] TCP causing out of mem pool [RAW]

2009-07-29 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 29.07.2009 13:16:28: > Here's another one. It's the same as before - no FIN shown. > > Where do you see a FIN being sent in the debug log? > I just see an ACK being sent. > > Look below. lwIP gets a FIN, but sends back an ACK. > Th

[lwip-users] Loopback

2009-07-29 Thread Fabian Koch
Hey guys, I'm starting to use the Loopback connection at the moment and am running into what appears to be race conditions. (Still using 1.3.0 and in the process of looking at 1.3.1) Now in 1.3.0 in loopif.c it is said that loopif_output() copies the pbuf and calls netif->input() with it. And n

[lwip-users] Dest addr and port on UDP netbuf?

2009-07-31 Thread Fabian Koch
Hey all, I'm using 1.3.0-stable at the moment, Netconn-API and I receive some UDP Packets on a specific Port. Now I need to determine whether the Packets were sent to my IP or to UDP broadcast. I can't find any function to get the dest-addr and dest-port from the Packet. I can only get the src-

[lwip-users] Loopback problems

2009-08-03 Thread Fabian Koch
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

Re: [lwip-users] Loopback problems

2009-08-03 Thread Fabian Koch
Err.. sorry the subject on this is completely wrong... but anyways___ lwip-users mailing list lwip-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Loopback problems

2009-08-04 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 03.08.2009 17:47:34: > In 1.3.1, we added the function ip_current_header(), which should give > you everything you need (unless I understood you wrong). I don't know if that will work. I basically have a system that wants me to imple

Re: [lwip-users] Loopback problems

2009-08-04 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 04.08.2009 14:54:29: > No, you're not wrong. Of course the function is not usable from the > netconn thread. However, my proposal is not much different to yours: > having a flag UDP_FLAGS_IS_BROADCAST in the PCB won't help you, > eit

Re: [lwip-users] Loopback problems

2009-08-04 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 04.08.2009 16:31:35: > The only clean solution is to change the function recv_udp() in > api_msg.c to get the setting (broadcast flag or target address) and > store it with the netbuf so that you can access it when reading from the

Re: [lwip-users] Loopback problems

2009-08-04 Thread Fabian Koch
> Big Fat Warning! This is not how it works! You are cleary violating > threading rules here!!! Don't ever access the pcb from a different > thread than the tcpip_thread or you will get random results! This poses some more questions... Until now I used: conn->pcb.tcp->state: to print the s

Re: [lwip-users] Loopback problems

2009-08-04 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 04.08.2009 17:56:10: > The variables you read/write from the wrong thread are relatively > static, so no wonder it works for you. However, the correct way to do it > is to use tcpip_callback() to get a user-specific function called i

Re: [lwip-users] Program to generate packets

2009-08-05 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 05.08.2009 14:30:35: > Does anyone know of a freeware/open source program to generate > packets? I'm having a checksum problem, and would like to generate > packets that have a specific data pattern so it's easier to debug. > I sup

Re: [lwip-users] lwIP 1.3.1

2009-08-20 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 18.08.2009 15:24:19: > lwIP 1.3.1 has been released. You can access it via a zip on the > download area of savannah or using the STABLE-1_3_1 tag in CVS. Thanks Kieran! Only a slight complaint: In the release, there are 2 files that

[lwip-users] changes in api_msg regarding trypost/callback

2009-08-25 Thread Fabian Koch
Hey all, I wrote a mail some time ago that I have a different behavior in connections since switching from 1.3.0 to 1.3.1. All my connections stay in CLOSE_WAIT after the remote closes the connection. (I use the Netconn-API) Today I had the time to debug this issue and found the Changes Kieran

Re: [lwip-users] Reassemble fragmented TCP packets

2009-08-27 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 26.08.2009 18:20:07: > Hi all, > Is lwip able to reassemble fragmented TCP packets? If yes, how? > In fact my stack is supposed to receive a HTTP POST request split > into 2 TCP fragments. At the TCP level, both fragments are set with

Re: [lwip-users] Reassemble fragmented TCP packets

2009-08-31 Thread Fabian Koch
> The thing to bear in mind is that lwIP provides TCP chuncks to the > application as soon as it have been received. Any applications must > be aware of that feature! ... with the RAW-API. Sockets and netconns behave very much as expected. regards, Fabian

[lwip-users] memp_sanity

2009-09-16 Thread Fabian Koch
Hey everyone, I activated the MEMP checks in my lwipopts.h recently and now run into the memp_sanity_check assertion when shutting down my app (closing all my sockets). The check comment says it checks for a loop in the memp list. Any hints on how that might happen? I use 1.3.1 and the netconn

[lwip-users] sockopt inheritance?

2009-09-18 Thread Fabian Koch
Hey all, I was wondering if a Socket that is returned by accept() (or a netconn by netconn_accept() which I use) does inherit all the sockopts that were set for the listeninge/accept Socket? I tried to follow the code but what I found looked like it returns a newly allocated netconn/socket with

[lwip-users] sys_arch_sem_wait

2009-09-29 Thread Fabian Koch
Hey all, a short question about sys_arch_sem_wait(). When someone is waiting for it, and it gets an eror/deleted. Is that a serious condition that shouldn't hapen or should it just return the usual SYS_ARCH_TIMEOUT? At the moment we have an Assertion in there (in a define called "IF_DEBUG_HALT

[lwip-users] sys_arch_mbox_fetch

2009-10-15 Thread Fabian Koch
Hey all, our sys_arch layer is very conservative at the moment. It basically makes Assertions at any given wrong turn. Also when someone is waiting for sys_arch_mbox_fetch to finish (e.g. netconn_accept()), and the mbox is deleted, it fires an Assertion. This happens now when I want to netconn_c

Re: [lwip-users] sys_arch_mbox_fetch

2009-10-16 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 15.10.2009 16:30:58: > Your conservative approach is the right thing to do since basically, > what you are trying to do is not supported! Calling netconn_close() > while the connection waits in netconn_accept() means you are using on

[lwip-users] Sockopt SND_TIMEO

2010-01-13 Thread Fabian Koch
Hey list, I am in the position where I would need SOCKET_SO_SNDTIMEO to have Send() at least return after a while when e.g. I unplugged the cable. Now, I understand that sockopt is unimplemented in LwIP. Could I achieve a similar behavior using sys_timeout()? Creating a timeout before calling ne

Re: [lwip-users] Sockopt SND_TIMEO

2010-01-14 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 13.01.2010 17:41:54: > A more sophisticated way to implement this (which might even have > the potential to be included in CVS?) would be to have a timstamp > when write was started and let poll_tcp() or do_writemore() check > whethe

[lwip-users] netconn_connect() non-blocking?

2010-02-16 Thread Fabian Koch
Hey guys, do you have any great ideas/hacks/workarounds to make netconn_connect() non-blocking? I made everything else quasi-non-blocking by various workarounds but can't ge around connect. kind regards, Fabian___ lwip-users mailing list lwip-users@no

Re: [lwip-users] netconn_connect() non-blocking?

2010-02-16 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 16.02.2010 11:43:38: > My idea would be to use CVS HEAD, as I have implemented non-blocking > connect last week. But be warned that there have been *many* changes > since 1.3.2 and just updating the sources won't work, you'd have to >

Re: [lwip-users] DHCP Client (urgent)

2010-08-31 Thread Fabian Koch
> Hello, > Good day. > > I'm using lwip-1.3.1 with FreeRTOS. > I want to establish a DHCP client. But I don?t know how to set DCHP and how > to call the correct functions. > Any idea on this one? you can use netif_set_status_callback() to establish a function that will be called when the interf

Re: [lwip-users] DHCP Client (urgent)

2010-09-01 Thread Fabian Koch
> Please, could give me more details? > I'm using netconn API. No difference. The Netif-API is for handling network interfaces. As far as I can see, it works no matter what API you use for data-transfer (Raw, netconn, sockets). In your current project you probably have some global handle for yo

Re: [lwip-users] RTAI and LwIP for Realtime Communication

2010-12-02 Thread Fabian Koch
> I recently found the LwIP Project. But I'm not sure if I truly understand. > I'm looking for a realtime stack to communicate in realtime via Ethernet. I > use Linux RTAI for my realtime system. Is it possible to use LwIP for that > job? You are looking for RTnet, a network-stack for RTAI/Xeno

Re: [lwip-users] Official 1.5.0 release

2014-02-12 Thread Fabian Koch
lwip-users-bounces+fabian.koch=de.abb@nongnu.org wrote on 12.02.2014 12:58:45: > I would like to know that too! :-) Yes! Me too. Given that there is no _official_ release since 1.4.0... What? 1.4.1 you say? src/include/lwip/init.h: [...] /** For release candidates, this is set to 1..254 *

[lwip-users] expected behavior of sys_arch_mbox_fetch()

2014-02-13 Thread Fabian Koch
Hey all, I was wondering what the expected bahivor of sys_arch_mbox_fetch() is when the mbox that is being waited on is freed by another task. Example: Task1 is stuck in lwip_accept() Task2 does an lqip_close() on the socket. in our current implementation this never happened because we used the

[lwip-users] unsent segments chain a loop?!

2014-02-26 Thread Fabian Koch
Hey all, I have a bug report where someone reports that the following section in tcp_out.c has led to an endless loop: In 1.3.2, line 550, in 1.4.1, line 934: /* useg should point to last segment on unacked queue */ useg = pcb->unacked; if (useg != NULL) { for (; useg->next != NULL; u

[lwip-users] socket API error values

2014-03-13 Thread Fabian Koch
Hey all, we just ported from 1.3.2 to 1.4.1 and some of our programs stopped working because the error codes the socket API returns apparently changed. can someone explain, why ERR_ISCONN is mapped to EALREADY in line 145 of sockets.c? static const int err_to_errno_table[] = { 0,

Re: [lwip-users] socket API error values

2014-03-17 Thread Fabian Koch
Hey Simon, > We tried to make the error values in sockets.c standard conformant, > so that's probably the reason they changed from 1.3.2 to 1.4.1. Do > you think there is an error in the compatiblity or do you just want > to get the old values back? Yeah you're right. EALREADY is what connect()

Re: [lwip-users] the sequentiality of the lwip stack

2014-03-18 Thread Fabian Koch
Hey all, > What I am not sure about is about multi-threading. I know that LWIP > runs well in a single thread (as I already used), but what I am > unsure about is if I can use different sockets on different threads > as long as each socket is used only by that thread... > Can anyone help on thi

[lwip-users] handle RST spoofing? CVE-2004-0230

2014-04-29 Thread Fabian Koch
Hey all, according to a nessus scan, LwIP is vulnerable to CVE-2004-0230, which means that it accepts a spoofed Packet with RST flag if the packets sequence number fits somewhere in the current window. http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2004-0230 http://cve.mitre.org/cgi-bin/cv

[lwip-users] Routing and link up/down vs. netif up/down

2014-06-04 Thread Fabian Koch
Hey guys, I ran into a problem and wonder if my solution is the right thing to do or if maybe LwIP should be changed: I have two netifs and they are both in the same subnet. When I create connections to other hosts on the net, they end up getting physically sent on the first netif because that

Re: [lwip-users] Routing and link up/down vs. netif up/down

2014-06-05 Thread Fabian Koch
Hey Simon, > This is the first problem. A setup like this is not really supported in lwIP. > We do have additional hooks to enable this, but it's not meant to work > out-of-the-box. I only found LWIP_HOOK_IP4_INPUT and LWIP_HOOK_IP4_ROUTE. > In recent versions (or in git master only?) you can p

[lwip-users] DHCP Unit tests fail

2014-06-30 Thread Fabian Koch
Hey all, I started using the unit tests with the unix port from lwip-contrib: * git cloned lwIP and lwIP-contrib * installed "check" (Ubuntu 12.04) $ cd lwIP-contrib/ports/unix/check $ make check Running suite(s): UDP TCP TCP_OOS MEM PBUF ETHARP DHCP 97%: Checks: 38, Failures: 1, Errors: 0 ../..

Re: [lwip-users] problem with multiple UDP sockets

2014-07-04 Thread Fabian Koch
Hey Mario, this looks like your communication partner doesn’t have the right IP set as target: ip_input: iphdr->dest 0xFEA9 netif->ip_addr 0x4301A8C0 (0xFFFEA9, 0x1A8C0, 0xFF00) ip_input: packet not for us. the destination IP is: 0xFEA9, which is 169.254.255.255 (that is the AutoIP

Re: [lwip-users] Multi-threaded socket access once again

2014-07-18 Thread Fabian Koch
Hey Steffen, Having said that, it seems like an okay setup if there are no other unexpected accesses. For example if another task closes the socket while your receive task is in the select() you'll also be in trouble. For our adaptation we modified LwIP to silently exit the select() call if th

Re: [lwip-users] Multi-threaded socket access once again

2014-07-21 Thread Fabian Koch
. The receiver thread does all the socket management, like open, close, bind, accept etc. and also controls the other submitting threads. But I'm not sure what happens if the remote site closes the connection unexpectedly, so I'll have to check that. Regards, Steffen Am 18.07.2014 14:5

Re: [lwip-users] Can't connect through netconn API

2014-07-22 Thread Fabian Koch
Hey, how is your &server declared and defined? Kind regards, Fabian -Original Message- From: lwip-users-bounces+fabian.koch=de.abb@nongnu.org [mailto:lwip-users-bounces+fabian.koch=de.abb@nongnu.org] On Behalf Of ALP-Schoof Sent: Dienstag, 22. Juli 2014 09:54 To: lwip-users@non

Re: [lwip-users] Sending to a non-local network without default netif set

2014-08-08 Thread Fabian Koch
Hey Mark, Simon, well it does work when introducing the source address in the routing algorithm and thats what I did for now. But obviously, Simon is right: routing doesn't have anything to do with the source address and it shouldn't have to. The underlying problem in LwIP at the moment is that

Re: [lwip-users] count active connection on server side

2014-08-14 Thread Fabian Koch
Hey mobin.seven, I had the same problem as we needed a form of "netstat" command. So we introduced this function in the socket API layer: unsigned long lwip_netstat(char *pcOut) { char *pcStart = pcOut; struct lwip_sock *sock; struct sockaddr name; socklen_t namelen = sizeof(struct sockad

Re: [lwip-users] handle RST spoofing? CVE-2004-0230

2014-09-18 Thread Fabian Koch
ers] handle RST spoofing? CVE-2004-0230 Fabian Koch wrote: according to a nessus scan, LwIP is vulnerable to CVE-2004-0230, which means that it accepts a spoofed Packet with RST flag if the packets sequence number fits somewhere in the current window. [..] The easiest way to handle this attac

[lwip-users] lwip_close blocks on non-blocking socket when cable is removed

2014-11-13 Thread Fabian Koch
Hey everyone, I'm using LwIP 1.4.1 and we noticed that on a non-blocking socket, lwip_close() suddenly starts being blocking when the cable is removed. This is because: lwip_close() -> netconn_delete() -> API_MSG -> do_delconn() -> do_close_internal() -> tcp_close() -> tcp_close_shutdown() -> t

Re: [lwip-users] Sending to a non-local network without default netif set

2014-11-17 Thread Fabian Koch
Hey Simon, Hey Erik, we do have a setup with two netifs and we cannot determine what the customer will do with the device so we need to also check for "same subnet" scenarios. I already wrote and email to this (or devel?) list about that a while ago. We also attacked the problem by including th

Re: [lwip-users] Sending to a non-local network without default netif set

2014-11-19 Thread Fabian Koch
the application layer you have to introduce some other identifier for addressing the different networks (can't use subnet). You end up having to forcing sockets onto the appropriate network with SO_BINDTODEVICE. If we want LwIP to detect a case like 2) that would be fine, but then how to do

[lwip-users] ERR_MEM in socket layer lwip_send() on non-blocking

2014-11-20 Thread Fabian Koch
Hey all, [using LwIP 1.4.1] we encountered some instances of lwip_send() setting sock->err to ERR_MEM even on non-blocking sockets. As ERR_MEM is not a fatal error and as there are plenty of if statements checking for blocking state and doing something different instead of returning this error,

[lwip-users] wrong checksum on some ICMP echo replies

2015-06-10 Thread Fabian Koch
Hey all, I found a bug in icmp.c for IPv4 in LWIP 1.4.1 (but it is also present in git master): When a client sends an ICMP echo request with ID 0, Sequence 0 and either no data or any amount of 0x00 Bytes as data, the checksum in the reply by LWIP is wrong (off-by-one). Expected checksum is

[lwip-users] TCP state machine problem? LWIP 1.4.1

2019-03-08 Thread Fabian Koch
Hey all, we had some weird behavior with a TCP connection on LWIP 1.4.1 when the peer (non-LWIP) has a cable disconnect: * LWIP has an established TCP connection #1 running fine * Peer has a cable disconnect * Our application on top of LWIP runs into a receive timeout and closes the

Re: [lwip-users] TCP state machine problem? LWIP 1.4.1

2019-03-11 Thread Fabian Koch
Hey Simon, > I know this might not be an option, but 1.4.1 is *really* old and > this one as well as numerous other things might already be fixed > in one of the newer versions. Yes. This is not an option unfortunately. We considered updating to 2.0.3 a while ago and I tried integrating it but

Re: [lwip-users] TCP state machine problem? LWIP 1.4.1

2019-03-18 Thread Fabian Koch
Update: Even when copying the current LWIP master state of the top of tcp_process() to my 1.4.1 working copy, the behavior still results in this RST/ACK pingpong. I fear that something in tcp_receive() has changed as well or even deeper? At least in the referenced bug report, the current state

[lwip-users] LWIP not ACKing data in retransmissions

2019-04-12 Thread Fabian Koch
Hey all, we have a weird behavior of one of our devices and I wonder if anyone could provide any pointers as to what is going on. (pcap attached) Scenario: * Our device is 172.22.66.200 in this capture * Other device is 172.22.67.200 * Pcap contains only one TCP stream between the t