-
-
Notifications
You must be signed in to change notification settings - Fork 736
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
Various segfault fixes, compiler warnings on 32 bit systems and add milli-second timers for vrrp track scripts #2478
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commit 7cb09b2 - all: Ensure pid file exists when respawning child process Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
It was a long which was excessive. It cannot be negative, and doesn't need more than 32 bits. Signed-off-by: Quentin Armitage <[email protected]>
alloc_bfd() returns a bfd_t *, but in the case of errors it was returning false, which clearly should have been NULL. This issues was identified by compiling with -std=c23. Signed-off-by: Quentin Armitage <[email protected]>
32 bit Debian uses a 32 bit TIMESIZE, whereas 32 bit Ubuntu uses a 64 bit TIMESIZE. This means that on 32 bit Ubuntu some time types need to be printed using "%lld", whereas on 32 bit Debian, and on 64 bit systems "%ld" is what is needed. Using the wrong format specifier was causing compilation warnings on 32 bit Debian. The issue impacts printing time_t, struct timeval tv_sec and tv_usec and struct timespec tv_sec fields. Peversely, on a 32 bit system when TIMESIZE is 64, struct timeval tv_usec is 64 bits, whereas struct timesec tv_nsec is 32 bits. The commit adds configure time checking of the right format specifiers to use, and adds definitions PRI_time_t, PRI_tv_sec, PRI_ts_sec etc. Signed-off-by: Quentin Armitage <[email protected]>
On 32 bit systems, struct statfs field f_type is unsigned on 32 bit systems, but signed on 64 bit systems. This caused warnings on 32 bit systems about comparing signed and unsigned when comparing against defined values with the most significat bit was set. This commit copies the f_type field into a long long type which resolves the warnings. Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
It would be good to be able to use the standardized "[[fallthrough]];" which is added in C23, but we are a long way from being able to specify C23 was the base standard. Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
Signed-off-by: Quentin Armitage <[email protected]>
The alignment calculations were not coerect, so this commit updates addattr_l to match the iproute2 version, EXCEPT there appears to be 1 issue in the iproute2 code when NLMSG_ALIGN is used when RTA_ALIGN should be used. The difference is entirely cosmetic (at the moment) since the functionality of the 2 macros is currently identical. Signed-off-by: Quentin Armitage <[email protected]>
Previously the time was logged for memory allocation/freeing operations in seconds. When comparing when memory was allocated/freed to debugging logging via a log file, it was helpful, in terms of being able to identify the sequence of events, to have the time of memory allocations etc logged in micro-seconds. Signed-off-by: Quentin Armitage <[email protected]>
Child process thread_t structures use two red-black trees, one for the timeout, and the other for pids. It is important to ensure that threads are removed from the child_pid RB tree at the correct time. This was not happening when reloads were occurring and there was a THREAD_CHILD_TIMEOUT thread on the ready list. A few other instances of the thread not being removed from the child_pid RB tree correctly, which are also resolved by this commit. Signed-off-by: Quentin Armitage <[email protected]>
On a reload, only the configured name of a track_script was being checked to see if the new config track_script matched the old config track_script. If the script to be executed were changed, but the configured named of the script were kept the same, then the status of the old script would be transferred to the new script, despite the scripts being completely different. This commit now checks that the script really is the same, in terms of the path, parameters and user executing the script. Signed-off-by: Quentin Armitage <[email protected]>
Although running track_scripts too rapidly can have use cause heavy system load, there are use cases for being able to run scripts more frequently than 1 second, and also at intervals not in whole seconds. This commit adds the option to be able to specify the interval and timeout timers to a resolution in milli-seconds. Signed-off-by: Quentin Armitage <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.