[ovs-dev] datapath-windows: fix NULL check in OvsGetExtInfoIoctl()
diff mbox

Message ID 1445292940-18062-1-git-send-email-nithin@vmware.com
State Accepted
Headers show

Commit Message

Nithin Raju Oct. 19, 2015, 10:15 p.m. UTC
End result is that "mac_in_use" column gets populated in
OVSDB for internal and external NICs.

Signed-off-by: Nithin Raju <nithin@vmware.com>
---
 datapath-windows/ovsext/Vport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sairam Venugopal Oct. 20, 2015, 5:40 p.m. UTC | #1
Acked-by: Sairam Venugopal <vsairam@vmware.com>


On 10/19/15, 3:15 PM, "Nithin Raju" <nithin@vmware.com> wrote:

>End result is that "mac_in_use" column gets populated in
>OVSDB for internal and external NICs.
>
>Signed-off-by: Nithin Raju <nithin@vmware.com>
>---
> datapath-windows/ovsext/Vport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/datapath-windows/ovsext/Vport.c
>b/datapath-windows/ovsext/Vport.c
>index baab056..4ade842 100644
>--- a/datapath-windows/ovsext/Vport.c
>+++ b/datapath-windows/ovsext/Vport.c
>@@ -1542,7 +1542,7 @@ OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet,
>     if (vportGet->portNo == 0) {
>         StringCbLengthA(vportGet->name, OVS_MAX_PORT_NAME_LENGTH - 1,
>&len);
>         vport = OvsFindVportByHvNameA(gOvsSwitchContext, vportGet->name);
>-        if (vport != NULL) {
>+        if (vport == NULL) {
>             /* If the port is not a Hyper-V port and it has been added
>earlier,
>              * we'll find it in 'ovsPortNameHashArray'. */
>             vport = OvsFindVportByOvsName(gOvsSwitchContext,
>vportGet->name);
>-- 
>1.8.5.6
>
>_______________________________________________
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Dc
>ruz40PROJ40ROzSpxyQSLw6fcrOWpJgEcEmNR3JEQ&m=m9NFBHg3maSb2fqZPKIx3yirfva7B-
>masplgV_UhLYw&s=fetGxPkRbfi9RCaM7NdrcdPzn0rEfyn1FHacRS9OiZk&e=
Gurucharan Shetty Oct. 21, 2015, 11:27 p.m. UTC | #2
On Mon, Oct 19, 2015 at 3:15 PM, Nithin Raju <nithin@vmware.com> wrote:
> End result is that "mac_in_use" column gets populated in
> OVSDB for internal and external NICs.
>
> Signed-off-by: Nithin Raju <nithin@vmware.com>
Applied with the acks.

> ---
>  datapath-windows/ovsext/Vport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
> index baab056..4ade842 100644
> --- a/datapath-windows/ovsext/Vport.c
> +++ b/datapath-windows/ovsext/Vport.c
> @@ -1542,7 +1542,7 @@ OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet,
>      if (vportGet->portNo == 0) {
>          StringCbLengthA(vportGet->name, OVS_MAX_PORT_NAME_LENGTH - 1, &len);
>          vport = OvsFindVportByHvNameA(gOvsSwitchContext, vportGet->name);
> -        if (vport != NULL) {
> +        if (vport == NULL) {
>              /* If the port is not a Hyper-V port and it has been added earlier,
>               * we'll find it in 'ovsPortNameHashArray'. */
>              vport = OvsFindVportByOvsName(gOvsSwitchContext, vportGet->name);
> --
> 1.8.5.6
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

Patch
diff mbox

diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
index baab056..4ade842 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -1542,7 +1542,7 @@  OvsGetExtInfoIoctl(POVS_VPORT_GET vportGet,
     if (vportGet->portNo == 0) {
         StringCbLengthA(vportGet->name, OVS_MAX_PORT_NAME_LENGTH - 1, &len);
         vport = OvsFindVportByHvNameA(gOvsSwitchContext, vportGet->name);
-        if (vport != NULL) {
+        if (vport == NULL) {
             /* If the port is not a Hyper-V port and it has been added earlier,
              * we'll find it in 'ovsPortNameHashArray'. */
             vport = OvsFindVportByOvsName(gOvsSwitchContext, vportGet->name);