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

default timeout when sending only one frame #6

Closed
spale75 opened this issue Oct 23, 2019 · 3 comments
Closed

default timeout when sending only one frame #6

spale75 opened this issue Oct 23, 2019 · 3 comments

Comments

@spale75
Copy link

spale75 commented Oct 23, 2019

Expected Behavior

nemesis should quit after the last frame has been sent and not wait for -i or the default of 1 second.

Actual Behavior

nemesis waits for -i after the last frame has been sent.

Steps to Reproduce the Problem

send a frame ;)

Specifications

  • Version: 1.6
  • Platform: Ubuntu bionic

Solution

For me, it seem line 344 of nemesis-functions.c isn't working as it should.

344                 if (count != 0 && interval >= 0)
345                         usleep(interval);

If count would be 0, it should not sleep. So I think there's an issue with the counter (off by one?)

@troglobit
Copy link
Collaborator

Ah, good catch! Haven't looked at it in detail, but maybe count isn't decremented as it should?

@spale75
Copy link
Author

spale75 commented Oct 25, 2019

I think I've got it.

in the do { } while() loop of the nemesis_send_frame() function, count can never be 0. The while condition prevents that. That means the usleep() has to be skipped on the last packet which is count==1, not count==0.

changing 344 to: if (count != 1 && interval >= 0)

that should solve it.

@troglobit
Copy link
Collaborator

There, should work better now. Thanks for reporting this :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants