Download raw body.
ripd: improve passive interface
On Fri, Sep 04, 2026 at 08:23:53AM +0200, Remi Locherer wrote:
> Any opinions on this?
>
> On Sat Aug 8, 2026 at 10:52 PM CEST, Remi Locherer wrote:
> > Hi tech,
> >
> > The passive keyword in ripd.conf ensures, that no RIP packets are
> > processed on the given interface.
> >
> > Other RIP implementation advertise the prefixes from a passive interface.
> > ospfd and ospf6d also advertise prefixes from passive interfaces
> >
> > This diff implements that behaviour for ripd.
> >
> > OK?
In ospfd this is done differently since passsive interfaces are almost
handled like active ones (esp. when it comes to distribute the network for
them in the router LSA). I guess RIP is a fair bit different and so it may
be reasonable to hack this into rip_redistribute.
Lets go with your diff. OK claudio@
> > --- usr.sbin/ripd/ripd.c
> > +++ usr.sbin/ripd/ripd.c
> > @@ -461,6 +461,14 @@ rip_redistribute(struct kroute *kr)
> > if (kr->flags & F_RIPD_INSERTED)
> > return (1);
> >
> > + /* redistribute prefixes from passive interfaces */
> > + if (kr->flags & F_CONNECTED) {
> > + struct iface *iface = if_find_index(kr->ifindex);
> > +
> > + if (iface != NULL && iface->passive)
> > + return (1);
> > + }
> > +
> > /* only allow 0.0.0.0/0 via REDIST_DEFAULT */
> > if (kr->prefix.s_addr == INADDR_ANY && kr->netmask.s_addr == INADDR_ANY)
> > is_default = 1;
> >
> > --- usr.sbin/ripd/ripd.conf.5
> > +++ usr.sbin/ripd/ripd.conf.5
> > @@ -221,7 +221,8 @@ when the interface state is going down.
> > The demotion counter will be decreased when the interface
> > state is active again.
> > .It Ic passive
> > -Prevent transmission and reception of RIP packets on this interface.
> > +Prevent transmission and reception of RIP packets on this interface
> > +and advertise all prefixes configured on this interface.
> > .El
> > .Sh FILES
> > .Bl -tag -width /etc/examples/ripd.conf -compact
>
>
--
:wq Claudio
ripd: improve passive interface