Fix determining supported kernel version for HTTP 1.1 in kernels with patch version 0 #2202
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.
I use ROS on a system with mainline kernels, and every time a new minor version is installed, ROS stops working.
That's because the uname of the kernel with patch version 0 looks like this:
5.15-051500-generic
. It does not correspond to the standardx.y.z-whatever
pattern, which breaks rosgraph. The error I'm getting from rosgraph is:This patch removes all characters starting from the first non-numeric character in the minor version part. This should make the
int()
call pass.I also added another workaround that returns True as early as kernel 5.x or newer is detected, not looking at the minor version at all. This should further limit the surface for more bugs like this.
I'm not sure how other kernel strings in other distros than Ubuntu can look like, but taking into account I'm the first one reporting such issue, I believe the kernel strings look more or less the same, thus this fix should be the "final" ™ one in this regard.