Comment 4 for bug 1541678

Revision history for this message
Simon Déziel (sdeziel) wrote : Re: if-post-down.d/vlan and if-pre-up.d/vlan should support en* interfaces

As mentioned in a duplicated LP, I think the vlan up/down script could be simplified.

The part extracting VLANID and IF_VLAN_RAW_DEVICE seems overly complex. The "case" statement already ensures we operate on vlan device so I think something much simpler like this would work:

  VLANID=`echo $IFACE|sed "s/[^.]\+\.\([0-9]\+\).*/\1/; s/^0//"`
  IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\([^.]\+\)\.[0-9]\+.*/\1/"`

This is also easier to read.