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 */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to