]> granicus.if.org Git - libnl/commitdiff
fix of boolean operators
authorSimon Buttgereit <simon.buttgereit@gmail.com>
Wed, 8 Feb 2017 08:14:40 +0000 (09:14 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 27 Feb 2017 15:43:48 +0000 (16:43 +0100)
Mixed up boolean operators in commit f38fb7a.
This commit is the appropriate fix.

lib/xfrm/sp.c

index 46699dd9472f25f7fabfb619b321f62a795c2b38..cb518613bd0e8b872d747d3adcb14bc72cce523c 100644 (file)
@@ -765,8 +765,8 @@ static int build_xfrm_sp_message(struct xfrmnl_sp *tmpl, int cmd, int flags, str
        uint32_t                    len;
        struct nl_addr*             addr;
 
-       if (!(tmpl->ce_mask & XFRM_SP_ATTR_DIR) &&
-                       (!(tmpl->ce_mask & XFRM_SP_ATTR_INDEX) ||
+       if (!(tmpl->ce_mask & XFRM_SP_ATTR_DIR) ||
+                       (!(tmpl->ce_mask & XFRM_SP_ATTR_INDEX) &&
                         !(tmpl->ce_mask & XFRM_SP_ATTR_SEL)))
                return -NLE_MISSING_ATTR;
 
@@ -958,8 +958,8 @@ static int build_xfrm_sp_delete_message(struct xfrmnl_sp *tmpl, int cmd, int fla
        struct nl_addr*             addr;
        uint32_t                                        len;
 
-       if (!(tmpl->ce_mask & XFRM_SP_ATTR_DIR) &&
-                       (!(tmpl->ce_mask & XFRM_SP_ATTR_INDEX) ||
+       if (!(tmpl->ce_mask & XFRM_SP_ATTR_DIR) ||
+                       (!(tmpl->ce_mask & XFRM_SP_ATTR_INDEX) &&
                         !(tmpl->ce_mask & XFRM_SP_ATTR_SEL)))
                return -NLE_MISSING_ATTR;