From patchwork Thu Jun 9 20:05:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ahern X-Patchwork-Id: 633149 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rQbsD3kV1z9sdn for ; Fri, 10 Jun 2016 06:05:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b=YEP/x+65; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751248AbcFIUFu (ORCPT ); Thu, 9 Jun 2016 16:05:50 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:33273 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbcFIUFt (ORCPT ); Thu, 9 Jun 2016 16:05:49 -0400 Received: by mail-pa0-f50.google.com with SMTP id ec8so16225296pac.0 for ; Thu, 09 Jun 2016 13:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=from:to:cc:subject:date:message-id; bh=x0dM+6AbfvoePRaP+A3tC8eQ+kEjVyn8zRHzCGPhWMY=; b=YEP/x+65lR76LVl+wopWZiqxgDdMaecNcw8ajLlzkZ8MsBWfJ+ILPC73R/nJoEzWpx vPrtvn9co9ObfEJ/RmkvKHCC1N2WQvsNeq4PSZAJsj9dnfepeUA3EKVv23Y/zg1mIqNY 5H29o0Bz0Rf9QGCv3pAFbYca6s9oNZqjgTlus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=x0dM+6AbfvoePRaP+A3tC8eQ+kEjVyn8zRHzCGPhWMY=; b=d87xUZsrk9kMbRrlxC3ZmYNZdtbKmgg+VNnj//9AYcTwSlritCIIPmlsMfx46yLN98 tBMcSqofJm1DBzXk2K7QO80PjRS3mBbB+9DMowaumStznGG0hdtiWt2XosUjM+imA3wd VuPp9VypoYvmH2ivHZwFx7o2B1ddSaNmWgX4O6efQQt63mBIPLk95EkwpbENhJ28X9rL W9UrDblKJN/Mjx63bczg7SmSrDx+Z98APEyVvYZhMYXYANero1JQctIyR51QaZkOAQWs L8EYH775++Nhk6JPHq9CZr+ipTdhuPhL4bOnYBhPB66yOcPHakr/LIbTm7rrOD4Z/UoJ 5qZQ== X-Gm-Message-State: ALyK8tJYyfPq9UrePVdS5ZeoPEhOuFoEVdwAyOhcLMAM+tKr9+A33hGFCOizf9n315gI0WdY X-Received: by 10.66.25.231 with SMTP id f7mr14328207pag.65.1465502748818; Thu, 09 Jun 2016 13:05:48 -0700 (PDT) Received: from kenny.cumulusnetworks.com. ([216.129.126.126]) by smtp.googlemail.com with ESMTPSA id l129sm12103119pfc.5.2016.06.09.13.05.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jun 2016 13:05:48 -0700 (PDT) From: David Ahern To: netdev@vger.kernel.org Cc: stephen@networkplumber.org, David Ahern Subject: [PATCH iproute2] ip route: Add annotation for replaced routes Date: Thu, 9 Jun 2016 13:05:42 -0700 Message-Id: <1465502742-17289-1-git-send-email-dsa@cumulusnetworks.com> X-Mailer: git-send-email 2.1.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If NLM_F_REPLACE flag is set then a route is replacing an existing route. Prepend "Replaced " to these routes similar to how "Deleted " is added to deleted routes. Signed-off-by: David Ahern --- ip/iproute.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ip/iproute.c b/ip/iproute.c index 8224d7ffa94b..28b47bcb7312 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -363,6 +363,8 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) return 0; } + if (n->nlmsg_flags & NLM_F_REPLACE) + fprintf(fp, "Replaced "); if (n->nlmsg_type == RTM_DELROUTE) fprintf(fp, "Deleted "); if ((r->rtm_type != RTN_UNICAST || show_details > 0) && !filter.type)