-
Notifications
You must be signed in to change notification settings - Fork 175
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
Support L2 filters such as ARP #255
Conversation
@brb Please read the 1st commit's message, I'm not sure it's what we want. The 1st commit actually changes the meaning of I did it because I found it sometimes misleading, for example,
For those who aren't fimiliar with skb, they may think the skb payload changes. It's even misleading for us when we're looking into an skb with encap and encryption, the len value reflects "wrong" indication. My commit changes its value to L3 len, reduces confusion, but also causes another confusion: for those who know how skb->len works in kernel, the unchanges len values look fishy. I'm not sure it's a good commit or not. Feel free to reject it if you don't think it's right. |
66db1b5
to
45ce5a0
Compare
Never mind, after a second thought I think it's a bad idea. Just dropped that change. |
* ,--------------------------- + head * / ,----------------- + data * / / ,----------- + tail * | | | , + end * | | | | * v v v v * ----------------------------------------------- * | headroom | data | tailroom | skb_shared_info | * ----------------------------------------------- According to above illustration of skb, data_end should be skb->head + skb->tail. Signed-off-by: Zhichuan Liang <[email protected]>
Signed-off-by: Zhichuan Liang <[email protected]>
Signed-off-by: Zhichuan Liang <[email protected]>
fb947bf
to
b08a66a
Compare
Signed-off-by: Zhichuan Liang <[email protected]>
b08a66a
to
7ae91dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
pcap_compile mode only works for a complete frame data. | ||
*/ | ||
pcap := C.pcap_open_dead(C.DLT_RAW, MAXIMUM_SNAPLEN) | ||
pcap := C.pcap_open_dead(C.DLT_EN10MB, MAXIMUM_SNAPLEN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: does the Go compiler optimize this statement? I.e., pcap := C.pcap_open_dead(C.DLT_EN10MB, MAXIMUM_SNAPLEN)
is called only if l3=false
?
@jschwinger233 Hello, Can pwru display macAddr when package type is arp? |
Fixes: #233
Signed-off-by: Zhichuan Liang [email protected]