lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] [lwip] lwip 0.5.0 - it works


From: Horst Garnetzke
Subject: [lwip-users] [lwip] lwip 0.5.0 - it works
Date: Wed, 08 Jan 2003 22:27:07 -0000

Hi Adam,

currently testing your new 0.5.0 release on my motorola 68k
with smsc91c911:

httpd (with callback api)
echo-server (2 instances; with sequential api)
some ping from external

all concurrently: no problem! All works fine!
Gratulations!

May I ask for two little changes?
---------------------------------------------------------------
in inet.h

in the lwip source there are serveral calls to htonl() etc. -lower
case-, which are not needed in big endian models!

Please add for big endian the lower case definitions too:

#ifndef HTONS
#   if BYTE_ORDER == BIG_ENDIAN
#      define HTONS(n) (n)
#      define htons(n) (n)  /*** add until all source code is changed ***/
#   else /* BYTE_ORDER == BIG_ENDIAN */
#      define HTONS(n) (((((u16_t)(n) & 0xff)) << 8) | (((u16_t)(n) & 
0xff00) >> 8))
#   endif /* BYTE_ORDER == BIG_ENDIAN */
#endif /* HTONS */

...
#      define NTOHS(n) (n)
#      define ntohs(n) (n)
...
#      define HTONL(n) (n)
#      define htonl(n) (n)
...
#      define NTOHL(n) (n)
#      define ntohl(n) (n)
...

and exclude big endian models from the prototyping:

#ifndef _MACHINE_ENDIAN_H_
#ifndef _NETINET_IN_H
#ifndef _LINUX_BYTEORDER_GENERIC_H
#if BYTE_ORDER != BIG_ENDIAN  /*+hg*/
u16_t htons(u16_t n);
u16_t ntohs(u16_t n);
u32_t htonl(u32_t n);
u32_t ntohl(u32_t n);
#endif  /*+hg*/
#endif /* _LINUX_BYTEORDER_GENERIC_H */
#endif /* _NETINET_IN_H */
#endif /* _MACHINE_ENDIAN_H_ */

----------------------------------------------------------

in api_lib.c

During connection close netconn_delete tries to free an unassigned 
semaphore. Please add following if statement, or delete sys_sem_free():

netconn_delete(struct netconn *conn)
...
   sys_mbox_free(conn->mbox);
   conn->mbox = SYS_MBOX_NULL;
   if (conn->sem != SYS_SEM_NULL)  /*+hg to avoid freeing unassigned 
semaphores */
   sys_sem_free(conn->sem);
   /*  conn->sem = SYS_SEM_NULL;*/

------------------------------------------------------------

/Horst

-- 
Horst Garnetzke                      address@hidden

[This message was sent through the lwip discussion list.]




reply via email to

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