On Wed, 3 Jun 2020 13:50:56 +0200
Santiago Garcia Mantinan <ma...@debian.org> wrote:

Hi,

sorry for the trouble.
> > the problem is I get operation not supported when setting
> > vlan_filtering 0 on my bridge, does the else really make sense
> > here?  
Unfortunately yes.
The brigde is configured at runtime and can be reconfigured. Without the
else part a user is forced to unset the filtering by hand if set by
try/error/accident.

> Well, this was added due to bugs.debian.org/950879 reported by
> Benedikt who kindly supplied the patch, the patch didn't cause any
> trouble on the tests I did and that's why I applied it like he sent
> it.
> 
> I have added Benedikt to my reply for him to comment on this.
OK.
 
> As I understand it, Gianluigi, if we remove the else there we won't
> set vlan filtering to 0 and thus you won't get the error, right?
>
> We have two options here, one is to remove it and the other to send
> the possible errors on the setting to 0 case to /dev/null.
May I introduce a third option?
I am not shure, if that pseudo file exists on every supported kernel,
but you got the idea. If that is prefered, i can dig through the kernel
sources and provide a patch.

NOTE: untested!
---8<---
# Activate VLAN filtering on VLAN aware bridges
       
if [ "$IF_BRIDGE_VLAN_AWARE" = "yes" ]; then
  ip link set dev $IFACE type bridge vlan_filtering 1   
else
  if [ -f /sys/devices/virtual/net/$IFACE/bridge/vlan_filtering ]; then
    ip link set dev $IFACE type bridge vlan_filtering 0
  fi
fi
---8<---

I do not like to paper over errors like sending them to /dev/null.
But I prefer that option over droping the else part.

Regards
    Benedikt Spranger

Reply via email to