On Thu, 14 Jan 2021 20:41:31 -0800 menglong8.dong@xxxxxxxxx wrote: > - if (data[IFLA_BR_VLAN_PROTOCOL]) { > - switch (nla_get_be16(data[IFLA_BR_VLAN_PROTOCOL])) { > - case htons(ETH_P_8021Q): > - case htons(ETH_P_8021AD): > - break; > - default: > - return -EPROTONOSUPPORT; > - } > + if (data[IFLA_BR_VLAN_PROTOCOL] && > + !eth_type_vlan(nla_get_be16(data[IFLA_BR_VLAN_PROTOCOL]))) { > + return -EPROTONOSUPPORT; > } The curly brackets are no longer necessary here, since it's a single line expression.