mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
ripd: remove dead code
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>
This commit is contained in:
parent
3f21c8c4cb
commit
241987a816
@ -553,16 +553,6 @@ int rip_if_down(struct interface *ifp)
|
|||||||
return 0;
|
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)
|
static void rip_apply_address_add(struct connected *ifc)
|
||||||
{
|
{
|
||||||
struct prefix_ipv4 address;
|
struct prefix_ipv4 address;
|
||||||
|
81
ripd/ripd.c
81
ripd/ripd.c
@ -53,9 +53,6 @@
|
|||||||
/* RIP Structure. */
|
/* RIP Structure. */
|
||||||
struct rip *rip = NULL;
|
struct rip *rip = NULL;
|
||||||
|
|
||||||
/* RIP neighbor address table. */
|
|
||||||
struct route_table *rip_neighbor_table;
|
|
||||||
|
|
||||||
/* RIP route changes. */
|
/* RIP route changes. */
|
||||||
long rip_global_route_changes = 0;
|
long rip_global_route_changes = 0;
|
||||||
|
|
||||||
@ -1350,9 +1347,6 @@ int rip_create_socket(void)
|
|||||||
sockopt_reuseaddr(sock);
|
sockopt_reuseaddr(sock);
|
||||||
sockopt_reuseport(sock);
|
sockopt_reuseport(sock);
|
||||||
setsockopt_ipv4_multicast_loop(sock, 0);
|
setsockopt_ipv4_multicast_loop(sock, 0);
|
||||||
#ifdef RIP_RECVMSG
|
|
||||||
setsockopt_pktinfo(sock);
|
|
||||||
#endif /* RIP_RECVMSG */
|
|
||||||
#ifdef IPTOS_PREC_INTERNETCONTROL
|
#ifdef IPTOS_PREC_INTERNETCONTROL
|
||||||
setsockopt_ipv4_tos(sock, IPTOS_PREC_INTERNETCONTROL);
|
setsockopt_ipv4_tos(sock, IPTOS_PREC_INTERNETCONTROL);
|
||||||
#endif
|
#endif
|
||||||
@ -1642,81 +1636,6 @@ static void rip_request_process(struct rip_packet *packet, int size,
|
|||||||
rip_global_queries++;
|
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. */
|
/* First entry point of RIP packet. */
|
||||||
static int rip_read(struct thread *t)
|
static int rip_read(struct thread *t)
|
||||||
{
|
{
|
||||||
|
@ -237,11 +237,6 @@ struct rip_info {
|
|||||||
struct route_node *rp;
|
struct route_node *rp;
|
||||||
|
|
||||||
uint8_t distance;
|
uint8_t distance;
|
||||||
|
|
||||||
#ifdef NEW_RIP_TABLE
|
|
||||||
struct rip_info *next;
|
|
||||||
struct rip_info *prev;
|
|
||||||
#endif /* NEW_RIP_TABLE */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
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 int rip_passive_nondefault_unset(const char *ifname);
|
||||||
extern void rip_passive_nondefault_clean(void);
|
extern void rip_passive_nondefault_clean(void);
|
||||||
extern void rip_if_init(void);
|
extern void rip_if_init(void);
|
||||||
extern void rip_if_down_all(void);
|
|
||||||
extern void rip_route_map_init(void);
|
extern void rip_route_map_init(void);
|
||||||
extern void rip_zclient_init(struct thread_master *);
|
extern void rip_zclient_init(struct thread_master *);
|
||||||
extern void rip_zclient_stop(void);
|
extern void rip_zclient_stop(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user