From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D9A2C0044B for ; Wed, 13 Feb 2019 20:37:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E70A221872 for ; Wed, 13 Feb 2019 20:37:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="1wLBcDM8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389165AbfBMUh5 (ORCPT ); Wed, 13 Feb 2019 15:37:57 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36196 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfBMUh4 (ORCPT ); Wed, 13 Feb 2019 15:37:56 -0500 Received: by mail-pl1-f195.google.com with SMTP id g9so1769886plo.3 for ; Wed, 13 Feb 2019 12:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jrE+6MSutLZKL4gDcdivWsL31I1Az6HTq/tO0VRlvx4=; b=1wLBcDM8Hb2rw6dWnE2ZXqr2VASKBpaKm4RKng3SliDSmSOGi9Z3E6AbB4URatJADn t+4kMPziVEoNqzYws9CqMsp8ogf/as+GqzBFUUUJU1yx59TssnbnbYTDJkDaEaDgd9i4 UAlE/7ENnh3mnnFj3Z+tbJHuILFKqUkqwEwDbKcXUCwXzB9sdJRqgJBXA8p5fID+x4Z0 dHazcTA810BQBplFOdshFwRvfmmZ0VZbEzvsHyDbu4C5efogSByhP3E8yC9sT4xTKRR0 +C40vPwMnkoYEcD4jfvJSvx2YBCfAyeO4G7kiMcfTvBb3nPt/L6C/Tnp/DGVMt6WpZw2 V9Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jrE+6MSutLZKL4gDcdivWsL31I1Az6HTq/tO0VRlvx4=; b=RY3cXtc2CzKdmbyby8bLGiiyEByqE+XL1w7oh4ot2fjfslgJQTuoK0gbv9yvWVjnzN oLb0jOKUk6xo6Iklk/ZimHvW68vR+4sJBwg8QvZYp7ZIft+7LpUOoOMU1f9fghnBVimh gEQqwMpFAFXkyFE0zxBDQhSW1mPbb630bfgJGEA1RFoEOmwRTGUY+tegtLbjZE+aYnsk UtynbzhoQZefQM2cnFk+1YpZ5W6xqkT/yc4ae16ssu/P++rZc7GRjAll9E+poPr1yn/b p0PM+qQ/k59QcxrYQ4pi8/U1wu6NtEYmP2mCEOcItydkHF3pDjRTu1tklEq5cW/8dlZ7 o3iw== X-Gm-Message-State: AHQUAuZbWllgWSyLc865pGXvREJAFKHVIkwfm/cWbgG/84C5gOObGHrd uiiEZ02Mgi0Nq84GQ2zwr6jxDg== X-Google-Smtp-Source: AHgI3IY5uhLezcqEb0ufg6y5SeOWAefXiSSE4JDcgjNYKVGCVfroO1rM0EpGUfklOxAKiichE41xAw== X-Received: by 2002:a17:902:8695:: with SMTP id g21mr20407plo.83.1550090275120; Wed, 13 Feb 2019 12:37:55 -0800 (PST) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id v4sm215015pfv.172.2019.02.13.12.37.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Feb 2019 12:37:55 -0800 (PST) Date: Wed, 13 Feb 2019 12:37:50 -0800 From: Stephen Hemminger To: Luca Boccassi Cc: netdev@vger.kernel.org, =?UTF-8?B?Q2zDqW1lbnQ=?= Hertling Subject: Re: [RFC iproute2] ip route: get: allow zero-length subnet mask Message-ID: <20190213123750.610ead92@shemminger-XPS-13-9360> In-Reply-To: <20190213200954.32271-1-bluca@debian.org> References: <20190213200954.32271-1-bluca@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 13 Feb 2019 20:09:53 +0000 Luca Boccassi wrote: > A /0 subnet mask is theoretically valid, but ip route get doesn't allow > it: >=20 > $ ip route get 1.0.0.0/0 > need at least a destination address >=20 > Remove the check so that it can go through: >=20 > $ ip/ip route get 1.0.0.0/0 > 1.0.0.0 via 192.168.1.1 dev eth0 src 192.168.1.91 uid 1000 > cache >=20 > Reported-by: Cl=C3=A9ment Hertling > Signed-off-by: Luca Boccassi > --- > Stephen et al, this was reported by a Debian user: >=20 > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D921737 >=20 > It makes sense to me at a cursory glance, but sending as RFC as I'm > not 100% familiar with the route get function. >=20 > ip/iproute.c | 5 ----- > 1 file changed, 5 deletions(-) >=20 > diff --git a/ip/iproute.c b/ip/iproute.c > index 5f58a3b3..d78f43d8 100644 > --- a/ip/iproute.c > +++ b/ip/iproute.c > @@ -2041,11 +2041,6 @@ static int iproute_get(int argc, char **argv) > argc--; argv++; > } > =20 > - if (req.r.rtm_dst_len =3D=3D 0) { > - fprintf(stderr, "need at least a destination address\n"); > - return -1; > - } > - > if (idev || odev) { > int idx; > =20 You still need a way to report error for: ip route get (i.e when no address is present)