Skip to content

Conversation

@laoar
Copy link

@laoar laoar commented Jun 5, 2017

As we can see, it will capture all the packets match with 'port' as bellow,
if (port)
sprintf(filter, "tcp port %d", port);
pcap_compile(pcap, &bpf, filter, 1, 0)

but it doesn't distinguish the src port and dst port.
If this 'server' works as 'client' and connect other server with this port,
it will generate wrong RT value.

This patch is to fix this circumstance.

As we can see, it will capture all the packets match with 'port' as bellow,
    if (port)
        sprintf(filter, "tcp port %d", port);
     pcap_compile(pcap, &bpf, filter, 1, 0)

but it doesn't distinguish the src port and dst port.
If this 'server' works as 'client' and connect other server with this port,
it will generate wrong RT value.

This patch is to fix this circumstance.
@Lowercases
Copy link
Owner

Hey @laoar , thank you for your code!

The patch looks correct -- I'll test it as I get a chance and proceed :)

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

Successfully merging this pull request may close these issues.

2 participants