lib: vty_prefix_list_install should validate afi/safi
* 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.
diff --git a/lib/plist.c b/lib/plist.c
index 2176c03..644506b 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -675,7 +675,16 @@
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);