diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-07-02 16:38:54 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-07-02 16:38:54 +0000 |
commit | 27b472533bc8bb0fdb37dcda7596c385d3b9f414 (patch) | |
tree | 60e09c43d4d016b32eb47ec0ba4a0263f0b40bbc | |
parent | 33d5ab9ef197ce281859f12251df4e412c469c65 (diff) |
[zebra] Fix CID #104, check addr for null, and #18, check nexthop type args
2006-07-02 Paul Jakma <paul.jakma@sun.com>
* 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.
-rw-r--r-- | zebra/ChangeLog | 7 | ||||
-rw-r--r-- | zebra/rt_netlink.c | 7 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 8 |
3 files changed, 22 insertions, 0 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog index 69bb1e8e..aae20155 100644 --- a/zebra/ChangeLog +++ b/zebra/ChangeLog @@ -1,3 +1,10 @@ +2006-07-02 Paul Jakma <paul.jakma@sun.com> + + * 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. + 2006-06-15 Paul Jakma <paul.jakma@sun.com> * interface.c: (if_flag_dump_vty) redundant code, remove. diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index f1c1a300..216625e9 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -673,6 +673,13 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h) broad = NULL; } + /* addr is primary key, SOL if we don't have one */ + if (addr == NULL) + { + zlog_debug ("%s: NULL address", __func__); + return -1; + } + /* Flags. */ if (ifa->ifa_flags & IFA_F_SECONDARY) SET_FLAG (flags, ZEBRA_IFA_SECONDARY); 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); |