git: netinet: Improve the deletion of loopback route

Aaron LI aly at crater.dragonflybsd.org
Wed Mar 20 08:33:50 PDT 2024


commit 5e1a59d50106269ced09d6be098182a9bfaf33da
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Mar 20 23:20:26 2024 +0800

    netinet: Improve the deletion of loopback route
    
    When the target host address is still bound to another interface address
    (e.g., an address on another interface added later), the loopback route
    should be updated to point to that address instead of simply being
    removed.
    
    Given that our rtrequest1() only supports route addition and deletion,
    but not route change, we have to first remove the original loopback
    route and then re-add a route with the wanted interface address.
    
    See also in_localip_more() and ifa_switch_loopback_route() in FreeBSD.

Summary of changes:
 sys/net/if.c     |  3 +++
 sys/netinet/in.c | 34 +++++++++++++++++++++++++++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5e1a59d50106269ced09d6be098182a9bfaf33da


-- 
DragonFly BSD source repository


More information about the Commits mailing list