Sw 0010

Why have this outside the inner `if`? That seems inconsistent. For example, if I say `vlanid=0x01FF` then I'll get a 0?