diff mbox

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

Message ID 20161027192023.11156-1-aserdean@cloudbasesolutions.com
State Accepted
Delegated to: Guru Shetty
Headers show

Commit Message

Alin Serdean Oct. 27, 2016, 7:20 p.m. UTC
Use bitwise comparison when checking flags set by the kernel for the
device.

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

Comments

Sairam Venugopal Oct. 27, 2016, 8:44 p.m. UTC | #1
Acked-by: Sairam Venugopal <vsairam@vmware.com>


On 10/27/16, 12:20 PM, "Alin Serdean" <aserdean@cloudbasesolutions.com>
wrote:

>Use bitwise comparison when checking flags set by the kernel for the
>device.
>
>Signed-off-by: Alin Gabriel Serdean <aserdean@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
>_______________________________________________
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev&d=CwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Dc
>ruz40PROJ40ROzSpxyQSLw6fcrOWpJgEcEmNR3JEQ&m=4CDe4lKBXjOoLlQZxCqFEhQcqst98G
>z2UAbZ8pZAl0k&s=FS2RIMVZeM8240lgqp5h8xxTvELywWt0dlzJqmDlVZ4&e=
diff mbox

Patch

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;
     }