0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 20:28:43 +00:00

Minor fixme - MIFs

This commit is contained in:
Ondrej Zajicek (work) 2018-03-12 00:25:25 +01:00
parent 1711023df2
commit 33d7612d23
2 changed files with 23 additions and 1 deletions

View File

@ -765,6 +765,26 @@ mif_get(struct mif_group *grp, struct iface *iface)
return mif; 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 void
mif_free(struct mif_group *grp, struct mif *mif) 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. * modify it to preserve it for others.
*/ */
static void static void
mif_do_forward(sock *src, sock *dst, int len) mif_do_forward(sock *src, sock *dst, uint len)
{ {
if (!dst->rx_hook) if (!dst->rx_hook)
return; return;

View File

@ -132,6 +132,8 @@ struct iface *if_get_by_name(char *);
void if_recalc_all_preferred_addresses(void); void if_recalc_all_preferred_addresses(void);
struct mif *mif_get(struct mif_group *grp, struct iface *iface); 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); void mif_free(struct mif_group *grp, struct mif *mif);
#define MIFS_SET(mif,m) ((m) |= (1 << (mif)->index)) #define MIFS_SET(mif,m) ((m) |= (1 << (mif)->index))