Skip to content

fix(mdns): handle service type comparison case-insensitively#93

Open
ckast-enqs wants to merge 1 commit into
enbility:devfrom
ckast-enqs:fix/mdns-service-type-case-sensitivity
Open

fix(mdns): handle service type comparison case-insensitively#93
ckast-enqs wants to merge 1 commit into
enbility:devfrom
ckast-enqs:fix/mdns-service-type-case-sensitivity

Conversation

@ckast-enqs

Copy link
Copy Markdown

Problem

detectServiceType compares mDNS service types case-sensitively. Some SHIP
implementations (e.g. Theben Mehrwertmodul) publish on _shipPairing._tcp (camelCase) instead
of _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 detectServiceType case-insensitive, in line
with RFC 6763, so devices publishing non-lowercase (but otherwise valid)
service types are still correctly recognized.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.036% (+0.06%) from 92.972% — ckast-enqs:fix/mdns-service-type-case-sensitivity into enbility:dev

@sthelen-enqs
sthelen-enqs requested a review from kirollosnct July 14, 2026 14:19

@kirollosnct kirollosnct left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! I recommend also adding tests in mdns/mdns_service_detection_test.go to cover case-insensitivity cases.

Comment thread mdns/mdns.go
@@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Check the serviceType parameter with exact matching
// Compare case insensitively per RFC 6763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants