1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-24 01:27:30 +02:00

backfire: generic: rtl8366: prevent modifications of VLAN 0 (backport of r29106)

git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@21925 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2010-06-26 19:52:14 +00:00
parent ab8c4274e4
commit c814fdfe02
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -1118,7 +1118,7 @@ static int rtl8366s_sw_get_vlan_info(struct switch_dev *dev,
struct rtl8366s *rtl = sw_to_rtl8366s(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));
@ -1257,7 +1257,7 @@ static int rtl8366s_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;
rtl8366s_get_vlan_member_config(rtl, val->port_vlan, &vlanmc);
@ -1286,7 +1286,7 @@ static int rtl8366s_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;
rtl8366s_get_vlan_member_config(rtl, val->port_vlan, &vlanmc);