]> git.puffer.fish Git - matthieu/frr.git/commitdiff
[zebra] Fix CID #104, check addr for null, and #18, check nexthop type args
authorPaul Jakma <paul.jakma@sun.com>
Sun, 2 Jul 2006 16:38:54 +0000 (16:38 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Sun, 2 Jul 2006 16:38:54 +0000 (16:38 +0000)
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.

zebra/ChangeLog
zebra/rt_netlink.c
zebra/zebra_rib.c

index 69bb1e8eb93c55e39cdeaf6bb2a9ea0921e324a9..aae2015573f305b2e47430f5b24d11fa13b21dc2 100644 (file)
@@ -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.
index f1c1a300b8004981cb631fe4782c05d03f0d4fe7..216625e93e850fd16a804044fccc502ad664337a 100644 (file)
@@ -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);
index 330bce77a14f2479ad546201bc3a4e6838bb4a8c..9851cf443c648a368137e4e77cd435d05630b110 100644 (file)
@@ -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);