From: Ben Pfaff Date: Mon, 29 Dec 2008 22:29:26 +0000 (-0800) Subject: vswitchd: Fix svec_diff(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc90ef89bd7d5f86e900ff0f8b75acffbec52d45;p=openvswitch vswitchd: Fix svec_diff(). The logic bugs here were causing bridge.c to do too much work adding and deleting interfaces unnecessarily and perhaps in some circumstances getting the set of interfaces wrong entirely. --- diff --git a/lib/svec.c b/lib/svec.c index bb58408e..59d806cf 100644 --- a/lib/svec.c +++ b/lib/svec.c @@ -148,12 +148,12 @@ svec_diff(const struct svec *a, const struct svec *b, } for (i = j = 0; i < a->n && j < b->n; ) { int cmp = strcmp(a->names[i], b->names[j]); - if (cmp > 0) { + if (cmp < 0) { if (a_only) { svec_add(a_only, a->names[i]); } i++; - } else if (cmp < 0) { + } else if (cmp > 0) { if (b_only) { svec_add(b_only, b->names[j]); }