Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter api can not match mac address #646

Open
JackSunshine opened this issue Oct 29, 2019 · 2 comments
Open

filter api can not match mac address #646

JackSunshine opened this issue Oct 29, 2019 · 2 comments

Comments

@JackSunshine
Copy link

pyroute2 filter API doesn't support matching mac address, for example, I can install a filter rule through the following command line:

tc filter add dev vnet1 parent 1:0 protocol ip prio 5 u32 match u16 0x0800 0xffff at -2 match u16 0xca67 0xffff at -4 match u32 0x5254005c 0xffffffff at -8 flowid 1:10

but I can't install this rule through the tc API, cause the offset is negative.

@svinota
Copy link
Owner

svinota commented Nov 5, 2019

Let's see what can we do here. Thanks for the report

@Vic063
Copy link
Contributor

Vic063 commented Dec 13, 2019

@JackSunshine: Could you please test the fix issued in PR #656 ?

Here is the code I used to test:
from pyroute2 import IPRoute, protocols

ipr = IPRoute()
idx = ipr.link_lookup(ifname='vnet1')[0]
ipr.tc('add-filter', 'u32', idx, parent=0x10000, prio=5, protocol=protocols.ETH_P_IP, target=0x10010, keys=["0x0800/0xffff-2", "0xca67/0xffff-4", "0x5254005c/0xffffffff-8"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants