]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2005-10-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Sun, 30 Oct 2005 23:51:32 +0000 (23:51 +0000)
committerajs <ajs>
Sun, 30 Oct 2005 23:51:32 +0000 (23:51 +0000)
* ripd.c: (rip_response_process) Instead of calling
  rip_interface.c:if_valid_neighbor(), call the equivalent
  library function if_lookup_address().
* rip_interface.c: (if_valid_neighbor) Remove function, since it is
  essentially equivalent to the if_lookup_address() library function.
* ripd.h: (if_valid_neighbor) Remove function declaration.

ripd/ChangeLog
ripd/rip_interface.c
ripd/ripd.c
ripd/ripd.h

index e9f7e07cfb378d61599f89b1449086ac50a8a1fe..a3c0e24b29aa687937c697167226c6165009201b 100644 (file)
@@ -1,3 +1,12 @@
+2005-10-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * ripd.c: (rip_response_process) Instead of calling
+         rip_interface.c:if_valid_neighbor(), call the equivalent
+         library function if_lookup_address().
+       * rip_interface.c: (if_valid_neighbor) Remove function, since it is
+         essentially equivalent to the if_lookup_address() library function.
+       * ripd.h: (if_valid_neighbor) Remove function declaration.
+
 2005-10-28 Paul Jakma <paul.jakma@sun.com>
 
        * Makefile.am: Add rip_interface.h, or else it doesn't get
index 17b25ff8aed0d04f901f2641bc77c0b1eddfa9ec..0bc5a311076b990a88fcc00bd973b61f097f7569 100644 (file)
@@ -388,59 +388,6 @@ if_check_address (struct in_addr addr)
   return 0;
 }
 
-/* is this address from a valid neighbor? (RFC2453 - Sec. 3.9.2) */
-int
-if_valid_neighbor (struct in_addr addr)
-{
-  struct listnode *node;
-  struct connected *connected = NULL;
-  struct interface *ifp;
-  struct prefix_ipv4 *p;
-  struct prefix_ipv4 pa;
-
-  pa.family = AF_INET;
-  pa.prefix = addr;
-  pa.prefixlen = IPV4_MAX_PREFIXLEN;
-
-  for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
-    {
-      struct listnode *cnode;
-
-      for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, connected))
-       {
-         if (if_is_pointopoint (ifp))
-           {
-             p = (struct prefix_ipv4 *) connected->address;
-
-             if (p && p->family == AF_INET)
-               {
-                 if (IPV4_ADDR_SAME (&p->prefix, &addr))
-                   return 1;
-
-                 p = (struct prefix_ipv4 *) connected->destination;
-                 if (p)
-                   {
-                     if (IPV4_ADDR_SAME (&p->prefix, &addr))
-                       return 1;
-                   }
-                 else
-                   {
-                     if (prefix_match(connected->address,(struct prefix *)&pa))
-                       return 1;
-                   }
-               }
-           }
-         else
-           {
-             if ((connected->address->family == AF_INET) &&
-                 prefix_match(connected->address,(struct prefix *)&pa))
-               return 1;
-           }
-       }
-    }
-  return 0;
-}
-
 /* Inteface link down message processing. */
 int
 rip_interface_down (int command, struct zclient *zclient, zebra_size_t length)
index 2e2b284982c25190fdc763baae8ab74f3ab4da17..ec7bd199f45261c97d313a6d429da4522901a206 100644 (file)
@@ -1131,8 +1131,8 @@ 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  */
-  if (! if_valid_neighbor (from->sin_addr)
+     datagram must be on a directly connected network (RFC2453 - Sec. 3.9.2) */
+  if (if_lookup_address(from->sin_addr) == NULL
     {
       zlog_info ("This datagram doesn't came from a valid neighbor: %s",
                 inet_ntoa (from->sin_addr));
index cc4aef679903e84bf19390853c753f325a64b6a9..4d0c04e2f846329ba807b9411862e2b9ac976aba 100644 (file)
@@ -391,7 +391,6 @@ extern void rip_zclient_start (void);
 extern void rip_zclient_reset (void);
 extern void rip_offset_init (void);
 extern int if_check_address (struct in_addr addr);
-extern int if_valid_neighbor (struct in_addr addr);
 
 extern int rip_request_send (struct sockaddr_in *, struct interface *, u_char,
                       struct connected *);