eaglec83 发表于 2015-05-15 20:10

linux tc pedit如何使用?

有没有人用过tc pedit?
我现在想改报文的tos字段,怎么改? 总不能用pedit munge offset 0 u16 set 0x4510之类的吧? offset规定只能是4byte的倍数, 但是pedit的offmask, at实在看不懂,也找不到例子

还有一个是使用pedit munge ip <ipdata> 但是这个ipdata到底怎么用?

eaglec83 发表于 2015-05-17 19:01

pedit munge offset 1 set 0x10该命令时可以使用的,但是改了之后会导致无法ping通同网段的其他主机
抓了报文查看,格式和长度都没错,但是对端就是不回。
用dsmark设置的tos,就没这个问题

看代码的话,用pedit munge ip tos set 0x10应该是可以使用的,但是执行命令的时候却报错,不知道啥问题

eaglec83 发表于 2015-05-18 20:57

看了代码,大概明白了

pedit munge offset 1 set 0x10不能用是因为没有去改ip heeader的checksum,需要再加一个csum ip的命令

nswcfd 发表于 2015-05-19 10:28

学习了!
这是一个tc action吗?

eaglec83 发表于 2015-05-19 21:06

是的,可以看一下iproute2的代码
页: [1]
查看完整版本: linux tc pedit如何使用?