]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Move I_am_DR macro to more appropriate place
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 23 Oct 2015 14:37:45 +0000 (07:37 -0700)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:35 +0000 (20:38 -0400)
Move the I_am_DR(ifp) outside of pim_macro.c and into
pim_iface.h where it belongs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_iface.h
pimd/pim_macro.c
pimd/pim_mroute.c

index ad6a3264dbc70d9e10e374e35d75c3cd1d1e5576..9c4e1a770ece6b2a437c0767995165dfe7db843e 100644 (file)
@@ -53,6 +53,8 @@
 #define PIM_IF_DONT_IGMP_LISTEN_ALLROUTERS(options) ((options) &= ~PIM_IF_MASK_IGMP_LISTEN_ALLROUTERS)
 #define PIM_IF_DONT_PIM_CAN_DISABLE_JOIN_SUPRESSION(options) ((options) &= ~PIM_IF_MASK_PIM_CAN_DISABLE_JOIN_SUPRESSION)
 
+#define PIM_I_am_DR(pim_ifp) ((pim_ifp)->pim_dr_addr.s_addr == (pim_ifp)->primary_address.s_addr)
+
 enum pim_interface_type {
   PIM_INTERFACE_SSM,
   PIM_INTERFACE_SM
index adb999a2b25f0ce999e125b3215b168253bc3b73..39098df526f759766079989f8331d95585e0473c 100644 (file)
@@ -30,8 +30,6 @@
 #include "pim_iface.h"
 #include "pim_ifchannel.h"
 
-#define PIM_IFP_I_am_DR(pim_ifp) ((pim_ifp)->pim_dr_addr.s_addr == (pim_ifp)->primary_address.s_addr)
-
 /*
   DownstreamJPState(S,G,I) is the per-interface state machine for
   receiving (S,G) Join/Prune messages.
@@ -181,7 +179,7 @@ int pim_macro_chisin_pim_include(const struct pim_ifchannel *ch)
     
   return (
          /* I_am_DR( I ) ? */
-         PIM_IFP_I_am_DR(pim_ifp)
+         PIM_I_am_DR(pim_ifp)
          &&
          /* lost_assert(S,G,I) == FALSE ? */
          (!pim_macro_ch_lost_assert(ch))
@@ -419,7 +417,7 @@ int pim_macro_assert_tracking_desired_eval(const struct pim_ifchannel *ch)
   /* local_receiver_include(S,G,I) ? */
   if (local_receiver_include(ch)) {
     /* I_am_DR(I) ? */
-    if (PIM_IFP_I_am_DR(pim_ifp))
+    if (PIM_I_am_DR(pim_ifp))
       return 1; /* true */
 
     /* AssertWinner(S,G,I) == me ? */
index 6e48222852581949a2a9c428185db448f15a3995..d804ce86ff0d047511714286d5616a6e91977714 100644 (file)
@@ -81,6 +81,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg
    */
   if ((qpim_rp.s_addr == INADDR_NONE) ||
       (!pim_ifp) ||
+      (!PIM_I_am_DR(pim_ifp)) ||
       (pim_ifp->itype == PIM_INTERFACE_SSM))
     return 0;
 
@@ -115,6 +116,7 @@ pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const struct igmpmsg *ms
                 __PRETTY_FUNCTION__);
     }
   }
+
   return 0;
 }