]> granicus.if.org Git - libnl/commitdiff
link: move af_data_compare to the end
authorroopa <roopa@cumulusnetworks.com>
Fri, 15 Feb 2013 18:26:29 +0000 (10:26 -0800)
committerThomas Graf <tgraf@suug.ch>
Sun, 24 Feb 2013 16:06:54 +0000 (17:06 +0100)
In the current code if rtnl_link_af_data_compare returns value > 0
we mark PROTINFO attribute in the diff mask and return without
comparing flags.

This patch makes af_data to be the last thing we compare.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Nolan Leake <nolan@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/route/link.c

index 7450545f9f4d1b07e9fbe14a8f813512d36cff06..77dd7f129c390944b8e6e7511f20baaab4dadfbf 100644 (file)
@@ -867,6 +867,12 @@ static int link_compare(struct nl_object *_a, struct nl_object *_b,
        diff |= LINK_DIFF(NUM_RX_QUEUES,a->l_num_rx_queues != b->l_num_rx_queues);
        diff |= LINK_DIFF(GROUP,        a->l_group != b->l_group);
 
+       if (flags & LOOSE_COMPARISON)
+               diff |= LINK_DIFF(FLAGS,
+                                 (a->l_flags ^ b->l_flags) & b->l_flag_mask);
+       else
+               diff |= LINK_DIFF(FLAGS, a->l_flags != b->l_flags);
+
        /*
         * Compare LINK_ATTR_PROTINFO af_data
         */
@@ -875,12 +881,6 @@ static int link_compare(struct nl_object *_a, struct nl_object *_b,
                        goto protinfo_mismatch;
        }
 
-       if (flags & LOOSE_COMPARISON)
-               diff |= LINK_DIFF(FLAGS,
-                                 (a->l_flags ^ b->l_flags) & b->l_flag_mask);
-       else
-               diff |= LINK_DIFF(FLAGS, a->l_flags != b->l_flags);
-
 out:
        return diff;