diff --git a/net/openthread-br/Makefile b/net/openthread-br/Makefile index 012cbec023..a78f9b133d 100644 --- a/net/openthread-br/Makefile +++ b/net/openthread-br/Makefile @@ -33,9 +33,7 @@ define Package/openthread-br +libreadline \ +libstdcpp \ +libubox \ - +libubus \ - +mdnsd \ - +mdnsresponder + +libubus endef define Package/openthread-br/description @@ -55,7 +53,7 @@ CMAKE_OPTIONS += \ -DOT_TARGET_OPENWRT=ON \ -DOTBR_BACKBONE_ROUTER=ON \ -DOTBR_BORDER_ROUTING=ON \ - -DOTBR_MDNS=mDNSResponder \ + -DOTBR_MDNS=openthread \ -DOTBR_NAT64=OFF \ -DOTBR_OPENWRT=ON \ -DOTBR_PRODUCT_NAME=BorderRouter \ diff --git a/net/openthread-br/README.md b/net/openthread-br/README.md index c06bfd0b56..ecff952e59 100644 --- a/net/openthread-br/README.md +++ b/net/openthread-br/README.md @@ -59,13 +59,28 @@ Therefore, firewall support is disabled completely. This can be revised once the following feature request is implemented: https://github.com/openthread/ot-br-posix/issues/1675 -### mDNSResponder +### mDNS -The package depends on mDNSResponder. The alternative, Avahi, depends on D-Bus, -which is not something I feel comfortable with running on any router. While -there are Avahi packages without D-Bus support, using OpenThread Border Router -with Avahi requires libavahi-client, and this requires Avahi to be built with -D-Bus support. +The package uses OpenThread's internal mDNS implementation +(`-DOTBR_MDNS=openthread`), which is upstream's default. This drops the +mDNSResponder dependency entirely: no separate daemon, and no Avahi, whose +libavahi-client requirement would have pulled in D-Bus. + +The internal implementation advertises on a single infrastructure interface, +the one selected by the `backbone_network` option. Anything that needs to be +announced on more than one interface still needs a general-purpose responder. + +It coexists with umdns, which remains the provider for other packages' +services. Both bind the wildcard address on port 5353 with SO_REUSEADDR, which +is what admits the second bind and gets multicast delivered to both, and they +never contend for a name: OpenThread's mDNS names its host after the Thread +extended address, while umdns keeps `.local`. + +Only multicast reaches both. A unicast datagram to port 5353 is delivered to +one socket, so a unicast reply meant for one daemon can be received by the +other. umdns does set SO_REUSEPORT, but only on a retry after its own bind +fails, and that does not happen here because SO_REUSEADDR already admits the +bind, so no SO_REUSEPORT group forms in either start order. ### REST Server diff --git a/net/openthread-br/files/openthread-proto.sh b/net/openthread-br/files/openthread-proto.sh index 7244820f56..fde143c51b 100644 --- a/net/openthread-br/files/openthread-proto.sh +++ b/net/openthread-br/files/openthread-proto.sh @@ -21,18 +21,6 @@ proto_openthread_add_prefix() { [ -n "$prefix" ] && $OTCTL prefix add $prefix } -proto_openthread_check_service() { - service="$1" - ret=1 - json_init - json_add_string name "$service" - ubus call service list "$(json_dump)" | jsonfilter -e '@[*].instances[*]["running"]' > /dev/null - ret=$? - json_cleanup - - return "$ret" -} - proto_openthread_init_config() { proto_config_add_array 'prefix:list(string)' proto_config_add_boolean verbose @@ -72,9 +60,6 @@ proto_openthread_setup() { [ -n "$device" ] || proto_openthread_setup_error "$interface" MISSING_DEVICE [ -n "$radio_url" ] || proto_openthread_setup_error "$interface" MISSING_RADIO_URL - # run in subshell to prevent wiping json data needed for prefixes - ( proto_openthread_check_service mdnsd ) || proto_openthread_setup_error "$interface" MISSING_SVC_MDNSD - opts="--auto-attach=0" [ "$verbose" -eq 0 ] || append opts -v append opts "-I$device"