[gtpv2] Fix the overflow value for the sequence number (#265) #266
+1
−1
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.
Make the sequence number counter wrap around to zero on reaching
0x800000
instead of0x1000000
. The explanation why this value should be used can be found in 3GPP TS 29.274, section 7.6 ("Reliable Delivery of Signalling Messages"), where it is mentioned that sequence numbers with their most significant bit set to 1 should be used only for Command messages and for requests which were triggered by Command messages, as well as for Triggered Reply messages, and not for requests which were not triggered by a Command message (i.e. Initial Request messages). It is therefore assumed that if the sequence number counter is initialized with zero, it is supposed to be used when sending Initial Request messages only. That's why its value becoming0x800000
(and being incremented further) would in practice change the type of the message and the way it's supposed to be handled, which is incorrect behavior.