buglwIP - A Lightweight TCP/IP stack - Bugs: bug #51492, IPv6 DNS fix, was using...

 
 

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

bug #51492: IPv6 DNS fix, was using sizeof(ip6_addr_t) which is not always 16.

Submitter:  Douglas <ourairquality>
Submitted:  Mon 17 Jul 2017 02:49:52 PM UTC
   
 
Category:  IPv6 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Tue 18 Jul 2017 05:54:32 PM UTC, comment #5: 

Right. Thanks for the input David!

Simon Goldschmidt <goldsimon>
Group administrator
Tue 18 Jul 2017 04:05:38 PM UTC, comment #4: 

FWIW: the updated patch (0001-Correct-..) looks good to me!

That just leaves the issue of assigning a zone to scoped IPv6 DNS answers, which is somewhat of a separate issue anyway. Perhaps just adding a @todo comment in the dns code is the best option for now..

David van Moolenbroek <dcvmoole>
Mon 17 Jul 2017 08:35:15 PM UTC, comment #3: 

Hmm well, here's my advice:
- for now, it is most consistent (within lwIP) to use ip6_addr_p_t for stored IPv6 addresses (i.e. on-the-wire, part of a packet header or packet data);
- as such, for the byte size of an IPv6 address (16), I'd use sizeof(ip6_addr_p_t), just like the rdnss code in nd6.c does already, instead of a new #define;
- using ip6_addr_p_t in core/dns.c also means that ip_addr_copy_from_ip6_packed() should be used instead of the current non-_packed version;
- that way the DNS answer does indeed end up with a zone of zero (i.e. no zone); it would be possible to assign a zone based on the netif receiving the DNS response, but does that really make sense? I am not familiar with scenarios where DNS is used for link-local addresses at all, but maybe someone with more practical experience can weigh in here;
- the sif6addr code only passes the produced IPv6 address to netif_ip6_addr_set(), which in turn assigns a zone by itself, so the PPP code should already be fine as is.

David van Moolenbroek <dcvmoole>
Mon 17 Jul 2017 08:01:02 PM UTC, comment #2: 

Ooops, sorry Joel, this was meant for David. Just got a little confused here :-)

Simon Goldschmidt <goldsimon>
Group administrator
Mon 17 Jul 2017 06:51:54 PM UTC, comment #1: 

The patch fixes the sizes (and I'll apply that), but seems to omit setting the scopes.
Joel, could you help here, I'm still not too familiar with those scopes :-) I'd just set them to UNICAST/netif ...
There seems to be one more scope issue in ppp: sif6addr()

Simon Goldschmidt <goldsimon>
Group administrator
Mon 17 Jul 2017 02:49:52 PM UTC, original submission:  


Douglas <ourairquality>

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dcvmoole (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by ourairquality (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-18 goldsimon StatusIn Progress Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2017-07-17 ourairquality Attached File- Added 0001-Correct-a-few-uses-of-sizeof-ip6_addr_t-to-sizeof-ip.patch, #41227
    2017-07-17 goldsimon Assigned tojcunningham None
    2017-07-17 goldsimon StatusNone In Progress
        Assigned toNone jcunningham
    2017-07-17 ourairquality Attached File- Added 0001-Add-IP6_ADDR_SIZE-and-use-this-rather-than-sizeof-ip.patch, #41223

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code