* lib/plist.c: (vty_prefix_list_install) Check afi/safi is supported and warn
  if not, as a safeguard and to ensure the user is warned, if somehow that
  code is ever called for non-IP AFI.
---
 lib/plist.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/plist.c b/lib/plist.c
index f2621eb..3d378a8 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -681,7 +681,16 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const 
char *name,
   int seqnum = -1;
   int lenum = 0;
   int genum = 0;
-
+  
+  /* This code only works for IP.  Provide a safe-guard and user-visible
+   * warning
+   */
+  if (!(afi == AFI_IP || afi == AFI_IP6))
+    {
+      vty_out (vty, "%% prefix must be IPv4 or IPv6!%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  
   /* Sequential number. */
   if (seq)
     seqnum = atoi (seq);
-- 
2.5.5


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to