我有一个网络接口$dev,它已经有一个BPF过滤器附加到一个特殊的qdisc ingress (带有pref 1和直接操作)。我又加了一个(用pref 2)。tc filter show dev $dev ingress报告如下:
filter protocol all pref 1 bpf chain 0
filter protocol all pref 1 bpf chain 0 handle 0x1 some.o:[some-section] direct-action \
not_in_hw id ... tag ... jited
filter protocol all pref 2 bpf chain 1
filter protocol all pref 2 bpf chain 1 handle 0x1 other.o:[other-section] \
not_in_hw id ... tag ... jited在这种情况下,链式过滤器之间的关系是什么:第二个过滤器(即我的过滤器)总是看到与第一个过滤器相同的流量,还是取决于第一个过滤器返回了什么,(尤指我的)。既然它使用的是直接行动?我怀疑第二个是真的,但还不确定。
发布于 2021-05-25 21:23:20
链中的第二个BPF程序看到什么取决于第一个BPF程序返回什么。您可以在cls_bpf_classify()中读取该逻辑。
https://stackoverflow.com/questions/67695329
复制相似问题