lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #8680] Add support for LwIP static route table


From: David van Moolenbroek
Subject: [lwip-devel] [patch #8680] Add support for LwIP static route table
Date: Wed, 14 Dec 2016 14:33:55 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #16, patch #8680 (project lwip):

Alright, thank you!!

Now, I really hate to do a "now that you've merged X, here's Y and Z" kind of
thing, and so I apologize for this, but I'm just figuring things out myself
here.. :) and as such I would like to suggest the following additional
patches, all in the context of static routing. These would be helpful to me,
and hopefully to others, but they're definitely not crucial. As always, I'd be
happy to make additional changes to the patches if that helps.

0001-nd6-add-nd6_clear_destination_cache-function:

Given that the new hook sits behind the destination cache, any change to what
the hook would return should also cause the destination cache to be
invalidated. For example, after adding or removing a static route, the
destination cache may contain stale entries. So, any static-route code would
want to clear it, and preferably without having to mess with the nd6 data
structures directly. So, this patch adds a function to clear the nd6
destination cache. Note that I do not see a good way (or a pressing reason) to
make it invalidate only a subset of the cache.

I would be happy to put this new function behind a specific #if (suggestions
welcome!) but as noted in the patch, strictly speaking, the destination cache
may also have to be cleared in other cases, such as when adding or removing
local IPv6 addresses to netifs. So it just might be useful for a larger group
of users.

In any case, I'm afraid this might only be scratching the surface when it
comes to nd6 cache invalidation. For example, I expected code that would clear
the destination cache whenever it is decided that a particular router is no
longer usable, but I can find no such thing..

0002-nd6-use-default_router_list-internally-only:

This patch just moves code around a bit. Specifically, the route code in ip6.c
currently uses the nd6 "default_router_list" data structure directly. From a
general software engineering perspective it would be cleaner to move that part
into nd6, as also suggested in a todo item in nd6.h [*].

The gain for me here is that I can then use this new nd6_find_route() function
directly from my routing hook, so that I can fully control the routing
decisions myself (and, for instance, know when to generate RTM_MISS routing
socket messages--stuff like that) without relying on nd6 data structure
internals.

As an aside, nd6_select_router() keeps a "last_router" variable but doesn't
actually use it, what's up with that?

[*] I would actually be against making those data structures static though,
but for another reason: I'd like to be able to support an ndp(8) utility that
can dump ND information. But that is a lot less important to me overall. Also,
I haven't actually gotten that far yet.. ugh, so much to do!

(file #39221, file #39222)
    _______________________________________________________

Additional Item Attachment:

File name: 0001-nd6-add-nd6_clear_destination_cache-function.patch Size:1 KB
File name: 0002-nd6-use-default_router_list-internally-only.patch Size:3 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8680>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]