bgpd: Warn user that bgp is setting maximum-paths larger than MULTIPATH_NUM

In cases where a distribution has compiled zebra with a MULTIPATH_NUM
that is less than what the user is setting the maximum-paths in bgp,
warn them that some of the nexthops will not make it into zebra and
by extension the kernel for routing.  The command is still accepted.

dell-s6000-02(config)# router bgp 100
dell-s6000-02(config-router)# maximum-paths 3
% Warning: maximum-paths set to 3 is greater than 2 that zebra is compiled to support
dell-s6000-02(config-router)# maximum-paths ibgp 44
% Warning: maximum-paths set to 44 is greater than 2 that zebra is compiled to support
dell-s6000-02(config-router)#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am
index 4659ac6..b2614f4 100644
--- a/bgpd/Makefile.am
+++ b/bgpd/Makefile.am
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in.
 
 AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
+DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@
 INSTALL_SDATA=@INSTALL@ -m 600
 
 AM_CFLAGS = $(WERROR)
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 6233163..4fd255f 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -676,6 +676,11 @@
       return CMD_WARNING;
     }
 
+  if ((MULTIPATH_NUM != 0) && (maxpaths > MULTIPATH_NUM))
+    vty_out (vty,
+	     "%% Warning: maximum-paths set to %d is greater than %d that zebra is compiled to support%s",
+	     maxpaths, MULTIPATH_NUM, VTY_NEWLINE);
+
   return CMD_SUCCESS;
 }
 
@@ -704,6 +709,11 @@
       return CMD_WARNING;
     }
 
+  if ((MULTIPATH_NUM != 0) && (maxpaths > MULTIPATH_NUM))
+    vty_out (vty,
+	     "%% Warning: maximum-paths set to %d is greater than %d that zebra is compiled to support%s",
+	     maxpaths, MULTIPATH_NUM, VTY_NEWLINE);
+
   return CMD_SUCCESS;
 }