Re: [ovs-dev] [PATCH] ovn-northd: add chassis nonull check

2017-09-21 Thread Miguel Angel Ajo Pelayo
Thank you, that was my doing, thanks for finding and fixing!!

On Tue, Sep 19, 2017 at 8:07 PM, Russell Bryant  wrote:

> On Tue, Sep 19, 2017 at 5:49 AM,   wrote:
> > op->sb->gateway_chassis[0]->chassis may null in some special cases, need
> > to add a check to avoid segment fault.
> >
> > Signed-off-by: wang qianyu 
>
> Thanks!  I applied this to master and branch-2.8.
>
> It looks like the patch was sent with a regular mail client, which
> corrupted the patch.  Since it was small i was able to apply it
> manually.  In the future, please post patches using "git send-email".
>
> Thanks,
>
> --
> Russell Bryant
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] ovn-northd: add chassis nonull check

2017-09-19 Thread Russell Bryant
On Tue, Sep 19, 2017 at 5:49 AM,   wrote:
> op->sb->gateway_chassis[0]->chassis may null in some special cases, need
> to add a check to avoid segment fault.
>
> Signed-off-by: wang qianyu 

Thanks!  I applied this to master and branch-2.8.

It looks like the patch was sent with a regular mail client, which
corrupted the patch.  Since it was small i was able to apply it
manually.  In the future, please post patches using "git send-email".

Thanks,

-- 
Russell Bryant
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] ovn-northd: add chassis nonull check

2017-09-19 Thread wang . qianyu
op->sb->gateway_chassis[0]->chassis may null in some special cases, need 
to add a check to avoid segment fault.

Signed-off-by: wang qianyu 
---
 ovn/northd/ovn-northd.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 49e4ac3..9dd159d 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -1887,8 +1887,10 @@ ovn_port_update_sbrec(struct northd_context *ctx,
 /* If we found the chassis, and the gw chassis on 
record
  * differs from what we expect go ahead and update */
 if (op->sb->n_gateway_chassis != 1
-|| 
strcmp(op->sb->gateway_chassis[0]->chassis->name,
-  chassis->name)
+|| !op->sb->gateway_chassis[0]->chassis
+|| (op->sb->gateway_chassis[0]->chassis &&
+ strcmp(op->sb->gateway_chassis[0]->chassis->name,
+  chassis->name))
 || op->sb->gateway_chassis[0]->priority != 0) {
 /* Construct a single Gateway_Chassis entry on 
the
  * Port_Binding attached to the redirect_chassis
-- 
1.8.3.1
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev