]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib, ospfd, ripd: Convert if_lookup_address to be vrf aware
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 10 Mar 2017 20:54:53 +0000 (15:54 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 15 Mar 2017 14:31:10 +0000 (10:31 -0400)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/if.c
lib/if.h
ospfd/ospf_packet.c
ripd/ripd.c

index 14c333a4e79004b5b788101bfbb75743072e46cc..c4deeb79209e7a95d620c6f496c54610de79bfff 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -373,7 +373,7 @@ if_lookup_exact_address (void *src, int family, vrf_id_t vrf_id)
 
 /* Lookup interface by IPv4 address. */
 struct connected *
-if_lookup_address_vrf (void *matchaddr, int family, vrf_id_t vrf_id)
+if_lookup_address (void *matchaddr, int family, vrf_id_t vrf_id)
 {
   struct listnode *node;
   struct prefix addr;
@@ -414,12 +414,6 @@ if_lookup_address_vrf (void *matchaddr, int family, vrf_id_t vrf_id)
   return match;
 }
 
-struct connected *
-if_lookup_address (void *matchaddr, int family)
-{
-  return if_lookup_address_vrf (matchaddr, family, VRF_DEFAULT);
-}
-
 /* Lookup interface by prefix */
 struct interface *
 if_lookup_prefix_vrf (struct prefix *prefix, vrf_id_t vrf_id)
index 6be1d4b891676099ff333eaecebda3b142776dc4..72d78c5d5ce25e13ed1dfe3a0e1ef21e855d5109 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -389,7 +389,6 @@ struct nbr_connected
 
 /* Prototypes. */
 extern int if_cmp_name_func (char *, char *);
-extern struct connected *if_lookup_address (void *matchaddr, int family);
 extern struct interface *if_lookup_prefix (struct prefix *prefix);
 
 extern void if_update_vrf (struct interface *, const char *name, int namelen,
@@ -398,9 +397,9 @@ extern struct interface *if_create (const char *name, int namelen,
                                     vrf_id_t vrf_id);
 extern struct interface *if_lookup_by_index (ifindex_t, vrf_id_t vrf_id);
 extern struct interface *if_lookup_exact_address (void *matchaddr, int family,
-                                vrf_id_t vrf_id);
-extern struct connected *if_lookup_address_vrf (void *matchaddr, int family,
-                                vrf_id_t vrf_id);
+                                                  vrf_id_t vrf_id);
+extern struct connected *if_lookup_address (void *matchaddr, int family,
+                                            vrf_id_t vrf_id);
 extern struct interface *if_lookup_prefix_vrf (struct prefix *prefix,
                                 vrf_id_t vrf_id);
 
index d09e0f7d802d5598956df1000d48097c3b44a101..b7721adb3e53d8ff70ce7b21b3561c248c3a0c60 100644 (file)
@@ -2789,7 +2789,7 @@ ospf_read (struct thread *thread)
       /* Handle cases where the platform does not support retrieving the ifindex,
         and also platforms (such as Solaris 8) that claim to support ifindex
         retrieval but do not. */
-      c = if_lookup_address ((void *)&iph->ip_src, AF_INET);
+      c = if_lookup_address ((void *)&iph->ip_src, AF_INET, VRF_DEFAULT);
       if (c)
        ifp = c->ifp;
       if (ifp == NULL)
index e0f96f9aaf3eca22d6c90240b0e453b9878747db..abc2faf2e9acba5ff34e4232ac3a6637e28e4bf1 100644 (file)
@@ -1129,7 +1129,7 @@ rip_response_process (struct rip_packet *packet, int size,
   /* The datagram's IPv4 source address should be checked to see
      whether the datagram is from a valid neighbor; the source of the
      datagram must be on a directly connected network (RFC2453 - Sec. 3.9.2) */
-  if (if_lookup_address((void *)&from->sin_addr, AF_INET) == NULL)
+  if (if_lookup_address((void *)&from->sin_addr, AF_INET, VRF_DEFAULT) == NULL)
     {
       zlog_info ("This datagram doesn't came from a valid neighbor: %s",
                 inet_ntoa (from->sin_addr));
@@ -1215,7 +1215,7 @@ rip_response_process (struct rip_packet *packet, int size,
              continue;
            }
 
-         if (! if_lookup_address ((void *)&rte->nexthop, AF_INET))
+         if (! if_lookup_address ((void *)&rte->nexthop, AF_INET, VRF_DEFAULT))
            {
              struct route_node *rn;
              struct rip_info *rinfo;
@@ -1816,7 +1816,7 @@ rip_read (struct thread *t)
     }
 
   /* Which interface is this packet comes from. */
-  ifc = if_lookup_address ((void *)&from.sin_addr, AF_INET);
+  ifc = if_lookup_address ((void *)&from.sin_addr, AF_INET, VRF_DEFAULT);
   if (ifc)
     ifp = ifc->ifp;
 
@@ -2517,7 +2517,7 @@ rip_update_process (int route_type)
       {
        p = &rp->p;
 
-       connected = if_lookup_address (&p->u.prefix4, AF_INET);
+       connected = if_lookup_address (&p->u.prefix4, AF_INET, VRF_DEFAULT);
        if (! connected)
          {
            zlog_warn ("Neighbor %s doesnt have connected interface!",