mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 12:49:18 +00:00
pimd: Clarify pim_mroute_[add|del] function debugging
When debugging is turned on for 'debug mroute' we are unable to tell when a mroute has been added or deleted from the mrib. Notice when we do it and who called it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
eeedae06ee
commit
6a78764e46
@ -2303,7 +2303,7 @@ static void mroute_add_all()
|
|||||||
struct channel_oil *c_oil;
|
struct channel_oil *c_oil;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) {
|
for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) {
|
||||||
if (pim_mroute_add(c_oil)) {
|
if (pim_mroute_add(c_oil, __PRETTY_FUNCTION__)) {
|
||||||
/* just log warning */
|
/* just log warning */
|
||||||
char source_str[INET_ADDRSTRLEN];
|
char source_str[INET_ADDRSTRLEN];
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
@ -2322,7 +2322,7 @@ static void mroute_del_all()
|
|||||||
struct channel_oil *c_oil;
|
struct channel_oil *c_oil;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) {
|
for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) {
|
||||||
if (pim_mroute_del(c_oil)) {
|
if (pim_mroute_del(c_oil, __PRETTY_FUNCTION__)) {
|
||||||
/* just log warning */
|
/* just log warning */
|
||||||
char source_str[INET_ADDRSTRLEN];
|
char source_str[INET_ADDRSTRLEN];
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
@ -2341,7 +2341,7 @@ static void static_mroute_add_all()
|
|||||||
struct static_route *s_route;
|
struct static_route *s_route;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, s_route)) {
|
for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, s_route)) {
|
||||||
if (pim_mroute_add(&s_route->c_oil)) {
|
if (pim_mroute_add(&s_route->c_oil, __PRETTY_FUNCTION__)) {
|
||||||
/* just log warning */
|
/* just log warning */
|
||||||
char source_str[INET_ADDRSTRLEN];
|
char source_str[INET_ADDRSTRLEN];
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
@ -2360,7 +2360,7 @@ static void static_mroute_del_all()
|
|||||||
struct static_route *s_route;
|
struct static_route *s_route;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, s_route)) {
|
for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, s_route)) {
|
||||||
if (pim_mroute_del(&s_route->c_oil)) {
|
if (pim_mroute_del(&s_route->c_oil, __PRETTY_FUNCTION__)) {
|
||||||
/* just log warning */
|
/* just log warning */
|
||||||
char source_str[INET_ADDRSTRLEN];
|
char source_str[INET_ADDRSTRLEN];
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
|
@ -402,7 +402,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
|
|||||||
up->channel_oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index);
|
up->channel_oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index);
|
||||||
pim_upstream_inherited_olist (up);
|
pim_upstream_inherited_olist (up);
|
||||||
if (!up->channel_oil->installed)
|
if (!up->channel_oil->installed)
|
||||||
pim_mroute_add (up->channel_oil);
|
pim_mroute_add (up->channel_oil, __PRETTY_FUNCTION__);
|
||||||
pim_upstream_set_sptbit (up, ifp);
|
pim_upstream_set_sptbit (up, ifp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -423,7 +423,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
|
|||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index);
|
oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index);
|
||||||
if (!oil->installed)
|
if (!oil->installed)
|
||||||
pim_mroute_add (oil);
|
pim_mroute_add (oil, __PRETTY_FUNCTION__);
|
||||||
if (pim_if_connected_to_source (ifp, sg.src))
|
if (pim_if_connected_to_source (ifp, sg.src))
|
||||||
{
|
{
|
||||||
up = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_FHR, __PRETTY_FUNCTION__);
|
up = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_FHR, __PRETTY_FUNCTION__);
|
||||||
@ -745,7 +745,7 @@ int pim_mroute_del_vif(int vif_index)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pim_mroute_add(struct channel_oil *c_oil)
|
int pim_mroute_add(struct channel_oil *c_oil, const char *name)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
int orig = 0;
|
int orig = 0;
|
||||||
@ -805,11 +805,22 @@ int pim_mroute_add(struct channel_oil *c_oil)
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PIM_DEBUG_MROUTE)
|
||||||
|
{
|
||||||
|
struct prefix_sg sg;
|
||||||
|
|
||||||
|
sg.src = c_oil->oil.mfcc_origin;
|
||||||
|
sg.grp = c_oil->oil.mfcc_mcastgrp;
|
||||||
|
|
||||||
|
zlog_debug("%s(%s), Added Route: %s to mroute table",
|
||||||
|
__PRETTY_FUNCTION__, name, pim_str_sg_dump(&sg));
|
||||||
|
}
|
||||||
|
|
||||||
c_oil->installed = 1;
|
c_oil->installed = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pim_mroute_del (struct channel_oil *c_oil)
|
int pim_mroute_del (struct channel_oil *c_oil, const char *name)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -832,6 +843,16 @@ int pim_mroute_del (struct channel_oil *c_oil)
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PIM_DEBUG_MROUTE)
|
||||||
|
{
|
||||||
|
struct prefix_sg sg;
|
||||||
|
|
||||||
|
sg.src = c_oil->oil.mfcc_origin;
|
||||||
|
sg.grp = c_oil->oil.mfcc_mcastgrp;
|
||||||
|
|
||||||
|
zlog_debug("%s(%s), Deleted Route: %s from mroute table",
|
||||||
|
__PRETTY_FUNCTION__, name, pim_str_sg_dump(&sg));
|
||||||
|
}
|
||||||
c_oil->installed = 0;
|
c_oil->installed = 0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -172,8 +172,8 @@ int pim_mroute_socket_disable(void);
|
|||||||
int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr, unsigned char flags);
|
int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr, unsigned char flags);
|
||||||
int pim_mroute_del_vif(int vif_index);
|
int pim_mroute_del_vif(int vif_index);
|
||||||
|
|
||||||
int pim_mroute_add(struct channel_oil *c_oil);
|
int pim_mroute_add(struct channel_oil *c_oil, const char *name);
|
||||||
int pim_mroute_del(struct channel_oil *c_oil);
|
int pim_mroute_del(struct channel_oil *c_oil, const char *name);
|
||||||
|
|
||||||
int pim_mroute_msg(int fd, const char *buf, int buf_size);
|
int pim_mroute_msg(int fd, const char *buf, int buf_size);
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ pim_channel_del_oif (struct channel_oil *channel_oil,
|
|||||||
|
|
||||||
channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] = 0;
|
channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] = 0;
|
||||||
|
|
||||||
if (pim_mroute_add (channel_oil)) {
|
if (pim_mroute_add (channel_oil, __PRETTY_FUNCTION__)) {
|
||||||
if (PIM_DEBUG_MROUTE)
|
if (PIM_DEBUG_MROUTE)
|
||||||
{
|
{
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
@ -387,7 +387,7 @@ int pim_channel_add_oif(struct channel_oil *channel_oil,
|
|||||||
|
|
||||||
channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] = PIM_MROUTE_MIN_TTL;
|
channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] = PIM_MROUTE_MIN_TTL;
|
||||||
|
|
||||||
if (pim_mroute_add(channel_oil)) {
|
if (pim_mroute_add(channel_oil, __PRETTY_FUNCTION__)) {
|
||||||
if (PIM_DEBUG_MROUTE)
|
if (PIM_DEBUG_MROUTE)
|
||||||
{
|
{
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
|
@ -175,7 +175,7 @@ int pim_static_add(struct interface *iif, struct interface *oif, struct in_addr
|
|||||||
listnode_add(qpim_static_route_list, s_route);
|
listnode_add(qpim_static_route_list, s_route);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pim_mroute_add(&s_route->c_oil))
|
if (pim_mroute_add(&s_route->c_oil, __PRETTY_FUNCTION__))
|
||||||
{
|
{
|
||||||
char gifaddr_str[INET_ADDRSTRLEN];
|
char gifaddr_str[INET_ADDRSTRLEN];
|
||||||
char sifaddr_str[INET_ADDRSTRLEN];
|
char sifaddr_str[INET_ADDRSTRLEN];
|
||||||
@ -254,7 +254,7 @@ int pim_static_del(struct interface *iif, struct interface *oif, struct in_addr
|
|||||||
|
|
||||||
/* If there are no more outputs then delete the whole route, otherwise set the route with the new outputs */
|
/* If there are no more outputs then delete the whole route, otherwise set the route with the new outputs */
|
||||||
if (s_route->c_oil.oil_ref_count <= 0 ?
|
if (s_route->c_oil.oil_ref_count <= 0 ?
|
||||||
pim_mroute_del(&s_route->c_oil) : pim_mroute_add(&s_route->c_oil)) {
|
pim_mroute_del(&s_route->c_oil, __PRETTY_FUNCTION__) : pim_mroute_add(&s_route->c_oil, __PRETTY_FUNCTION__)) {
|
||||||
char gifaddr_str[INET_ADDRSTRLEN];
|
char gifaddr_str[INET_ADDRSTRLEN];
|
||||||
char sifaddr_str[INET_ADDRSTRLEN];
|
char sifaddr_str[INET_ADDRSTRLEN];
|
||||||
pim_inet4_dump("<ifaddr?>", group, gifaddr_str, sizeof(gifaddr_str));
|
pim_inet4_dump("<ifaddr?>", group, gifaddr_str, sizeof(gifaddr_str));
|
||||||
|
@ -188,7 +188,7 @@ pim_upstream_del(struct pim_upstream *up, const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pim_upstream_remove_children (up);
|
pim_upstream_remove_children (up);
|
||||||
pim_mroute_del (up->channel_oil);
|
pim_mroute_del (up->channel_oil, __PRETTY_FUNCTION__);
|
||||||
upstream_channel_oil_detach(up);
|
upstream_channel_oil_detach(up);
|
||||||
|
|
||||||
if (up->sources)
|
if (up->sources)
|
||||||
|
@ -379,7 +379,7 @@ static void scan_upstream_rpf_cache()
|
|||||||
* so install it.
|
* so install it.
|
||||||
*/
|
*/
|
||||||
if (up->channel_oil && !up->channel_oil->installed)
|
if (up->channel_oil && !up->channel_oil->installed)
|
||||||
pim_mroute_add (up->channel_oil);
|
pim_mroute_add (up->channel_oil, __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
RFC 4601: 4.5.7. Sending (S,G) Join/Prune Messages
|
RFC 4601: 4.5.7. Sending (S,G) Join/Prune Messages
|
||||||
@ -442,14 +442,14 @@ pim_scan_individual_oil (struct channel_oil *c_oil)
|
|||||||
__FILE__, __PRETTY_FUNCTION__, c_oil->oil.mfcc_parent,
|
__FILE__, __PRETTY_FUNCTION__, c_oil->oil.mfcc_parent,
|
||||||
source_str, group_str);
|
source_str, group_str);
|
||||||
}
|
}
|
||||||
pim_mroute_del (c_oil);
|
pim_mroute_del (c_oil, __PRETTY_FUNCTION__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input_iface_vif_index == c_oil->oil.mfcc_parent)
|
if (input_iface_vif_index == c_oil->oil.mfcc_parent)
|
||||||
{
|
{
|
||||||
if (!c_oil->installed)
|
if (!c_oil->installed)
|
||||||
pim_mroute_add (c_oil);
|
pim_mroute_add (c_oil, __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
/* RPF unchanged */
|
/* RPF unchanged */
|
||||||
return;
|
return;
|
||||||
@ -494,7 +494,7 @@ pim_scan_individual_oil (struct channel_oil *c_oil)
|
|||||||
c_oil->oil.mfcc_parent = input_iface_vif_index;
|
c_oil->oil.mfcc_parent = input_iface_vif_index;
|
||||||
|
|
||||||
/* update kernel multicast forwarding cache (MFC) */
|
/* update kernel multicast forwarding cache (MFC) */
|
||||||
if (pim_mroute_add(c_oil))
|
if (pim_mroute_add(c_oil, __PRETTY_FUNCTION__))
|
||||||
{
|
{
|
||||||
if (PIM_DEBUG_MROUTE)
|
if (PIM_DEBUG_MROUTE)
|
||||||
{
|
{
|
||||||
@ -931,7 +931,7 @@ static int del_oif(struct channel_oil *channel_oil,
|
|||||||
|
|
||||||
channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] = 0;
|
channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] = 0;
|
||||||
|
|
||||||
if (pim_mroute_add(channel_oil)) {
|
if (pim_mroute_add(channel_oil, __PRETTY_FUNCTION__)) {
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
char source_str[INET_ADDRSTRLEN];
|
char source_str[INET_ADDRSTRLEN];
|
||||||
pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str));
|
pim_inet4_dump("<group?>", channel_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str));
|
||||||
@ -948,7 +948,7 @@ static int del_oif(struct channel_oil *channel_oil,
|
|||||||
--channel_oil->oil_size;
|
--channel_oil->oil_size;
|
||||||
|
|
||||||
if (channel_oil->oil_size < 1) {
|
if (channel_oil->oil_size < 1) {
|
||||||
if (pim_mroute_del(channel_oil)) {
|
if (pim_mroute_del(channel_oil, __PRETTY_FUNCTION__)) {
|
||||||
if (PIM_DEBUG_MROUTE)
|
if (PIM_DEBUG_MROUTE)
|
||||||
{
|
{
|
||||||
/* just log a warning in case of failure */
|
/* just log a warning in case of failure */
|
||||||
|
Loading…
Reference in New Issue
Block a user