[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.
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index f1c1a30..216625e 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -673,6 +673,13 @@
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);