Date: Wed, 8 Jan 2014 23:09:02 +0000 (UTC) From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260460 - head/sys/net Message-ID: <201401082309.s08N92Ij012375@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: melifaro Date: Wed Jan 8 23:09:02 2014 New Revision: 260460 URL: http://svnweb.freebsd.org/changeset/base/260460 Log: Constanly use RT_ALL_FIBS everywhere instead of -1. MFC after: 2 weeks Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Jan 8 22:37:18 2014 (r260459) +++ head/sys/net/route.c Wed Jan 8 23:09:02 2014 (r260460) @@ -1498,7 +1498,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int fibnum = RT_DEFAULT_FIB; break; } - if (fibnum == -1) { + if (fibnum == RT_ALL_FIBS) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { startfib = endfib = curthread->td_proc->p_fibnum; } else { @@ -1702,7 +1702,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int int rtinit_fib(struct ifaddr *ifa, int cmd, int flags) { - return (rtinit1(ifa, cmd, flags, -1)); + return (rtinit1(ifa, cmd, flags, RT_ALL_FIBS)); } #endif @@ -1726,7 +1726,7 @@ rtinit(struct ifaddr *ifa, int cmd, int case AF_INET6: case AF_INET: /* We do support multiple FIBs. */ - fib = -1; + fib = RT_ALL_FIBS; break; } return (rtinit1(ifa, cmd, flags, fib)); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Jan 8 22:37:18 2014 (r260459) +++ head/sys/net/route.h Wed Jan 8 23:09:02 2014 (r260460) @@ -92,7 +92,8 @@ struct rt_metrics { #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ -extern u_int rt_numfibs; /* number fo usable routing tables */ +#define RT_ALL_FIBS -1 /* Announce event for every fib */ +extern u_int rt_numfibs; /* number of usable routing tables */ /* * XXX kernel function pointer `rt_output' is visible to applications. */ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Wed Jan 8 22:37:18 2014 (r260459) +++ head/sys/net/rtsock.c Wed Jan 8 23:09:02 2014 (r260460) @@ -160,7 +160,6 @@ int (*carp_get_vhid_p)(struct ifaddr *); * notification to a socket bound to a particular FIB. */ #define RTS_FILTER_FIB M_PROTO8 -#define RTS_ALLFIBS -1 static struct { int ip_count; /* attached w/ AF_INET */ @@ -1288,7 +1287,7 @@ rt_missmsg_fib(int type, struct rt_addri if (m == NULL) return; - if (fibnum != RTS_ALLFIBS) { + if (fibnum != RT_ALL_FIBS) { KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: fibnum out " "of range 0 <= %d < %d", __func__, fibnum, rt_numfibs)); M_SETFIB(m, fibnum); @@ -1306,7 +1305,7 @@ void rt_missmsg(int type, struct rt_addrinfo *rtinfo, int flags, int error) { - rt_missmsg_fib(type, rtinfo, flags, error, RTS_ALLFIBS); + rt_missmsg_fib(type, rtinfo, flags, error, RT_ALL_FIBS); } /* @@ -1402,7 +1401,7 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr rtm->rtm_errno = error; rtm->rtm_addrs = info.rti_addrs; } - if (fibnum != RTS_ALLFIBS) { + if (fibnum != RT_ALL_FIBS) { KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: " "fibnum out of range 0 <= %d < %d", __func__, fibnum, rt_numfibs)); @@ -1417,7 +1416,7 @@ void rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt) { - rt_newaddrmsg_fib(cmd, ifa, error, rt, RTS_ALLFIBS); + rt_newaddrmsg_fib(cmd, ifa, error, rt, RT_ALL_FIBS); } /* @@ -1930,7 +1929,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) if (namelen == 3) fib = req->td->td_proc->p_fibnum; else if (namelen == 4) - fib = (name[3] == -1) ? + fib = (name[3] == RT_ALL_FIBS) ? req->td->td_proc->p_fibnum : name[3]; else return ((namelen < 3) ? EISDIR : ENOTDIR);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401082309.s08N92Ij012375>