summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:19:59 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-06-11 18:19:59 +0200
commitbf8b3d27623615c3b2a82d9f4867c70c8071a9be (patch)
treed30097084516d017567b6acd7d310fe9f4636986 /ripd
parentUpdate the log message when we receive a non-link-local nexthop for better (diff)
downloadfrr-bf8b3d27623615c3b2a82d9f4867c70c8071a9be.tar.xz
frr-bf8b3d27623615c3b2a82d9f4867c70c8071a9be.zip
When a route-map configuration is used to set the nexthop to a value, make
sure that the value is acceptable. For example, if the route-map is setting the IPv6 link-local nexthop, make sure the value is an IPv6 link-local address.
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_routemap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index e04e43d48..e7263ad7b 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -1044,6 +1044,13 @@ DEFUN (set_ip_nexthop,
vty_out (vty, "%% Malformed next-hop address%s", VTY_NEWLINE);
return CMD_WARNING;
}
+ if (su.sin.sin_addr.s_addr == 0 ||
+ IPV4_CLASS_DE(su.sin.sin_addr.s_addr))
+ {
+ vty_out (vty, "%% nexthop address cannot be 0.0.0.0, multicast "
+ "or reserved%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
return rip_route_set_add (vty, vty->index, "ip next-hop", argv[0]);
}