From 9265e211e38f425e8868fd58fd7d5158482f03d5 Mon Sep 17 00:00:00 2001
From: Pim van Pelt <pim@ipng.nl>
Date: Sun, 12 Sep 2021 14:09:23 +0000
Subject: [PATCH] Swap oper/admin status (they were the wrong way around)

---
 vpp-snmp-agent.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vpp-snmp-agent.py b/vpp-snmp-agent.py
index a2dec4b..24ec964 100755
--- a/vpp-snmp-agent.py
+++ b/vpp-snmp-agent.py
@@ -77,7 +77,7 @@ class MyAgent(agentx.Agent):
             if not ifname in ifaces:
                 self.logger.warning("Could not get AdminStatus for interface %s", ifname)
             else:
-                if int(ifaces[ifname].flags) & 2:
+                if int(ifaces[ifname].flags) & 1:
                     admin_status = 1  # up
                 else:
                     admin_status = 2  # down
@@ -87,7 +87,7 @@ class MyAgent(agentx.Agent):
             if not ifname in ifaces:
                 self.logger.warning("Could not get OperStatus for interface %s", ifname)
             else:
-                if int(ifaces[ifname].flags) & 1:
+                if int(ifaces[ifname].flags) & 2:
                     oper_status = 1  # up
                 else:
                     oper_status = 2  # down