diff mbox

VLAN:fix vlan_compare for tagged VLANs

Message ID 1456052499-23137-1-git-send-email-michael-dev@fami-braun.de
State Accepted
Headers show

Commit Message

michael-dev Feb. 21, 2016, 11:01 a.m. UTC
From: Michael Braun <michael-dev@fami-braun.de>

While refactoring vlan comparison into vlan_compare, it was overlooked that it needs modification for tagged vlan support.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
---
 src/ap/vlan.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jouni Malinen Feb. 22, 2016, 8:08 p.m. UTC | #1
On Sun, Feb 21, 2016 at 12:01:39PM +0100, michael-dev@fami-braun.de wrote:
> While refactoring vlan comparison into vlan_compare, it was overlooked that it needs modification for tagged vlan support.

Thanks, applied.
diff mbox

Patch

diff --git a/src/ap/vlan.c b/src/ap/vlan.c
index 80ae984..b6f6bb1 100644
--- a/src/ap/vlan.c
+++ b/src/ap/vlan.c
@@ -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;
 }