]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor fixme - MIFs
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 11 Mar 2018 23:25:25 +0000 (00:25 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 11 Mar 2018 23:25:25 +0000 (00:25 +0100)
nest/iface.c
nest/iface.h

index 16b06c7c24d126934a52bb2ccb0d35bb8f75c2bc..ea02ea66ed89276ac63f6212a8b28e668c4ff3c4 100644 (file)
@@ -765,6 +765,26 @@ mif_get(struct mif_group *grp, struct iface *iface)
   return mif;
 }
 
+struct mif *
+mif_find(struct mif_group *grp, struct iface *iface)
+{
+  WALK_ARRAY(grp->mifs, MIFS_MAX, mif)
+    if (mif && (mif->iface == iface))
+      return mif;
+
+  return NULL;
+}
+
+struct mif *
+mif_find_by_index(struct mif_group *grp, uint index)
+{
+  WALK_ARRAY(grp->mifs, MIFS_MAX, mif)
+    if (mif && (mif->iface->index == index))
+      return mif;
+
+  return NULL;
+}
+
 void
 mif_free(struct mif_group *grp, struct mif *mif)
 {
@@ -801,7 +821,7 @@ mif_listen_igmp(struct mif_group *grp, struct mif *mif, sock *s)
  * modify it to preserve it for others.
  */
 static void
-mif_do_forward(sock *src, sock *dst, int len)
+mif_do_forward(sock *src, sock *dst, uint len)
 {
   if (!dst->rx_hook)
     return;
index 3bd8d03184b7c494f7fde3461c261a1c8d54ad27..48db2e41cffbfb1dc511a781a7c5e0682580ad08 100644 (file)
@@ -132,6 +132,8 @@ struct iface *if_get_by_name(char *);
 void if_recalc_all_preferred_addresses(void);
 
 struct mif *mif_get(struct mif_group *grp, struct iface *iface);
+struct mif *mif_find(struct mif_group *grp, struct iface *iface);
+struct mif *mif_find_by_index(struct mif_group *grp, uint index);
 void mif_free(struct mif_group *grp, struct mif *mif);
 
 #define MIFS_SET(mif,m)                ((m) |= (1 << (mif)->index))