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.

Submitted by:  Douglas <ourairquality>
Submitted on:  Mon 17 Jul 2017 02:49:52 PM UTC  
 
Category: IPv6Severity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
Mon 17 Jul 2017 02:49:52 PM UTC, original submission:
Douglas <ourairquality>

 

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 18 Jul 2017 05:54:32 PM UTCgoldsimonStatusIn Progress=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Mon 17 Jul 2017 11:26:18 PM UTCourairqualityAttached File-=>Added 0001-Correct-a-few-uses-of-sizeof-ip6_addr_t-to-sizeof-ip.patch, #41227
    Mon 17 Jul 2017 08:01:02 PM UTCgoldsimonAssigned tojcunningham=>None
    Mon 17 Jul 2017 06:51:54 PM UTCgoldsimonStatusNone=>In Progress
      Assigned toNone=>jcunningham
    Mon 17 Jul 2017 02:49:52 PM UTCourairqualityAttached File-=>Added 0001-Add-IP6_ADDR_SIZE-and-use-this-rather-than-sizeof-ip.patch, #41223

    Back to the top


    Powered by Savane 3.1-cleanup1