Date: Mon, 6 Jun 2016 12:49:47 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301502 - head/sys/net Message-ID: <201606061249.u56CnlW1029557@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Mon Jun 6 12:49:47 2016 New Revision: 301502 URL: https://svnweb.freebsd.org/changeset/base/301502 Log: Provide a public interface to rt_flushifroutes which takes the address family as an argument as well. This will be used to cleanup individual protocols during VNET teardown. Obtained from: projects/vnet Sponsored by: The FreeBSD Foundation Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jun 6 11:10:37 2016 (r301501) +++ head/sys/net/route.c Mon Jun 6 12:49:47 2016 (r301502) @@ -1141,6 +1141,15 @@ rt_ifdelroute(const struct rtentry *rt, * to this interface...oh well... */ void +rt_flushifroutes_af(struct ifnet *ifp, int af) +{ + KASSERT((af >= 1 && af <= AF_MAX), ("%s: af %d not >= 1 and <= %d", + __func__, af, AF_MAX)); + + rt_foreach_fib_walk_del(af, rt_ifdelroute, ifp); +} + +void rt_flushifroutes(struct ifnet *ifp) { Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Mon Jun 6 11:10:37 2016 (r301501) +++ head/sys/net/route.h Mon Jun 6 12:49:47 2016 (r301502) @@ -468,6 +468,7 @@ typedef int rt_walktree_f_t(struct rtent typedef void rt_setwarg_t(struct rib_head *, uint32_t, int, void *); void rt_foreach_fib_walk(int af, rt_setwarg_t *, rt_walktree_f_t *, void *); void rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg); +void rt_flushifroutes_af(struct ifnet *, int); void rt_flushifroutes(struct ifnet *ifp); /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606061249.u56CnlW1029557>