buglwIP - A Lightweight TCP/IP stack - Bugs: bug #54315, IPV6_V6ONLY socket accepts IPV4...


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

bug #54315: IPV6_V6ONLY socket accepts IPV4 connections

Submitted by:  Joan Lledó <jllledo>
Submitted on:  Sun 15 Jul 2018 04:16:55 PM UTC  
Category:  IPv6 Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Simon Goldschmidt <goldsimon>
Open/Closed:  Closed Planned Release:  2.1.0
lwIP version:  git head

Wed 12 Sep 2018 04:11:36 PM UTC, comment #2: 

Please note that this fix will also resolve the following case:
- IPv4 & IPv6 activated,
- tcp_bind called with IP_ANY_TYPE as ipaddr parameter,
-> only IPv4 client is accepted because type 46 address isn't copied to pcb during the call of tcp_bind.


David GIRAULT <dgirault>
Mon 23 Jul 2018 07:49:56 PM UTC, comment #1: 

Fixed: http://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=258cab1b22327a31016fe9db92a98b2843f1c5a6

tcp_bind() did not update the local_ip in all required cases.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sun 15 Jul 2018 04:16:55 PM UTC, original submission:  


I observed a strange behaviour on a socket that has the option IPV6_V6ONLY enabled.

I follow these steps:

1.- Create an IPV6 only socket listening on ::
2.- Create an IPV4 socket listening on
3.- Call select() on both sockets
4.- From another terminal, run netcat and connect using an IPV4 address

The IPV6 only socket is being awaken by the stack, it shouldn't since it's not supposed to listen to IPV4 connections.

Attached is a test program. When I run it using lwip stack & sockets API, it prints:
New IPV6 connection , socket fd is 2 , ip is : , port : 34588

But when I run it using glibc and the linux stack, I see this:
New IPV4 connection , socket fd is 5 , ip is : , port : 56504

Which is the behaviour I assume is correct.

Joan Lledó <jllledo>


Attached Files
file #44560:  select6.c added by jllledo (8KiB - text/x-csrc)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by dgirault (Posted a comment)
  • -email is unavailable- added by goldsimon (Updated the item)
  • -email is unavailable- added by jllledo (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-23 goldsimon StatusNone => Fixed
        Assigned toNone => goldsimon
        Open/ClosedOpen => Closed
    2018-07-15 goldsimon Planned ReleaseNone => 2.1.0
    2018-07-15 jllledo Attached File- => Added select6.c, #44560

    Back to the top

    Powered by Savane 3.5