diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-06-26 19:15:38 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-06-26 19:15:38 +0000 |
commit | ff86d22f778ef3eea8ca24f3fe93cd229a557b44 (patch) | |
tree | 99f1aa1ea17ce21b20fdb8138405aca8beabd6db /target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c | |
parent | 22d4293bce389d93e53e291a98d83a0254d7dc66 (diff) | |
download | upstream-ff86d22f778ef3eea8ca24f3fe93cd229a557b44.tar.gz upstream-ff86d22f778ef3eea8ca24f3fe93cd229a557b44.tar.bz2 upstream-ff86d22f778ef3eea8ca24f3fe93cd229a557b44.zip |
generic: rtl8366: prevent modifications of VLAN 0
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21906 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c')
-rw-r--r-- | target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c index 2739031e21..dcc4d6c921 100644 --- a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c @@ -1150,7 +1150,7 @@ static int rtl8366rb_sw_get_vlan_info(struct switch_dev *dev, struct rtl8366rb *rtl = sw_to_rtl8366rb(dev); char *buf = rtl->buf; - if (val->port_vlan >= RTL8366_NUM_VLANS) + if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS) return -EINVAL; memset(buf, '\0', sizeof(rtl->buf)); @@ -1288,7 +1288,7 @@ static int rtl8366rb_sw_get_vlan_ports(struct switch_dev *dev, struct switch_port *port; int i; - if (val->port_vlan >= RTL8366_NUM_VLANS) + if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS) return -EINVAL; rtl8366rb_get_vlan_member_config(rtl, val->port_vlan, &vlanmc); @@ -1317,7 +1317,7 @@ static int rtl8366rb_sw_set_vlan_ports(struct switch_dev *dev, struct switch_port *port; int i; - if (val->port_vlan >= RTL8366_NUM_VLANS) + if (val->port_vlan == 0 || val->port_vlan >= RTL8366_NUM_VLANS) return -EINVAL; rtl8366rb_get_vlan_member_config(rtl, val->port_vlan, &vlanmc); |