Skip to contentSkip to conversation

some bug in iproute2

DISCUSSION Sergey Popov 3 participants 4 messages Aug 6, 2009 – Aug 8, 2009 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
# tc f add dev eth0 parent 1: proto ip prio 2 u32 match u32 0 0 action ipt -j MARK --set-mark 1
/usr/lib64/iptables/libipt_mark.so: cannot open shared object file: No such file or directory
failed to find target MARK

bad action parsing
parse_action: bad value (5:ipt)!
Illegal "action"

But mark target is compiled in kernel (not a module)

# iptables -t mangle -A PREROUTING -i eth1 -j MARK --set-mark 1
# iptables -t mangle -L PREROUTING
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
MARK       all  --  anywhere             anywhere            MARK xset
0x1/0xffffffff 

This shouldn't be.

#1 lore raw
Quoted 11 lines · Sergey Popov
# tc f add dev eth0 parent 1: proto ip prio 2 u32 match u32 0 0 action ipt -j MARK --set-mark 1
/usr/lib64/iptables/libipt_mark.so: cannot open shared object file: No such file or directory
failed to find target MARK

bad action parsing
parse_action: bad value (5:ipt)!
Illegal "action"

But mark target is compiled in kernel (not a module)

Quoted 8 lines
# iptables -t mangle -A PREROUTING -i eth1 -j MARK --set-mark 1
# iptables -t mangle -L PREROUTING
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
MARK       all  --  anywhere             anywhere            MARK xset
0x1/0xffffffff 

This shouldn't be.

If you're using iptables > 1.4.2 then it's a known problem. You can read more in a netdev thread:
Subject: iproute2 action/policer question
starting date: Tue, 09 Jun 2009 22:10:46 +0200

Jarek P.

#2 lore raw
Quoted 6 lines · Jarek Poplawski

On 06-08-2009 10:50, Sergey Popov wrote:

If you're using iptables > 1.4.2 then it's a known problem. You can read more in a netdev thread:
Subject: iproute2 action/policer question
starting date: Tue, 09 Jun 2009 22:10:46 +0200

I am giving up on fixing it for that release for general distros. I will wait until iptables 1.4.4 becomes mainstream then i will make another fix. It is very hard to keep up concurently with a) apis changing randomly on the part of iptables b) distros picking random versions of iptables and c) iproute2 being released in random uncoordinated manner.
Maybe a solution that would work is to fork iproute2 or make ipt part of iptables. In the meantime i can work with anyone who wants to get it to work with fixed version of iproute2 + iptables. Sergey, if this is of interest to you let me know.

cheers,
jamal

A message that is not in the archive (sent off-list or not yet received): 20090807202725.784dab6b@azure

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Sergey,

Hope you dont mind if i cc some other people so we can resolve this issue because i am looking at the git logs and seeing tons of activities which affect what you are trying to do.

Quoted 33 lines · jamal

Hi,

Quoted 7 lines · Sergey Popov

В Fri, 07 Aug 2009 10:28:05 -0400

Now i want to police the incoming traffic and drop all the packets that exceeds the 1000 kbit and redirect packets
to ifb, but next line doesn't work as expected [by me]:

What distro are you running?

Quoted 8 lines
# tc f add dev $INETIF parent ffff: proto ip prio 1 u32 match u32 0 0 \
action police rate 1000kbit burst 1k drop \
action mirred egress redirect dev $IFBIF

Illegal "action"
bad action parsing
parse_action: bad value (12:police)!
Illegal "action"

Let me try simple version:

dogo:~# tc q add dev lo ingress
dogo:~# tc f add dev lo parent ffff: proto ip prio 1 u32 match u32 0 0
action police rate 1000kbit burst 1k drop action mirred egress redirect
dev eth0
Illegal "action"
bad action parsing
parse_action: bad value (12:police)!
Illegal "action"
dogo:~# 
Quoted 4 lines

Ok, this seems to be a bug with policer...
Although your syntax above seems wrong since you didnt specify flowid. You must specify flowid always or strange things will happen even if the syntax is accepted.

Your usage and syntax is perfectly legal and very useful. The problem is in the old policer syntax the keyword "action" had some speacial meaning. Some old scripts used it and broke if new syntax was used.
The only clean option i see forward (which doesnt break any legacy stuff or play acrobatics) is to introduce new action "npolice". Patrick, thoughts?

cheers,
jamal