buglwIP - A Lightweight TCP/IP stack - Bugs: bug #45110, IPv6 sockaddr structures cleanups

 
 

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

bug #45110: IPv6 sockaddr structures cleanups

Submitter:  Joel Cunningham <jcunningham>
Submitted:  Fri 15 May 2015 02:08:06 PM UTC
   
 
Category:  sockets/netconn Severity:  2 - Minor
Item Group:  Change Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Wed 19 Aug 2015 08:16:49 AM UTC, comment #3: 

Fixed, thanks for reporting.

(note that task #13106 "Add IPv6 scopes" remains to be done)

Simon Goldschmidt <goldsimon>
Group administrator
Wed 24 Jun 2015 05:08:28 AM UTC, comment #2: 


> so this might solve that too


Unfortunately it doesn't. The patch only adds a scope member to struct sockaddr_in6, which is only set to zero. It doesn't handle scopes in lwIP internals, so is merely a compatibility fix for socket applications accessing this member in struct sockaddr_in6.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 15 May 2015 03:12:18 PM UTC, comment #1: 

Thanks for submitting, I don't work much with sockets, I stick to netconn, but I'll look into it. we have an old open bug or task regarding scopes for IPv6 addresses, so this might solve that too.

Ivan Delamer <idelamer>
Group Member
Fri 15 May 2015 02:08:06 PM UTC, original submission:  

In familiarizing myself with LwIP's IPv6 implementation, I've spotted a couple of minor issues with struct sockaddr changes for IPv6

1)  sockaddr_in6 doesn't contain sin6_scope_id as required by the Open Group specification and RFC 3493. The Open Group specification lists sin6_scope_id as one of the "minimum required fields".  Even if LwIP's implementation doesn't currently support the scope ID, we should at least maintain application compatibility with the structure.

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html
http://tools.ietf.org/html/rfc3493#section-3.4

2) The struct sockaddr has a separate sa_data define when LWIP_IPV6 is set that adds extra bytes.  This is unnecessary because with the addition of IPv6, sockaddr_storage should be used by applications when there needs to be storage large enough for either a sockaddr_in or sockaddr_in6.

I doubled checked with the Steven's book: Unix Network Programming - Vol 1 Third Edition, which has been updated for IPv6.  The definition given in the book for sa_data is 14 bytes and is unchanged for IPv6 additions.

I have provided a patch that addresses both of these minor issues

Joel Cunningham <jcunningham>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #34018:  0001-IPv6-sockaddr-clean-ups.patch added by jcunningham (3KiB - application/octet-stream)

 

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 idelamer (Posted a comment)
  • -email is unavailable- added by jcunningham (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-19 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2015-05-15 jcunningham Attached File- Added 0001-IPv6-sockaddr-clean-ups.patch, #34018

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code