From f833694d4f6a6dffabc6a4e552ecbd40aa3ce479 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Mon, 26 Oct 2015 12:29:37 +0100 Subject: networkd: route - add expiration support This should really live in the kernel, but the netlink API currently does not support it. Until support has been added, expire the route from userspace. --- src/network/networkd-route.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/network/networkd-route.h') diff --git a/src/network/networkd-route.h b/src/network/networkd-route.h index 785bd1663a..d0a51838ed 100644 --- a/src/network/networkd-route.h +++ b/src/network/networkd-route.h @@ -46,6 +46,9 @@ struct Route { union in_addr_union src; union in_addr_union prefsrc; + usec_t lifetime; + sd_event_source *expire; + LIST_FIELDS(Route, routes); }; @@ -61,6 +64,8 @@ int route_add_foreign(Link *link, int family, union in_addr_union *dst, unsigned int route_update(Route *route, union in_addr_union *src, unsigned char src_prefixlen, union in_addr_union *gw, union in_addr_union *prefsrc, unsigned char scope, unsigned char protocol); void route_drop(Route *route); +int route_expire_handler(sd_event_source *s, uint64_t usec, void *userdata); + DEFINE_TRIVIAL_CLEANUP_FUNC(Route*, route_free); #define _cleanup_route_free_ _cleanup_(route_freep) -- cgit v1.2.3-54-g00ecf