All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4
@ 2019-01-12 20:54 Jakub Kicinski
  2019-01-14 16:05 ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2019-01-12 20:54 UTC (permalink / raw)
  To: stephen, dsahern; +Cc: netdev, oss-drivers, Jakub Kicinski

Kernel ignores the RTM_F_LOOKUP_TABLE flag for all families
but IPv4.  Don't set it, otherwise it may fall foul of
strict checking policies.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 ip/iproute.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ip/iproute.c b/ip/iproute.c
index 0440366ee26a..5f58a3b34406 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -2068,7 +2068,9 @@ static int iproute_get(int argc, char **argv)
 	if (req.r.rtm_family == AF_UNSPEC)
 		req.r.rtm_family = AF_INET;
 
-	req.r.rtm_flags |= RTM_F_LOOKUP_TABLE;
+	/* Only IPv4 supports the RTM_F_LOOKUP_TABLE flag */
+	if (req.r.rtm_family == AF_INET)
+		req.r.rtm_flags |= RTM_F_LOOKUP_TABLE;
 	if (fib_match)
 		req.r.rtm_flags |= RTM_F_FIB_MATCH;
 
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4
  2019-01-12 20:54 [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4 Jakub Kicinski
@ 2019-01-14 16:05 ` Stephen Hemminger
  2019-01-14 16:29   ` David Ahern
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2019-01-14 16:05 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: dsahern, netdev, oss-drivers

On Sat, 12 Jan 2019 12:54:06 -0800
Jakub Kicinski <jakub.kicinski@netronome.com> wrote:

> Kernel ignores the RTM_F_LOOKUP_TABLE flag for all families
> but IPv4.  Don't set it, otherwise it may fall foul of
> strict checking policies.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Doing the right thing is a good idea, but really I can't see
the point of doing this. The kernel will always have to accept
requests from older versions of iproute2 (it can never be stricter)
because of ABI compatibility. So unless you can make a stronger
case for this; no not applying it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4
  2019-01-14 16:05 ` Stephen Hemminger
@ 2019-01-14 16:29   ` David Ahern
  2019-01-21  7:32     ` Ido Schimmel
  0 siblings, 1 reply; 7+ messages in thread
From: David Ahern @ 2019-01-14 16:29 UTC (permalink / raw)
  To: Stephen Hemminger, Jakub Kicinski; +Cc: netdev, oss-drivers

On 1/14/19 9:05 AM, Stephen Hemminger wrote:
> On Sat, 12 Jan 2019 12:54:06 -0800
> Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> 
>> Kernel ignores the RTM_F_LOOKUP_TABLE flag for all families
>> but IPv4.  Don't set it, otherwise it may fall foul of
>> strict checking policies.
>>
>> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> 
> Doing the right thing is a good idea, but really I can't see
> the point of doing this. The kernel will always have to accept
> requests from older versions of iproute2 (it can never be stricter)
> because of ABI compatibility. So unless you can make a stronger
> case for this; no not applying it.
> 

iproute2 is often used as a reference model for features. Making
iproute2 correct is the right thing to do regardless of whether what the
kernel accepts.

Current master branch is the first iproute2 to use the strict checking,
and its first release with strict checking should have as many of these
little one offs as possible fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4
  2019-01-14 16:29   ` David Ahern
@ 2019-01-21  7:32     ` Ido Schimmel
  2019-01-21 14:56       ` David Ahern
  2019-01-22 16:32       ` David Ahern
  0 siblings, 2 replies; 7+ messages in thread
From: Ido Schimmel @ 2019-01-21  7:32 UTC (permalink / raw)
  To: David Ahern; +Cc: Stephen Hemminger, Jakub Kicinski, netdev, oss-drivers

On Mon, Jan 14, 2019 at 09:29:51AM -0700, David Ahern wrote:
> On 1/14/19 9:05 AM, Stephen Hemminger wrote:
> > On Sat, 12 Jan 2019 12:54:06 -0800
> > Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> > 
> >> Kernel ignores the RTM_F_LOOKUP_TABLE flag for all families
> >> but IPv4.  Don't set it, otherwise it may fall foul of
> >> strict checking policies.
> >>
> >> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> > 
> > Doing the right thing is a good idea, but really I can't see
> > the point of doing this. The kernel will always have to accept
> > requests from older versions of iproute2 (it can never be stricter)
> > because of ABI compatibility. So unless you can make a stronger
> > case for this; no not applying it.
> > 
> 
> iproute2 is often used as a reference model for features. Making
> iproute2 correct is the right thing to do regardless of whether what the
> kernel accepts.
> 
> Current master branch is the first iproute2 to use the strict checking,
> and its first release with strict checking should have as many of these
> little one offs as possible fixed.

With current iproute2-next and net-next I get:

$ ip -6 route get 2001:db8:1::2
Error: ipv6: Invalid flags for get route request.

Are we going to patch the kernel to accept a flag it is not using or are
we going to patch iproute2 to not send it?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4
  2019-01-21  7:32     ` Ido Schimmel
@ 2019-01-21 14:56       ` David Ahern
  2019-01-22 16:32       ` David Ahern
  1 sibling, 0 replies; 7+ messages in thread
From: David Ahern @ 2019-01-21 14:56 UTC (permalink / raw)
  To: Ido Schimmel; +Cc: Stephen Hemminger, Jakub Kicinski, netdev, oss-drivers

On 1/21/19 12:32 AM, Ido Schimmel wrote:
> On Mon, Jan 14, 2019 at 09:29:51AM -0700, David Ahern wrote:
>> On 1/14/19 9:05 AM, Stephen Hemminger wrote:
>>> On Sat, 12 Jan 2019 12:54:06 -0800
>>> Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
>>>
>>>> Kernel ignores the RTM_F_LOOKUP_TABLE flag for all families
>>>> but IPv4.  Don't set it, otherwise it may fall foul of
>>>> strict checking policies.
>>>>
>>>> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>>>
>>> Doing the right thing is a good idea, but really I can't see
>>> the point of doing this. The kernel will always have to accept
>>> requests from older versions of iproute2 (it can never be stricter)
>>> because of ABI compatibility. So unless you can make a stronger
>>> case for this; no not applying it.
>>>
>>
>> iproute2 is often used as a reference model for features. Making
>> iproute2 correct is the right thing to do regardless of whether what the
>> kernel accepts.
>>
>> Current master branch is the first iproute2 to use the strict checking,
>> and its first release with strict checking should have as many of these
>> little one offs as possible fixed.
> 
> With current iproute2-next and net-next I get:
> 
> $ ip -6 route get 2001:db8:1::2
> Error: ipv6: Invalid flags for get route request.
> 
> Are we going to patch the kernel to accept a flag it is not using or are
> we going to patch iproute2 to not send it?
> 

iproute2 (master should have the problem too) should not send the flag
for IPv6. Stephen should apply Jakub's patch and I can merge branches.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4
  2019-01-21  7:32     ` Ido Schimmel
  2019-01-21 14:56       ` David Ahern
@ 2019-01-22 16:32       ` David Ahern
  2019-01-22 16:43         ` Ido Schimmel
  1 sibling, 1 reply; 7+ messages in thread
From: David Ahern @ 2019-01-22 16:32 UTC (permalink / raw)
  To: Ido Schimmel; +Cc: Stephen Hemminger, Jakub Kicinski, netdev, oss-drivers

On 1/21/19 12:32 AM, Ido Schimmel wrote:
> Are we going to patch the kernel to accept a flag it is not using or are
> we going to patch iproute2 to not send it?

Stephen merged this patch to master; I merged to next. should be good now.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4
  2019-01-22 16:32       ` David Ahern
@ 2019-01-22 16:43         ` Ido Schimmel
  0 siblings, 0 replies; 7+ messages in thread
From: Ido Schimmel @ 2019-01-22 16:43 UTC (permalink / raw)
  To: David Ahern; +Cc: Stephen Hemminger, Jakub Kicinski, netdev, oss-drivers

On Tue, Jan 22, 2019 at 09:32:44AM -0700, David Ahern wrote:
> On 1/21/19 12:32 AM, Ido Schimmel wrote:
> > Are we going to patch the kernel to accept a flag it is not using or are
> > we going to patch iproute2 to not send it?
> 
> Stephen merged this patch to master; I merged to next. should be good now.

Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-22 16:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-12 20:54 [PATCH iproute2] ip route: get: only set RTM_F_LOOKUP_TABLE flag for IPv4 Jakub Kicinski
2019-01-14 16:05 ` Stephen Hemminger
2019-01-14 16:29   ` David Ahern
2019-01-21  7:32     ` Ido Schimmel
2019-01-21 14:56       ` David Ahern
2019-01-22 16:32       ` David Ahern
2019-01-22 16:43         ` Ido Schimmel

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.