lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Desiderata for 2.2.0: better support for Debian packagi


From: Joan Lledó
Subject: Re: [lwip-devel] Desiderata for 2.2.0: better support for Debian packaging and VirtualSquare
Date: Sat, 14 Jan 2023 18:43:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Hi,

El 8/1/23 a les 19:10, Renzo Davoli ha escrit:
You are right. This approach was to minimize the impact for the other
architectures that may include src/Filelists.cmake.
Any other way to exclude slipif fits, e.g. a cmake variable used as a flag,
say if LWIP_EXCLUDE_SLIPIF is set slipif.c is *not* added.

I don't have a strong opinion, if the alternatives are too complex it's OK for me to apply the patch as it is.

I have just:
* got the debian package source: 'apt-get source liblwip0'
* added slipif.c in /src/FileLists.cmake
   set(lwipnetif_SRCS
       ${LWIP_DIR}/src/netif/ethernet.c
       ${LWIP_DIR}/src/netif/bridgeif.c
       ${LWIP_DIR}/src/netif/bridgeif_fdb.c
       ${LWIP_DIR}/src/netif/slipif.c
   )

* built and installed the debian package:
   $ debuild -b -us -uc
   $ cd ..
   $ sudo dpkg -i liblwip0_2.1.3+dfsg1-2_amd64.deb
   $ sudo dpkg -i liblwip-dev_2.1.3+dfsg1-2_amd64.deb

* compiled a test source... here is what I got:
   $ gcc -o cli cli.c -I /usr/include/lwip -llwip
   /usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/liblwip.so: 
undefined reference to `sio_tryread'
   /usr/bin/ld: 
/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/liblwip.so: 
undefined reference to `sio_read'
   collect2: error: ld returned 1 exit status

IMO slipif.c must be skipped, or an implementation of sio_tryread and
sio_read must be provided, maybe a stub implementation, otherwise
there are unresolved symbols.

OK, I'm probably wrong here, could you send me the code for cli.c, please?

Again my approach was to be as conservative as possible to avoid
side effects for other architectures/projects.

Your "port" patch for Debian adds a specific lwipopts.h file and two
'external headers': posix/inet.h, posix/sockets.h
Your lwipopts.h is significantly different from that in contrib/port/unix/lib
and the include files are not in the lwip source tree, thus the idea to add
a specific linux lib directory under the unix port.

Maybe you have a better view and knowledge of the projects using
the unix/lib code and you can see that it is safe to merge/update the code of
the unix library.

I vote for a new library, it is a surely safe choice. If the name linuxlib is
misleading we can call it debianlib or posixlib (one main point
is that the new lib uses posix compatible socket definitions).
The code needed for the new lib is just:
CMakeLists + lwipopts.h + posix/inet.h + posix/sockets.h


posixlib sounds good to me. I forgot to mention: I don't mind changing the license to BSD to make the patches upstream.

 From a very quick check it seems that the 'max_sockets' patch applies
almost flawlessly.
Apart from some line offsets, the only changes needed appear to be:
* a problem with the context at src/api/sockets.c:1777, the current
patch fails due to a different name of a variable in the previous line,
it needs to be patched by hand:
-  done_socket(&sockets[i - LWIP_SOCKET_OFFSET]);
+  done_socket(translate_socket(i - LWIP_SOCKET_OFFSET));
* the new path of the lwipopts.h file.

Applying it to which version? to 2.1.3? Yes, max_sockets for 2.1.2 applies fine to 2.1.3, which made upgrading the package easier, but it might not be the case for next versions.

Regards,
Joan



reply via email to

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