Repository navigation
Conversation
IE_MSInternationalNumber took the length of its digits from `length - 1`, so building it with the default `length=None` raised TypeError (`None - 1`). The digits field now uses every digit when no length is given, as IE_IMEI does; IE_TLV.post_build then counts the flags octet and the digits. AI-Assisted: yes (Claude Opus 5.5)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5295 +/- ##
==========================================
+ Coverage 80.06% 80.66% +0.60%
==========================================
Files 375 375
Lines 98775 98775
==========================================
+ Hits 79083 79676 +593
+ Misses 19692 19099 -593
🚀 New features to boost your workflow:
|
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.
Description
IE_MSInternationalNumberreads its digits withlength_from=lambda x: x.length - 1(gtp.py#L686). With the defaultlength=None, building the IE raisesTypeErrorbeforeIE_TLV.post_buildcan compute the Length, soIE_MSInternationalNumber(),IE_MSInternationalNumber(digits=...)and any message that carries one cannot be built unless the caller counts the octets by hand. The existing "basic instantiation" test creates the IE but never builds it.This PR returns
Nonefromlength_fromwhen no length is set, which makesStrFixedLenFieldencode every digit, asIE_IMEIalready does.IE_TLV.post_buildthen writes the Length (the flags octet plus the digit octets, 3GPP TS 29.060 section 7.7.33). Dissection and an explicitlengthare unchanged.Before:
After:
tshark 4.6.9 decodes both MSISDNs in a Create PDP Context Request built this way (
E.164 number (MSISDN): 491701234567and4917012345678). A test is added totest/contrib/gtp.uts.This message was written with the help of AI (Claude Opus 5.5).