Title: Interface option InterfaceChoice.Default not working for IPv6 · Issue #1562 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: Interface option InterfaceChoice.Default not working for IPv6 · Issue #1562 · python-zeroconf/python-zeroconf
X Title: Interface option InterfaceChoice.Default not working for IPv6 · Issue #1562 · python-zeroconf/python-zeroconf
Description: When trying to use InterfaceChoice.Default with IPv6 on Linux Python Zeroconf isn't able to start browsing/sending frames: E.g. running this snipped: import asyncio import logging from zeroconf import ( DNSQuestionType, InterfaceChoice, ...
Open Graph Description: When trying to use InterfaceChoice.Default with IPv6 on Linux Python Zeroconf isn't able to start browsing/sending frames: E.g. running this snipped: import asyncio import logging from zeroconf imp...
X Description: When trying to use InterfaceChoice.Default with IPv6 on Linux Python Zeroconf isn't able to start browsing/sending frames: E.g. running this snipped: import asyncio import logging from zeroconf...
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/issues/1562
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Interface option InterfaceChoice.Default not working for IPv6","articleBody":"When trying to use `InterfaceChoice.Default` with IPv6 on Linux Python Zeroconf isn't able to start browsing/sending frames:\n\nE.g. running this snipped:\n\n```python\nimport asyncio\nimport logging\nfrom zeroconf import (\n DNSQuestionType,\n InterfaceChoice,\n IPVersion,\n ServiceStateChange,\n Zeroconf,\n)\nfrom zeroconf.asyncio import AsyncServiceBrowser, AsyncZeroconf\n\nlogging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)\nlogging.getLogger(\"zeroconf\").setLevel(logging.DEBUG)\n\ndef service_browser_handler(zeroconf: Zeroconf, service_type: str, name: str, state_change: ServiceStateChange) -\u003e None:\n logging.info(\"mDNS service state change: %s - %s - %s\", name, service_type, state_change)\n\n\nasync def browse_service():\n _aiozc = AsyncZeroconf(interfaces=InterfaceChoice.Default, ip_version=IPVersion.V6Only)\n _aiobrowser = AsyncServiceBrowser(\n _aiozc.zeroconf,\n [\"_matter._tcp.local.\"],\n handlers=[service_browser_handler],\n question_type=DNSQuestionType.QM,\n )\n\tawait asyncio.sleep(5)\n\nasyncio.run(browse_service())\n```\n\nThe same is true when trying to use dual-stack with `IPVersion.All`. Also the question type doesn't matter `DNSQuestionType.QU` won't get delivered either.\n\nLeads to the following output:\n```\n2025-04-10 16:17:46,736 Creating new socket with port 5353, ip_version IPVersion.V6Only, apple_p2p False and bind_addr ('',)\n2025-04-10 16:17:46,736 Created socket \u003csocket.socket fd=8, family=10, type=2, proto=0, laddr=('::', 5353, 0, 0)\u003e\n2025-04-10 16:17:46,736 Adding (('', 0, 0), 0) (socket 8) to multicast group\n2025-04-10 16:17:46,736 Listen socket \u003csocket.socket fd=8, family=10, type=2, proto=0, laddr=('::', 5353, 0, 0)\u003e, respond sockets [\u003csocket.socket fd=8, family=10, type=2, proto=0, laddr=('::', 5353, 0, 0)\u003e]\n2025-04-10 16:17:46,781 offsets = questions=0, answers=0, authorities=0, additionals=0\n2025-04-10 16:17:46,782 lengths = questions=1, answers=0, authorities=0, additionals=0\n2025-04-10 16:17:46,782 now offsets = questions=1, answers=0, authorities=0, additionals=0\n2025-04-10 16:17:46,782 Sending to (ff02::fb, 5353) via [socket 8 (('::', 5353, 0, 0))] (36 bytes #1) \u003cDNSOutgoing:multicast=True, flags=0, questions=[ptr[question,QM,in,_matter._tcp.local.]], answers=[], authorities=[], additionals=[]\u003e as b'\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x07_matter\\x04_tcp\\x05local\\x00\\x00\\x0c\\x00\\x01'...\n2025-04-10 16:17:46,782 Error with socket 8 (('::', 5353, 0, 0))): [Errno 99] Cannot assign requested address\nTraceback (most recent call last):\n File \"/usr/lib/python3.13/asyncio/selector_events.py\", line 1268, in sendto\n self._sock.sendto(data, addr)\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^\nOSError: [Errno 99] Cannot assign requested address\n```\n\n","author":{"url":"https://github.com/agners","@type":"Person","name":"agners"},"datePublished":"2025-04-10T14:22:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1562/python-zeroconf/issues/1562"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d31e1650-c351-06bc-1320-a23408cdfd6b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C52:1AB011:808AFAE:B0364D7:69739D86 |
| html-safe-nonce | 96e0e00818975825ba30fb1f6e9b1c0ebd30880d81cfc9771c401b460929fe4b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzUyOjFBQjAxMTo4MDhBRkFFOkIwMzY0RDc6Njk3MzlEODYiLCJ2aXNpdG9yX2lkIjoiNjk4MTIyNzM3ODg4MjM4OTgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 28a7548a35c7a3d7c3c5dcf10d0710b9efd1bdfd37da9726b006ddfe76b1d0ca |
| hovercard-subject-tag | issue:2985873302 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-zeroconf/python-zeroconf/1562/issue_layout |
| twitter:image | https://opengraph.githubassets.com/224f75bcf3f15d62c076bd088689f7a3655a7e8f3e6c614f92d5226a8769bad1/python-zeroconf/python-zeroconf/issues/1562 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/224f75bcf3f15d62c076bd088689f7a3655a7e8f3e6c614f92d5226a8769bad1/python-zeroconf/python-zeroconf/issues/1562 |
| og:image:alt | When trying to use InterfaceChoice.Default with IPv6 on Linux Python Zeroconf isn't able to start browsing/sending frames: E.g. running this snipped: import asyncio import logging from zeroconf imp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | agners |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2050cdbbbbb4ed55fd8fdf9b956111480f540c8aea2ae70cb27cdafc585f54a8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-zeroconf/python-zeroconf git https://github.com/python-zeroconf/python-zeroconf.git |
| octolytics-dimension-user_id | 120192235 |
| octolytics-dimension-user_login | python-zeroconf |
| octolytics-dimension-repository_id | 21548731 |
| octolytics-dimension-repository_nwo | python-zeroconf/python-zeroconf |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21548731 |
| octolytics-dimension-repository_network_root_nwo | python-zeroconf/python-zeroconf |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db1779077eea7e25848d6e8f2461754c9e48f3ec |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width