radius: Add tagged VLAN parsing
1. Add tagged VLAN to struct vlan_description (compile limited number of tagged VLANs per description) For k tagged VLANs, the first k entries in vlan_description.tagged are used. They are sorted in ascending order. All other entries are zero. This way os_memcmp() can find identical configurations. 2. Let tagged VLANs be parsed from RADIUS Access-Accept 3. Print VLAN %d+ with %d=untagged VID if tagged VLANs are set 4. Select an unused vlan_id > 4096 for new tagged VLAN configurations 5. Add EGRESS_VLAN RADIUS attribute parsing also for untagged VLANs Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
This commit is contained in:
parent
1889af2e0f
commit
8e44c192da
9 changed files with 129 additions and 29 deletions
|
@ -673,10 +673,18 @@ int hostapd_vlan_valid(struct hostapd_vlan *vlan,
|
|||
struct vlan_description *vlan_desc)
|
||||
{
|
||||
struct hostapd_vlan *v = vlan;
|
||||
int i;
|
||||
|
||||
if (!vlan_desc->notempty || vlan_desc->untagged <= 0 ||
|
||||
if (!vlan_desc->notempty || vlan_desc->untagged < 0 ||
|
||||
vlan_desc->untagged > MAX_VLAN_ID)
|
||||
return 0;
|
||||
for (i = 0; i < MAX_NUM_TAGGED_VLAN; i++) {
|
||||
if (vlan_desc->tagged[i] < 0 ||
|
||||
vlan_desc->tagged[i] > MAX_VLAN_ID)
|
||||
return 0;
|
||||
}
|
||||
if (!vlan_desc->untagged && !vlan_desc->tagged[0])
|
||||
return 0;
|
||||
|
||||
while (v) {
|
||||
if (!vlan_compare(&v->vlan_desc, vlan_desc) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue