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

sfcapd inserts wrong srcAS number when there is no Extended gateway data #262

Closed
crami opened this issue Nov 25, 2020 · 7 comments
Closed

Comments

@crami
Copy link

crami commented Nov 25, 2020

I suspect that sfcapd inserts the previous srcAS into the dump file if there is no Extended gateway data in the corresponding flow sample. If I make a nfdump with a filter allowing only one interface and one IP-Address I get several source AS numbers back, which is not feasible.
I then captured raw sflow data with tcpdump and had a look at them in wireshark and it looks like that those samples which have no Extended gateway data show up with the wrong (from a previous sample) srcAS.

@crami
Copy link
Author

crami commented Nov 26, 2020

Looks like the variable that stores the SFlow Data (sample) is initialized once end then the values in the struct are just overwritten for each sample. The variable gets created in sflow_nfdump.c line 203. In my Opinion the Data should be cleared somewhere in sflow_process.c, probably in the function readFlowSample(). But not sure if this is the right or only place.

@crami
Copy link
Author

crami commented Nov 26, 2020

Forget what I wrote above. Just found that in sflow_nfdump.ch line 206 in Process_sflow the variable is nulled...
So why are there wrong source as numbers in the dump?

@phaag
Copy link
Owner

phaag commented Nov 26, 2020

Would it be possible for you to tcpdump a few minutes of sflow traffic to the collector and send it to me offlist? If I can reproduce this somehow, it would help.

@crami
Copy link
Author

crami commented Nov 26, 2020

@phaag just sent you a pcap file.

@phaag
Copy link
Owner

phaag commented Dec 19, 2020

My analysis did not reveal a bug in sfcapd. Extended/nonExtended data is decoded correctly. If you have more details on possible wrong data handling, please reopen the ticket.

@phaag phaag closed this as completed Dec 19, 2020
@phaag phaag reopened this Feb 20, 2021
@phaag
Copy link
Owner

phaag commented Feb 20, 2021

Reopened for fix. See #273

@phaag
Copy link
Owner

phaag commented Feb 20, 2021

Fix in master branch applied. Fixed bug in sflow code extended field parsing.

@phaag phaag closed this as completed Feb 20, 2021
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

2 participants