mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-28 13:58:14 +00:00
zebra: Add ipv6 router advertisement message counter
Ticket: CM-4497 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
76981cd383
commit
795b5abf69
@ -933,6 +933,8 @@ nd_dump_vty (struct vty *vty, struct interface *ifp)
|
||||
rtadv->AdvReachableTime, VTY_NEWLINE);
|
||||
vty_out (vty, " ND advertised retransmit interval is %d milliseconds%s",
|
||||
rtadv->AdvRetransTimer, VTY_NEWLINE);
|
||||
vty_out (vty, " ND router advertisements sent: %d rcvd: %d%s",
|
||||
zif->ra_sent, zif->ra_rcvd, VTY_NEWLINE);
|
||||
interval = rtadv->MaxRtrAdvInterval;
|
||||
if (interval % 1000)
|
||||
vty_out (vty, " ND router advertisements are sent every "
|
||||
|
@ -204,6 +204,7 @@ struct zebra_if
|
||||
|
||||
#if defined(HAVE_RTADV)
|
||||
struct rtadvconf rtadv;
|
||||
unsigned int ra_sent, ra_rcvd;
|
||||
#endif /* HAVE_RTADV */
|
||||
|
||||
#ifdef HAVE_IRDP
|
||||
|
@ -69,6 +69,20 @@ static void rtadv_event (struct zebra_ns *, enum rtadv_event, int);
|
||||
static int if_join_all_router (int, struct interface *);
|
||||
static int if_leave_all_router (int, struct interface *);
|
||||
|
||||
static int rtadv_increment_received(unsigned int *ifindex) {
|
||||
int ret = -1;
|
||||
struct interface *iface;
|
||||
struct zebra_if *zif;
|
||||
|
||||
iface = if_lookup_by_index_vrf(*ifindex, VRF_DEFAULT);
|
||||
if (iface && iface->info) {
|
||||
zif = iface->info;
|
||||
zif->ra_rcvd++;
|
||||
ret = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
rtadv_recv_packet (int sock, u_char *buf, int buflen,
|
||||
struct sockaddr_in6 *from, unsigned int *ifindex,
|
||||
@ -119,6 +133,10 @@ rtadv_recv_packet (int sock, u_char *buf, int buflen,
|
||||
*hoplimit = *hoptr;
|
||||
}
|
||||
}
|
||||
|
||||
if(rtadv_increment_received(ifindex) < 0)
|
||||
zlog_err("%s: could not increment RA received counter", __func__);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -367,6 +385,8 @@ rtadv_send_packet (int sock, struct interface *ifp)
|
||||
zlog_err ("%s(%u): Tx RA failed, socket %u error %d (%s)",
|
||||
ifp->name, ifp->ifindex, sock, errno, safe_strerror(errno));
|
||||
}
|
||||
else
|
||||
zif->ra_sent++;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user