diff mbox

[ovs-dev,7/8] ovn-nbctl: Update logical switch port commands.

Message ID 18D4F5FE-99E1-4333-82EA-EA1FB238DBD0@ovn.org
State Accepted
Headers show

Commit Message

Justin Pettit June 10, 2016, 11:54 p.m. UTC
> On Jun 9, 2016, at 3:28 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> On Thu, Jun 09, 2016 at 12:12:41AM -0700, Justin Pettit wrote:
>> A few minor changes related to logical switch port commands:
>> 
>>    - Use "lsp" instead of "lport" to be more consistent with later
>>      changes.
>>    - Use commands where possible in ovn unit tests.
>>    - Update references from "lport" to "lsp" (code) or "port" (user).
>> 
>> Signed-off-by: Justin Pettit <jpettit@ovn.org>
> 
> I get these "sparse" warnings.  Maybe they were there for previous
> patches and I missed them.
> 
> ../ovn/utilities/ovn-nbctl.c:1603:23: warning: restricted ovs_be32 degrades to integer
> ../ovn/utilities/ovn-nbctl.c:1603:39: warning: restricted ovs_be32 degrades to integer
> 
> I barely skimmed this patch, so take my ack with that in mind

Whoops.  That actually caught an endian bug in my sorting algorithm for listing routes.  Here's an incremental on that patch to fix the issue:


> Acked-by: Ben Pfaff <blp@ovn.org>

Thanks!

--Justin
diff mbox

Patch

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 8656e10..a8e4294 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -1703,7 +1703,7 @@  ipv4_route_cmp(const void *route1_, const void *route2_)
     if (route1p->plen != route2p->plen) {
         return route1p->plen > route2p->plen ? -1 : 1;
     } else if (route1p->addr != route2p->addr) {
-        return route1p->addr < route2p->addr ? -1 : 1;
+        return ntohl(route1p->addr) < ntohl(route2p->addr) ? -1 : 1;
     } else {
         return 0;
     }