All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Shearman <rshearma@brocade.com>
To: Roopa Prabhu <roopa@cumulusnetworks.com>, <ebiederm@xmission.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<vivek@cumulusnetworks.com>
Subject: Re: [PATCH net iproute2 v2 1/2] mpls: always set type as RTN_UNICAST for route add/deletes
Date: Thu, 28 May 2015 10:17:07 +0100	[thread overview]
Message-ID: <5566DD13.2070800@brocade.com> (raw)
In-Reply-To: <1432751825-40804-2-git-send-email-roopa@cumulusnetworks.com>

On 27/05/15 19:37, Roopa Prabhu wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> Kernel expects type RTN_UNICAST for mpls route/dels
>
> Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Reviewed-by: Robert Shearman <rshearma@brocade.com>

> ---
>   ip/iproute.c |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/ip/iproute.c b/ip/iproute.c
> index 670a4c6..71c088b 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -803,6 +803,7 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
>   	int scope_ok = 0;
>   	int table_ok = 0;
>   	int raw = 0;
> +	int type_ok = 0;
>
>   	memset(&req, 0, sizeof(req));
>
> @@ -1095,6 +1096,7 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
>   			    rtnl_rtntype_a2n(&type, *argv) == 0) {
>   				NEXT_ARG();
>   				req.r.rtm_type = type;
> +				type_ok = 1;
>   			}
>
>   			if (matches(*argv, "help") == 0)
> @@ -1160,6 +1162,9 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
>   		}
>   	}
>
> +	if (!type_ok && req.r.rtm_family == AF_MPLS)
> +		req.r.rtm_type = RTN_UNICAST;
> +
>   	if (req.r.rtm_family == AF_UNSPEC)
>   		req.r.rtm_family = AF_INET;
>
>

      parent reply	other threads:[~2015-05-28  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27 18:37 [PATCH net iproute2 v2 1/2] mpls: always set type as RTN_UNICAST for route add/deletes Roopa Prabhu
2015-05-27 19:59 ` Robert Shearman
2015-05-27 20:08   ` roopa
2015-05-28  0:06     ` roopa
2015-05-28  9:15       ` Robert Shearman
2015-05-28  9:17 ` Robert Shearman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5566DD13.2070800@brocade.com \
    --to=rshearma@brocade.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=vivek@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.