]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
VLAN: Fix vlan_compare() for tagged VLANs
authorMichael Braun <michael-dev@fami-braun.de>
Sun, 21 Feb 2016 11:01:39 +0000 (12:01 +0100)
committerJouni Malinen <j@w1.fi>
Mon, 22 Feb 2016 17:53:05 +0000 (19:53 +0200)
While refactoring VLAN comparison into vlan_compare(), it was overlooked
that modifications are needed for tagged VLAN support.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
src/ap/vlan.c

index 80ae98445b7508ef04ddd665e184aefe17c5a4fb..b6f6bb1afe0557293774587437ff39b769bc5d57 100644 (file)
@@ -16,6 +16,7 @@
  */
 int vlan_compare(struct vlan_description *a, struct vlan_description *b)
 {
+       int i;
        const int a_empty = !a || !a->notempty;
        const int b_empty = !b || !b->notempty;
 
@@ -25,5 +26,9 @@ int vlan_compare(struct vlan_description *a, struct vlan_description *b)
                return 1;
        if (a->untagged != b->untagged)
                return 1;
+       for (i = 0; i < MAX_NUM_TAGGED_VLAN; i++) {
+               if (a->tagged[i] != b->tagged[i])
+                       return 1;
+       }
        return 0;
 }