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

fix(vnstat): panic when not enough data available #14

Merged
merged 1 commit into from Feb 2, 2022

Conversation

cubercsl
Copy link
Contributor

@cubercsl cubercsl commented Jan 31, 2022

When using vnstat first time or without persistent data (such as openwrt with data stored in flash), the output of the command vnstat --oneline at startup will be:

# vnstat --oneline
 enp2s0: Not enough data available yet.

and the indexing operation in the code will cause panic.

And the man page of vnstat says "The output contains 15 fields with ; used as field delimiter".

  --oneline [mode]
	  Show traffic summary for selected interface using one line with a parsable format. The output contains 15 fields with ; used as field delimiter.

@cokemine cokemine merged commit 5d93eb4 into cokemine:master Feb 2, 2022
@cubercsl cubercsl deleted the fix-vnstat branch February 4, 2022 10:57
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.

None yet

2 participants