From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: BUG REPORT: iproute2 seems to have bug with dsfield/tos in ip-rule and ip-route Date: Wed, 13 Dec 2017 15:40:13 -0700 Message-ID: <224860aa-17a8-37a1-cbfe-66899c1bba94@gmail.com> References: <9e606c3b-915c-2608-c8aa-aa3167f51f8d@street-artists.org> <20171213101259.65652da6@xeon-e3> <4f4e5fc5-2141-9e38-2f5f-da5f7558d505@street-artists.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org To: Daniel Lakeland , Stephen Hemminger Return-path: Received: from mail-pg0-f43.google.com ([74.125.83.43]:34170 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011AbdLMWkQ (ORCPT ); Wed, 13 Dec 2017 17:40:16 -0500 Received: by mail-pg0-f43.google.com with SMTP id j4so2065584pgp.1 for ; Wed, 13 Dec 2017 14:40:16 -0800 (PST) In-Reply-To: <4f4e5fc5-2141-9e38-2f5f-da5f7558d505@street-artists.org> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/13/17 12:05 PM, Daniel Lakeland wrote: > Following up my previous email with output from the machine: > Note that like some of those other people I was able to get ip rule to > accept tos values with just low order bits set > > Here is example of how ip rule accepts low order dsfield bits but not > modern DSCP type bits, also including some version info > > dlakelan@pingpong:~$ sudo ip rule add dsfield 0x0c table 100 > dlakelan@pingpong:~$ ip rule show > 0:    from all lookup local > 32765:    from all tos 0x0c lookup 100 > 32766:    from all lookup main > 32767:    from all lookup default > > > dlakelan@pingpong:~$ sudo ip rule add dsfield 0xc0 table 100 > RTNETLINK answers: Invalid argument In fib4_rule_configure, this the check that is failing: if (frh->tos & ~IPTOS_TOS_MASK) goto errout; and EINVAL is returned. IPv4 routes has not checking on tos -- it is passed from user and rtm_tos to fc_tos to fib alias tos.