Allow package distributor to use configure option(--enable-nlcache=ARG) to specify a appropriate netlink socket buffer size for the platform they intend to run Quagga on.
Signed-off-by: Nolan Leake <[email protected]> Reviewed-by: Roopa Prabhu <[email protected]> Reviewed-by: Donald Sharp <[email protected]> --- configure.ac | 22 ++++++++++++++++++++++ zebra/main.c | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f68d86f..ba315ed 100755 --- a/configure.ac +++ b/configure.ac @@ -264,6 +264,8 @@ AC_ARG_ENABLE(ospf-te, AS_HELP_STRING([--disable-ospf-te],[disable Traffic Engineering Extension to OSPF])) AC_ARG_ENABLE(multipath, AS_HELP_STRING([--enable-multipath=ARG], [enable multipath function, ARG must be digit])) +AC_ARG_ENABLE(nlcache, + AS_HELP_STRING([--enable-nlcache=ARG], [enable Netlink Cache size function, ARG must be size in bytes])) AC_ARG_ENABLE(user, AS_HELP_STRING([--enable-user=USER], [user to run Quagga suite as (default quagga)])) AC_ARG_ENABLE(group, @@ -407,6 +409,26 @@ esac AC_SUBST(MULTIPATH_NUM) dnl ----------------------------------- +dnl The Netlink Cache size. This should +dnl be determined by experimentation on +dnl the platform you intend to run it on +dnl if you are not sure leave it alone +dnl ----------------------------------- +NLCACHE=0 +case "${enable_nlcache}" in + [[0-9]*]) + NLCACHE="${enable_nlcache}" + ;; + "") + ;; + *) + AC_MSG_FAILURE([Please specify digits to enable NL cache size ARG]) + ;; +esac + +AC_DEFINE_UNQUOTED(NLCACHE_SIZE, $NLCACHE, Cache size to use for Net Link in bytes) + +dnl ----------------------------------- dnl Add extra version string to package dnl name, string and version fields. dnl ----------------------------------- diff --git a/zebra/main.c b/zebra/main.c index d7f2a10..2fb43ac 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -61,7 +61,7 @@ int keep_kernel_mode = 0; #ifdef HAVE_NETLINK /* Receive buffer size for netlink socket */ -u_int32_t nl_rcvbufsize = 0; +u_int32_t nl_rcvbufsize = NLCACHE_SIZE; #endif /* HAVE_NETLINK */ /* Command line options. */ -- 1.7.10.4 _______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
