svn commit: r271916 - head/sys/net

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Sun Sep 21 06:45:02 UTC 2014


On 21 Sep 2014, at 03:48 , Hiroki Sato <hrs at FreeBSD.org> wrote:

> Author: hrs
> Date: Sun Sep 21 03:48:20 2014
> New Revision: 271916
> URL: http://svnweb.freebsd.org/changeset/base/271916
> 
> Log:
>  Make net.add_addr_allfibs vnet-local.

I guess it was this one:

In file included from /scratch/tmp/bz/head.svn/lib/libc/net/getifaddrs.c:42:
/storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/route.h:89:21: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */
                    ^~~~~~~~~~~~~~~~~~~
/storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/route.h:89:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */
^~~~~~~~~~~~
2 errors generated.
--- getifaddrs.So ---
*** [getifaddrs.So] Error code 1

bmake: stopped in /scratch/tmp/bz/head.svn/lib/libc
In file included from /scratch/tmp/bz/head.svn/lib/libc/net/getifmaddrs.c:37:
/storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/route.h:89:21: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */
                    ^~~~~~~~~~~~~~~~~~~
/storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/route.h:89:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */
^~~~~~~~~~~~




> 
> Modified:
>  head/sys/net/route.c
>  head/sys/net/route.h
> 
> Modified: head/sys/net/route.c
> ==============================================================================
> --- head/sys/net/route.c	Sun Sep 21 03:00:30 2014	(r271915)
> +++ head/sys/net/route.c	Sun Sep 21 03:48:20 2014	(r271916)
> @@ -108,9 +108,9 @@ SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLA
>  * always work given the fib can be overridden and prefixes can be added
>  * from the network stack context.
>  */
> -u_int rt_add_addr_allfibs = 1;
> -SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN,
> -    &rt_add_addr_allfibs, 0, "");
> +VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1;
> +SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET,
> +    &VNET_NAME(rt_add_addr_allfibs), 0, "");
> 
> VNET_DEFINE(struct rtstat, rtstat);
> #define	V_rtstat	VNET(rtstat)
> @@ -1613,9 +1613,9 @@ rtinit1(struct ifaddr *ifa, int cmd, int
> 		break;
> 	}
> 	if (fibnum == RT_ALL_FIBS) {
> -		if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) {
> +		if (V_rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD)
> 			startfib = endfib = ifa->ifa_ifp->if_fib;
> -		} else {
> +		else {
> 			startfib = 0;
> 			endfib = rt_numfibs - 1;
> 		}
> 
> Modified: head/sys/net/route.h
> ==============================================================================
> --- head/sys/net/route.h	Sun Sep 21 03:00:30 2014	(r271915)
> +++ head/sys/net/route.h	Sun Sep 21 03:48:20 2014	(r271916)
> @@ -34,6 +34,7 @@
> #define _NET_ROUTE_H_
> 
> #include <sys/counter.h>
> +#include <net/vnet.h>
> 
> /*
>  * Kernel resident routing tables.
> @@ -85,7 +86,8 @@ struct rt_metrics {
> #define	RT_DEFAULT_FIB	0	/* Explicitly mark fib=0 restricted cases */
> #define	RT_ALL_FIBS	-1	/* Announce event for every fib */
> extern u_int rt_numfibs;	/* number of usable routing tables */
> -extern u_int rt_add_addr_allfibs;	/* Announce interfaces to all fibs */
> +VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */
> +#define	V_rt_add_addr_allfibs	VNET(rt_add_addr_allfibs)
> 
> /*
>  * We distinguish between routes to hosts and routes to networks,
> 

— 
Bjoern A. Zeeb             "Come on. Learn, goddamn it.", WarGames, 1983



More information about the svn-src-head mailing list