at = ln->data;
avc = at->data;
- if (at->size != sizeof(struct attr_vlan_conf) + sa->ports) {
+ if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
ret = ERR_INVARG;
goto end;
}
at = ln->data;
avc_old = at->data;
- if (at->size != sizeof(struct attr_vlan_conf) + sa->ports) {
+ if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
ret = ERR_INVARG;
free(avc_new);
goto end;
at = ln->data;
avc = at->data;
- if (at->size != sizeof(struct attr_vlan_conf) + sa->ports) {
+ if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
ret = ERR_INVARG;
goto end;
}
at = ln->data;
avc = at->data;
- if (at->size != sizeof(struct attr_vlan_conf) + sa->ports) {
+ if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
ret = ERR_INVARG;
goto end;
}
goto end;
} else {
at = attr->first->data;
- if (at->size != sizeof(struct attr_vlan_conf) + sa->ports) {
+ if (at->size < sizeof(struct attr_vlan_conf) + sa->ports) {
ret = ERR_INVARG;
goto end;
}
struct attr *at;
int ret = ERR_OK;
struct attr_pvid *ap;
+ struct swi_attr *sa;
if (nga == NULL || ports == NULL)
return ERR_INVARG;
- else if (nga->current == NULL)
+
+ sa = nga->current;
+ if (sa == NULL)
return ERR_NOTLOG;
filterAttributes(attr, ATTR_VLAN_PVID, ATTR_END);
- memset(ports, 0, nga->current->ports * sizeof(unsigned short));
+ memset(ports, 0, sa->ports * sizeof(unsigned short));
for (ln = attr->first; ln != NULL; ln = ln->next) {
at = ln->data;
ap = at->data;
- ports[ap->port - 1] = ap->vlan;
+ if (ap->port <= sa->ports)
+ ports[ap->port - 1] = ap->vlan;
}