All of lore.kernel.org
 help / color / mirror / Atom feed
* [iproute2] a 'ip rule ...' bug?
@ 2010-03-26 12:15 thomas yang
  2010-03-30  2:42 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: thomas yang @ 2010-03-26 12:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

in  /etc/iproute2/rt_dsfield
...
# Newer RFC2597 values
0x28	AF11
0x30	AF12
0x38	AF13
...

---in   ip  man page ---
ip rule add - insert a new rule

tos TOS
dsfield TOS
    select the TOS value to match.
---

[root@localhost ~]# ip rule add dsfield 0x28 table 200
Error: argument "dsfield" is wrong: Failed to parse rule type

why???
how to match 'dsfield' ?

[root@localhost ~]# ip rule add tos 0x28 table 200
RTNETLINK answers: Invalid argument

(My OS is Fedora 11 :  kernel-2.6.30.10-105.2.23.fc11.i586 ,
iproute-2.6.29-2.fc11.i586 ;
on my another linux box ( Fedora 7)   'ip rule'  also has the same
problem  to match  tos and dsfield. )


--
Tom

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

* Re: [iproute2] a 'ip rule ...' bug?
  2010-03-26 12:15 [iproute2] a 'ip rule ...' bug? thomas yang
@ 2010-03-30  2:42 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2010-03-30  2:42 UTC (permalink / raw)
  To: thomas yang; +Cc: netdev

On Fri, 26 Mar 2010 20:15:30 +0800
thomas yang <lampsu@gmail.com> wrote:

> in  /etc/iproute2/rt_dsfield
> ...
> # Newer RFC2597 values
> 0x28	AF11
> 0x30	AF12
> 0x38	AF13
> ...


> ---in   ip  man page ---
> ip rule add - insert a new rule
> 
> tos TOS
> dsfield TOS
>     select the TOS value to match.
> ---

Read the syntax on the man page:
       ip rule  [ list | add | del | flush ] SELECTOR ACTION

       SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark
               FWMARK[/MASK] ] [ dev STRING ] [ pref NUMBER ]


There is no mention of dsfield argument.

> 
> [root@localhost ~]# ip rule add dsfield 0x28 table 200
> Error: argument "dsfield" is wrong: Failed to parse rule type
> 
> why???
> how to match 'dsfield' ?
> 
> [root@localhost ~]# ip rule add tos 0x28 table 200
> RTNETLINK answers: Invalid argument
> 
> (My OS is Fedora 11 :  kernel-2.6.30.10-105.2.23.fc11.i586 ,
> iproute-2.6.29-2.fc11.i586 ;
> on my another linux box ( Fedora 7)   'ip rule'  also has the same
> problem  to match  tos and dsfield. )

TOS field is masked by down to only 2 bits. 
See include/net/route.h in kernel source.
I think the reason was that with original TOS (pre dsfield) route design,
the implementors wanted to save space.


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

end of thread, other threads:[~2010-03-30  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-26 12:15 [iproute2] a 'ip rule ...' bug? thomas yang
2010-03-30  2:42 ` Stephen Hemminger

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.