[ovs-dev] [PATCH 2/2] netdev-windows: use bitwise comparison for flags

Alin Serdean aserdean at cloudbasesolutions.com
Thu Oct 27 19:20:26 UTC 2016


Use bitwise comparison when checking flags set by the kernel for the
device.

Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
---
 lib/netdev-windows.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c
index 423a00b..f5e809e 100644
--- a/lib/netdev-windows.c
+++ b/lib/netdev-windows.c
@@ -138,11 +138,11 @@ dp_to_netdev_ifi_flags(uint32_t dp_flags)
 {
     uint32_t nd_flags = 0;
 
-    if (dp_flags && OVS_WIN_NETDEV_IFF_UP) {
+    if (dp_flags & OVS_WIN_NETDEV_IFF_UP) {
         nd_flags |= NETDEV_UP;
     }
 
-    if (dp_flags && OVS_WIN_NETDEV_IFF_PROMISC) {
+    if (dp_flags & OVS_WIN_NETDEV_IFF_PROMISC) {
         nd_flags |= NETDEV_PROMISC;
     }
 
-- 
2.9.2.windows.1



More information about the dev mailing list