diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-10 15:14:16 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-24 10:03:40 -0500 |
| commit | 116b989af23a1232b3df7015c4b7ce124b04f84a (patch) | |
| tree | 0d463544112c74305056574aabf0e3b66e13b7aa | |
| parent | c48a612c21bce760d4943effde1b79e395a03607 (diff) | |
pimd: Only debug in the unusual case
When receiving a J/P packet, only check to see if we should
log when the J/P packet is not for us.
Very slight performance improvement additionally
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | pimd/pim_ifchannel.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 3caac4cda6..0b5baf9756 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -678,12 +678,13 @@ static void check_recv_upstream(int is_join, pim_upstream_join_timer_decrease_to_t_override("Prune(S,G)", up); } -static int nonlocal_upstream(int is_join, - struct interface *recv_ifp, - struct in_addr upstream, - struct prefix_sg *sg, - uint8_t source_flags, - uint16_t holdtime) +static int +nonlocal_upstream(int is_join, + struct interface *recv_ifp, + struct in_addr upstream, + struct prefix_sg *sg, + uint8_t source_flags, + uint16_t holdtime) { struct pim_interface *recv_pim_ifp; int is_local; /* boolean */ @@ -692,27 +693,26 @@ static int nonlocal_upstream(int is_join, zassert(recv_pim_ifp); is_local = (upstream.s_addr == recv_pim_ifp->primary_address.s_addr); - + + if (is_local) + return 0; + if (PIM_DEBUG_PIM_TRACE_DETAIL) { char up_str[INET_ADDRSTRLEN]; pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str)); - zlog_warn("%s: recv %s (S,G)=%s to %s upstream=%s on %s", - __PRETTY_FUNCTION__, - is_join ? "join" : "prune", - pim_str_sg_dump (sg), - is_local ? "local" : "non-local", - up_str, recv_ifp->name); + zlog_warn("%s: recv %s (S,G)=%s to non-local upstream=%s on %s", + __PRETTY_FUNCTION__, + is_join ? "join" : "prune", + pim_str_sg_dump (sg), + up_str, recv_ifp->name); } - if (is_local) - return 0; - /* - Since recv upstream addr was not directed to our primary - address, check if we should react to it in any way. - */ + * Since recv upstream addr was not directed to our primary + * address, check if we should react to it in any way. + */ check_recv_upstream(is_join, recv_ifp, upstream, sg, - source_flags, holdtime); + source_flags, holdtime); return 1; /* non-local */ } |
