diff options
author | roopa <roopa@cumulusnetworks.com> | 2013-02-15 18:26:29 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2013-02-24 16:06:54 (GMT) |
commit | 8f151fadda62bdbd363b8d4a0167d5d29bb5163b (patch) | |
tree | f3c0c464a88a0eac6cf0d2daa1ee2f3c7aec42d5 /lib/route/link.c | |
parent | 1ecf98a23e4ba309eb1f94b824d5f973d3fee0d2 (diff) | |
download | libnl-8f151fadda62bdbd363b8d4a0167d5d29bb5163b.zip libnl-8f151fadda62bdbd363b8d4a0167d5d29bb5163b.tar.gz libnl-8f151fadda62bdbd363b8d4a0167d5d29bb5163b.tar.bz2 |
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 <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>
Diffstat (limited to 'lib/route/link.c')
-rw-r--r-- | lib/route/link.c | 12 |
1 files 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; |