netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Ahern <dsahern@kernel.org>
Cc: netdev@vger.kernel.org, Jason@zx2c4.com, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH iproute2] ip route: Set rtm_dst_len to 32 for all ip route get requests
Date: Wed, 22 May 2019 16:16:52 -0700	[thread overview]
Message-ID: <20190522161652.42104430@xps13.lan> (raw)
In-Reply-To: <20190517175913.20629-1-dsahern@kernel.org>

On Fri, 17 May 2019 10:59:13 -0700
David Ahern <dsahern@kernel.org> wrote:

> index 2b3dcc5dbd53..d980b86ffd42 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -2035,7 +2035,11 @@ static int iproute_get(int argc, char **argv)
>  			if (addr.bytelen)
>  				addattr_l(&req.n, sizeof(req),
>  					  RTA_DST, &addr.data, addr.bytelen);
> -			req.r.rtm_dst_len = addr.bitlen;
> +			/* kernel ignores prefix length on 'route get'
> +			 * requests; to allow ip to work with strict mode
> +			 * but not break existing users, just set to 32
> +			 */
> +			req.r.rtm_dst_len = 32;
>  			address_found = true;
>  		}
>  		argc--; argv++;

Why not warn user that any prefix length (ie not 32) is ignored,
then do what you propose.

  parent reply	other threads:[~2019-05-22 23:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 17:59 [PATCH iproute2] ip route: Set rtm_dst_len to 32 for all ip route get requests David Ahern
2019-05-17 18:06 ` Stephen Hemminger
2019-05-22 23:16 ` Stephen Hemminger [this message]
2019-05-23  3:42   ` David Ahern

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=20190522161652.42104430@xps13.lan \
    --to=stephen@networkplumber.org \
    --cc=Jason@zx2c4.com \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).