aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-06-26 19:15:38 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-06-26 19:15:38 +0000
commit87420577635a0a4d4e35ec87108dc4a7b9be087b (patch)
tree12925cf97331fbeb0210766f529cd2ce27c98250
parente827a12c483ad09df15942a61e532edf132b8e69 (diff)
downloadupstream-87420577635a0a4d4e35ec87108dc4a7b9be087b.tar.gz
upstream-87420577635a0a4d4e35ec87108dc4a7b9be087b.tar.bz2
upstream-87420577635a0a4d4e35ec87108dc4a7b9be087b.zip
generic: rtl8366: prevent modifications of VLAN 0
SVN-Revision: 21906
-rw-r--r--target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c6
-rw-r--r--target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c6
2 files changed, 6 insertions, 6 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);
diff --git a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c
index babeddc44a..c8e7dd60b5 100644
--- a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c
+++ b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c
@@ -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);