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

avtp_pipeline/pcap build fixes #896

Open
lhoward opened this issue May 28, 2020 · 0 comments
Open

avtp_pipeline/pcap build fixes #896

lhoward opened this issue May 28, 2020 · 0 comments

Comments

@lhoward
Copy link
Contributor

lhoward commented May 28, 2020

If this code is being actively maintained I'm happy to submit pull requests. :) A couple of things I noticed whilst kicking tyres, waiting for i210 card to arrive.

In pcap_rawsock.c, this cleans up a bunch of verbose logging about receiving non-AVTP packets:

diff --git a/lib/avtp_pipeline/platform/Linux/rawsock/pcap_rawsock.c b/lib/avtp_pipeline/platform/Linux/rawsock/pcap_rawsock.c
index de0d7967..803dd509 100644
--- a/lib/avtp_pipeline/platform/Linux/rawsock/pcap_rawsock.c
+++ b/lib/avtp_pipeline/platform/Linux/rawsock/pcap_rawsock.c
@@ -229,9 +229,10 @@ bool pcapRawsockRxMulticast(void *pvRawsock, bool add_membership, const U8 addr[
        pcap_rawsock_t *rawsock = (pcap_rawsock_t*)pvRawsock;
 
        struct bpf_program comp_filter_exp;
-       char filter_exp[30];
+       char filter_exp[64];
 
-       sprintf(filter_exp, "ether dst %02x:%02x:%02x:%02x:%02x:%02x", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+       snprintf(filter_exp, sizeof(filter_exp), "ether proto %u and ether dst %02x:%02x:%02x:%02x:%02x:%02x",
+                rawsock->base.ethertype, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
 
        AVB_LOGF_DEBUG("%s %d %s", __func__, (int)add_membership, filter_exp);

Also, in openavb_qmgr.c, there are some assumptions that if AVB_FEATURE_IGB is undefined, AVB_FEATURE_ATL must be. They should be separate checks/#elif.

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

1 participant