tasklwIP - A Lightweight TCP/IP stack - Tasks: task #13512, check how IPv6 handles the...

 
 

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

task #13512: check how IPv6 handles the "no address" case for routing

Submitter:  Sylvain Rochet <gradator>
Submitted:  Sat 07 Mar 2015 07:35:30 PM UTC
   
 
Category:  IPv6 Should Start On:  Sat 07 Mar 2015 12:00:00 AM UTC
Should be Finished on:  Sat 07 Mar 2015 12:00:00 AM UTC Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Percent Complete:  100%
Open/Closed:  Closed Planned Release:  None
Effort:  0.00

Jump to the original submission

Fri 20 Mar 2015 08:05:33 PM UTC, comment #10: 

Yep, thanks for clarification.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 18 Mar 2015 08:14:59 PM UTC, comment #9: 

So I'm pretty sure that with the current ip6_route() and ip6_select_source_address() we should have the expected results.

Can we close this task?

Ivan Delamer <idelamer>
Group Member
Tue 10 Mar 2015 07:51:22 PM UTC, comment #8: 

I'll attach a diff of how I would solve this.

(file #33306)

Simon Goldschmidt <goldsimon>
Group administrator
Tue 10 Mar 2015 07:21:37 PM UTC, comment #7: 

Is this a matter of RFC conformance? I thought it was just about integrating our internal netif states (potentially down/no link) into what the RFC says about routing?

Simon Goldschmidt <goldsimon>
Group administrator
Tue 10 Mar 2015 07:11:33 PM UTC, comment #6: 

I remember when I implemented this I was following RFC but I'll double check it for non-LL addresses.

Ivan Delamer <idelamer>
Group Member
Mon 09 Mar 2015 08:22:18 PM UTC, comment #5: 


> I'm not sure we should drop outgoing packets to an external network if we have no routable address


Looking at the code, I think I need a bit of IPv6 lessons. As I see it, we have two cases:
- sending to a link-local address or a subnet that matches one of the netifs, which results pretty much in the same: sending a unicast ethernet packet to a specific mac address
- sending to a non-link-local (i.e. routable) address that does not match any local subnet. In this case we send to a router (much like IPv4 netif's 'gw').

Just to prevent misunderstandings: I wouldn't prevent sending to matching subnets just because the netif doesn't have a routable address set. I would prevent sending to non-local-match addresses on netifs without a routable address. But this seems already the case in 'nd6_select_router()'.

As a result, there are 2 things to change left in ip6_route():
- when sending to local subnets, check up/link-up state of netifs
- when sending to non-local subnets, check if the netif returned by nd6_select_router() is up/link-up.

However, in the 2nd case, it might be better to check up/link-up inside nd6_select_router().

Simon Goldschmidt <goldsimon>
Group administrator
Mon 09 Mar 2015 07:09:11 PM UTC, comment #4: 


> We could add a check so that ip6_address[0] is configured


Would that be:

if (ip6_addr_isvalid(netif_ip6_addr_state(netif, 0))

or directly be checking the address?

And one question remains: after all the checks to find a matching interface, we fall back to the default netif. What if the default netif then is down or has no link, which one do we use then? The first up with a link?

Simon Goldschmidt <goldsimon>
Group administrator
Mon 09 Mar 2015 04:43:47 PM UTC, comment #3: 

There should always be a LL address configured, and possibly a routable address as well.

I'm not sure we should drop outgoing packets to an external network if we have no routable address. In general ip6_route() will just not select that netif, unless a router is configured.

We could add a check so that ip6_address[0] is configured.

Ivan Delamer <idelamer>
Group Member
Sat 07 Mar 2015 07:55:45 PM UTC, comment #2: 

yes, link-local are not routable at all, we should actually only check routable addresses.

Sylvain Rochet <gradator>
Group Member
Sat 07 Mar 2015 07:43:02 PM UTC, comment #1: 

I'm just looking at ip6_route() (in the context of bug #43904 -ip_route() and ip6_route() must detect linkup status).

The question to me is do we have to differ between link-local and routable addresses here? I would have thought yes, meaning we should
- check if the netif has a link-local address set if 'dest' is a link-local address and
- check if the netif has a routable address set if 'dest' is not a link-local address

Does that make sense in the IPv6 world? Unfortunately, I'm not too used to IPv6 to answer this myself :-(

Simon Goldschmidt <goldsimon>
Group administrator
Sat 07 Mar 2015 07:35:30 PM UTC, original submission:  

IPv6 routing should not select a netif that has no IP address
assigned (i.e ::0).

Sylvain Rochet <gradator>
Group Member

 

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

Attached Files
file #33306:  task13512_ip6route_check_up_and_link.diff added by goldsimon (5KiB - 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 idelamer (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by gradator (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-20 goldsimon StatusNone Done
        Percent Complete0% 100%
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2015-03-10 goldsimon Attached File- Added task13512_ip6route_check_up_and_link.diff, #33306

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code