From 8f151fadda62bdbd363b8d4a0167d5d29bb5163b Mon Sep 17 00:00:00 2001 From: roopa Date: Fri, 15 Feb 2013 10:26:29 -0800 Subject: link: move af_data_compare to the end 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 Reviewed-by: Nolan Leake Reviewed-by: Shrijeet Mukherjee Reviewed-by: Wilson Kok Signed-off-by: Thomas Graf --- lib/route/link.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/route/link.c b/lib/route/link.c index 7450545..77dd7f1 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -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; -- cgit v0.12