Index | Thread | Search

From:
"Remi Locherer" <remi.locherer@relo.ch>
Subject:
Re: ripd: improve passive interface
To:
<tech@openbsd.org>
Date:
Fri, 04 Sep 2026 08:23:53 +0200

Download raw body.

Thread
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?
>
> Remi
>
>
> --- 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