fix(mdns): handle service type comparison case-insensitively#93
Open
ckast-enqs wants to merge 1 commit into
Open
fix(mdns): handle service type comparison case-insensitively#93ckast-enqs wants to merge 1 commit into
ckast-enqs wants to merge 1 commit into
Conversation
kirollosnct
reviewed
Jul 19, 2026
kirollosnct
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you! I recommend also adding tests in mdns/mdns_service_detection_test.go to cover case-insensitivity cases.
| @@ -931,7 +931,7 @@ func (m *MdnsManager) UnregisterPairingCallback() { | |||
| // detectServiceType determines the service type based on the serviceType parameter | |||
| func (m *MdnsManager) detectServiceType(serviceType string) ServiceType { | |||
| // Check the serviceType parameter with exact matching | |||
Member
There was a problem hiding this comment.
Suggested change
| // Check the serviceType parameter with exact matching | |
| // Compare case insensitively per RFC 6763 |
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.
Problem
detectServiceTypecompares mDNS service types case-sensitively. Some SHIPimplementations (e.g. Theben Mehrwertmodul) publish on
_shipPairing._tcp(camelCase) insteadof
_shippairing._tcp(lowercase).While the SHIP spec expects lowercase service types, RFC 6763 (DNS-Based
Service Discovery) states that
DNS name comparisons — including service type strings — are case-insensitive.
Because of this, devices using camelCase service types are currently not
detected correctly.
Solution
Make the service type check in
detectServiceTypecase-insensitive, in linewith RFC 6763, so devices publishing non-lowercase (but otherwise valid)
service types are still correctly recognized.