Skip to content

Fix service name generation to enforce RFC 6763 length limit - #485

Merged
lo-simon merged 4 commits into
sony:masterfrom
garethsb:fix-service-name
Apr 7, 2026
Merged

Fix service name generation to enforce RFC 6763 length limit#485
lo-simon merged 4 commits into
sony:masterfrom
garethsb:fix-service-name

Conversation

@garethsb

Copy link
Copy Markdown
Contributor

Truncate mDNS service instance names exceeding 63 bytes with a hash suffix to ensure RFC 6763 compliance, since Avahi does not automatically truncate like mDNSResponder. Also use underscore rather than colon as the host/port separator, and declare service_name in the header. Add unit tests for service_name.

Made-with: Cursor

@garethsb

Copy link
Copy Markdown
Contributor Author

@lo-simon, @jonathan-r-thorpe, looks like the AMWA test suite is taking 40+ minutes to run, is that expected?

Truncate mDNS service instance names exceeding 63 bytes with a
hash suffix to ensure RFC 6763 compliance, since Avahi does not
automatically truncate like mDNSResponder. Also use underscore
rather than colon as the host/port separator, and declare
service_name in the header. Add unit tests for service_name.

Made-with: Cursor
Comment thread Development/nmos/mdns.cpp Outdated
@lo-simon
lo-simon self-requested a review April 6, 2026 22:46

@lo-simon lo-simon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some minor suggestions.

Comment thread Development/nmos/mdns.cpp Outdated
Comment thread Development/nmos/test/mdns_test.cpp
Co-authored-by: Simon Lo <simon.lo@sony.com>
@garethsb

garethsb commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

@lo-simon any idea why two of the Windows 2022 runners failed fast?

@lo-simon

lo-simon commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

@lo-simon any idea why two of the Windows 2022 runners failed fast?

I have seen that before; most of the time, when I re-run the runner, the problem disappears.

According to Google, in a CI/CD environment, the runner might have multiple network interfaces active.

When Get-NetIPConfiguration runs:

  1. It expects to find one primary configuration to output.
  2. If it finds multiple configurations, it returns an array (System.Object[]).
  3. Internally, the command attempts to map these results to a property (likely NetAdapter) that is strictly defined to hold only one instance at a time.

To fix that, as we just need any valid IP config to proceed, pipe it to Select-Object -First 1 as shown below:

Get-NetIPConfiguration | Select-Object -First 1

@lo-simon
lo-simon merged commit 8e2e17f into sony:master Apr 7, 2026
18 of 20 checks passed
@garethsb
garethsb deleted the fix-service-name branch April 7, 2026 20:39
@garethsb

garethsb commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

To fix that, as we just need any valid IP config to proceed, pipe it to Select-Object -First 1 as shown below:

Get-NetIPConfiguration | Select-Object -First 1

Hey, @lo-simon, we probably want to put the Select-Object -First 1 after the Where-Object?

@lo-simon

lo-simon commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

To fix that, as we just need any valid IP config to proceed, pipe it to Select-Object -First 1 as shown below:
Get-NetIPConfiguration | Select-Object -First 1

Hey, @lo-simon, we probably want to put the Select-Object -First 1 after the Where-Object?

Nice, @garethsb, let's open another PR for this fix.

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.

2 participants