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

Submitted by:  Joel Cunningham <jcunningham>
Submitted on:  Fri 15 May 2015 02:08:06 PM UTC  
 
Category: sockets/netconnSeverity: 2 - Minor
Item Group: Change RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project 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>
Project Member

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 19 Aug 2015 08:16:49 AM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Fri 15 May 2015 02:08:06 PM UTCjcunninghamAttached File-=>Added 0001-IPv6-sockaddr-clean-ups.patch, #34018

    Back to the top


    Powered by Savane 3.1-cleanup1