patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9456, cleanup ioctlsocket for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9456: cleanup ioctlsocket for LWIP_COMPAT_SOCKETS == 2

Submitted by:  Joel Cunningham <jcunningham>
Submitted on:  Thu 21 Sep 2017 04:16:37 PM UTC  
 
Category:  sockets/netconn Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  Joel Cunningham <jcunningham> Open/Closed:  Closed
Planned Release:  None

Fri 22 Sep 2017 01:54:09 PM UTC, comment #4: 

Patch submitted in 6cdfae124552d6ffb8b647d2391c71905d752437

> Right. I guess my main confusion is about why we define winsock function names by default when LWIP_COMPAT_SOCKETS is enabled.

Also the classification of functions into LWIP_POSIX_SOCKETS_IO_NAMES is not really clear, I guess. I think that block followed user requests...

Yes I agree the use of winsock names is a little strange, but now things are more consistent :)

Joel Cunningham <jcunningham>
Project MemberIn charge of this item.
Fri 22 Sep 2017 04:38:42 AM UTC, comment #3: 

Right. I guess my main confusion is about why we define winsock function names by default when LWIP_COMPAT_SOCKETS is enabled.
Also the classification of functions into LWIP_POSIX_SOCKETS_IO_NAMES is not really clear, I guess. I think that block followed user requests...

Reviewing it again, I think your patch is good. Sorry for the noise :-)

Simon Goldschmidt <goldsimon>
Project Administrator
Thu 21 Sep 2017 07:11:35 PM UTC, comment #2: 

> I think I would rather make "ioctlsocket" behave the same way as "closesocket".


That's what I was trying to do with the patch, not sure where the behavior is different.

As I understand it, we have the following 3 names:

Lwip function: lwip_close
Winsock: closesocket
POSIX: close

Lwip function: lwip_ioctl
Winsock: ioctlsocket
POSIX: ioctl

For LWIP_COMPAT_SOCKETS == 2, lwip_close -> closesocket.

Additionally if LWIP_POSIX_SOCKETS_IO_NAMES == 1, lwip_close -> close and closesocket -> close

The patch establishes the same relationships for ioctl:

For LWIP_COMPAT_SOCKETS == 2, lwip_ioctl -> ioctlsocket

Additionally if LWIP_POSIX_SOCKETS_IO_NAMES == 1, lwip_ioctl -> ioctl and ioctlsocket -> ioctl

Joel Cunningham <jcunningham>
Project MemberIn charge of this item.
Thu 21 Sep 2017 07:00:18 PM UTC, comment #1: 

Ehrm, the existing code indeed looks like a mess. However, I don't really understand your patch, either.

The resulting code would still define "lwipioctl" for all platforms even if this is a windows-only name. OK, we do have closesocket in the LWIP_POSIX_SOCKETS_IO_NAMES guard, but that's a different story.

I think I would rather make "ioctlsocket" behave the same way as "closesocket".

Simon Goldschmidt <goldsimon>
Project Administrator
Thu 21 Sep 2017 04:16:37 PM UTC, original submission:  

Found these issue when enabling LWIP_COMPAT_SOCKETS == 2:

Attached patch makes two cleanups that follows the same organization as close/closesocket:

 1) There is no lwip_ioctlsocket. Instead lwip_ioctl should redirect to ioctlsocket
 2) With LWIP_POSIX_SOCKETS_IO_NAMES enabled, lwip_ioctl/ioctlsocket should redirect to ioctl

Joel Cunningham <jcunningham>
Project MemberIn charge of this item.

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by jcunningham (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-22 jcunningham StatusNone => Done
    2017-09-22 jcunningham Open/ClosedOpen => Closed
    2017-09-21 jcunningham Attached File- => Added 0001-sockets-cleanup-ioctlsocket-for-LWIP_COMPAT_SOCKETS-.patch, #41855

    Back to the top


    Powered by Savane 3.5