Ripmcs detox#232
Closed
dkfellows wants to merge 12 commits into
Closed
Conversation
Also puts in asserts that ought to always be true…
rowleya
requested changes
Dec 6, 2017
rowleya
left a comment
Member
There was a problem hiding this comment.
This is generally fine. There are a couple of issues marked in the code. The following issues also exist throughout:
- Spaces have been replaced with tabs; this looks bad even in github.
- Functions have the inline brace replaced by one on the next line. This is inconsistent with the style in the rest of the code
| } else { | ||
| header_size += 4; | ||
| } | ||
| if (test_bit(!pkt_type, EIEIO_PKT_32BIT)) { |
Member
There was a problem hiding this comment.
Not sure I see this. EIEIO_PKT_32BIT = 1.
If pkt_type = 1, test_bit(!1, 1) == test_bit(0, 1) == FALSE I think. So this will fail to detect pkt_type == 1.
| } | ||
|
|
||
| if (pkt_type <= 1) { | ||
| if (!test_bit(pkt_type, EIEIO_PKT_32BIT)) { |
Contributor
|
leaving to rowley review |
Contributor
|
still leaving, as it seems has outstnading issues from rowley |
Member
Author
|
#462 effectively supersedes this |
Contributor
|
keeping branch for any reason?? |
Member
Author
This file contains hidden or 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
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.
This detoxifies the C code for the “reverse iptag multicast source” so that it stops using random bit bashing and instead just uses simple patterns via vetted macros. This addresses a few bugs in the process where there were things wrong that we just happened to never hit in practice. I don't think it is a good idea for code to have such surprise “mines” in them, waiting to trip up random passing ships.
I guess quite a few of the macros (but not all) could be replaced by inlined functions. (The
UINTmacro can't work that way, but I suspect most of the others are convertible.)