]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ripd: remove dead code
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 4 Jan 2019 21:08:10 +0000 (19:08 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 18 Jan 2019 18:15:41 +0000 (16:15 -0200)
None of these variables or functions were being used since the
initial revision ~16 years ago. It's safe to say we can remove
them now.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ripd/rip_interface.c
ripd/ripd.c
ripd/ripd.h

index ca2fa24e43fef3c56aa87c05a63c91cb4fce7881..2e432ec79cc2129ab36cedffe46bda676c44f965 100644 (file)
@@ -553,16 +553,6 @@ int rip_if_down(struct interface *ifp)
        return 0;
 }
 
-/* Needed for stop RIP process. */
-void rip_if_down_all()
-{
-       struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
-       struct interface *ifp;
-
-       FOR_ALL_INTERFACES (vrf, ifp)
-               rip_if_down(ifp);
-}
-
 static void rip_apply_address_add(struct connected *ifc)
 {
        struct prefix_ipv4 address;
index 79ec8077021f2de8d05182a7f3e59220443d3378..35ad4d818a634da179c02fbf7d0d9d9028e6751d 100644 (file)
@@ -53,9 +53,6 @@
 /* RIP Structure. */
 struct rip *rip = NULL;
 
-/* RIP neighbor address table. */
-struct route_table *rip_neighbor_table;
-
 /* RIP route changes. */
 long rip_global_route_changes = 0;
 
@@ -1350,9 +1347,6 @@ int rip_create_socket(void)
        sockopt_reuseaddr(sock);
        sockopt_reuseport(sock);
        setsockopt_ipv4_multicast_loop(sock, 0);
-#ifdef RIP_RECVMSG
-       setsockopt_pktinfo(sock);
-#endif /* RIP_RECVMSG */
 #ifdef IPTOS_PREC_INTERNETCONTROL
        setsockopt_ipv4_tos(sock, IPTOS_PREC_INTERNETCONTROL);
 #endif
@@ -1642,81 +1636,6 @@ static void rip_request_process(struct rip_packet *packet, int size,
        rip_global_queries++;
 }
 
-#if RIP_RECVMSG
-/* Set IPv6 packet info to the socket. */
-static int setsockopt_pktinfo(int sock)
-{
-       int ret;
-       int val = 1;
-
-       ret = setsockopt(sock, IPPROTO_IP, IP_PKTINFO, &val, sizeof(val));
-       if (ret < 0)
-               zlog_warn("Can't setsockopt IP_PKTINFO : %s",
-                         safe_strerror(errno));
-       return ret;
-}
-
-/* Read RIP packet by recvmsg function. */
-int rip_recvmsg(int sock, uint8_t *buf, int size, struct sockaddr_in *from,
-               ifindex_t *ifindex)
-{
-       int ret;
-       struct msghdr msg;
-       struct iovec iov;
-       struct cmsghdr *ptr;
-       char adata[1024];
-
-       memset(&msg, 0, sizeof(msg));
-       msg.msg_name = (void *)from;
-       msg.msg_namelen = sizeof(struct sockaddr_in);
-       msg.msg_iov = &iov;
-       msg.msg_iovlen = 1;
-       msg.msg_control = (void *)adata;
-       msg.msg_controllen = sizeof adata;
-       iov.iov_base = buf;
-       iov.iov_len = size;
-
-       ret = recvmsg(sock, &msg, 0);
-       if (ret < 0)
-               return ret;
-
-       for (ptr = ZCMSG_FIRSTHDR(&msg); ptr != NULL;
-            ptr = CMSG_NXTHDR(&msg, ptr))
-               if (ptr->cmsg_level == IPPROTO_IP
-                   && ptr->cmsg_type == IP_PKTINFO) {
-                       struct in_pktinfo *pktinfo;
-                       int i;
-
-                       pktinfo = (struct in_pktinfo *)CMSG_DATA(ptr);
-                       i = pktinfo->ipi_ifindex;
-               }
-       return ret;
-}
-
-/* RIP packet read function. */
-int rip_read_new(struct thread *t)
-{
-       int ret;
-       int sock;
-       char buf[RIP_PACKET_MAXSIZ];
-       struct sockaddr_in from;
-       ifindex_t ifindex;
-
-       /* Fetch socket then register myself. */
-       sock = THREAD_FD(t);
-       rip_event(RIP_READ, sock);
-
-       /* Read RIP packet. */
-       ret = rip_recvmsg(sock, buf, RIP_PACKET_MAXSIZ, &from, (int *)&ifindex);
-       if (ret < 0) {
-               zlog_warn("Can't read RIP packet: %s", safe_strerror(errno));
-               return ret;
-       }
-
-       return ret;
-}
-#endif /* RIP_RECVMSG */
-
 /* First entry point of RIP packet. */
 static int rip_read(struct thread *t)
 {
index 858c8d4f6070930cef8a8fb55b884b64007af5ec..bc0451d88f48a5213a445a22fd37b8ea52642a29 100644 (file)
@@ -237,11 +237,6 @@ struct rip_info {
        struct route_node *rp;
 
        uint8_t distance;
-
-#ifdef NEW_RIP_TABLE
-       struct rip_info *next;
-       struct rip_info *prev;
-#endif /* NEW_RIP_TABLE */
 };
 
 typedef enum {
@@ -399,7 +394,6 @@ extern int rip_passive_nondefault_set(const char *ifname);
 extern int rip_passive_nondefault_unset(const char *ifname);
 extern void rip_passive_nondefault_clean(void);
 extern void rip_if_init(void);
-extern void rip_if_down_all(void);
 extern void rip_route_map_init(void);
 extern void rip_zclient_init(struct thread_master *);
 extern void rip_zclient_stop(void);