From 27b472533bc8bb0fdb37dcda7596c385d3b9f414 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Sun, 2 Jul 2006 16:38:54 +0000 Subject: [zebra] Fix CID #104, check addr for null, and #18, check nexthop type args 2006-07-02 Paul Jakma * rt_netlink.c: (netlink_interface_addr) Fix CID #104, can not proceed if addr is NULL. * zebra_rib.c: (static_add_ipv6) Fix CID #18, double check required arguments are supplied for the given nexthop type. --- zebra/zebra_rib.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'zebra/zebra_rib.c') diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 330bce77..9851cf44 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2145,6 +2145,14 @@ static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate, stable = vrf_static_table (AFI_IP6, SAFI_UNICAST, vrf_id); if (! stable) return -1; + + if (!gate && + (type == STATIC_IPV6_GATEWAY || type == STATIC_IPV6_GATEWAY_IFNAME)) + return -1; + + if (!ifname && + (type == STATIC_IPV6_GATEWAY_IFNAME || type == STATIC_IPV6_IFNAME)) + return -1; /* Lookup static route prefix. */ rn = route_node_get (stable, p); -- cgit v1.2.1