Title: `parsed_scoped_addresses()` may return link-local IPv6 addresses with `%0` as the scope id. · Issue #1361 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: `parsed_scoped_addresses()` may return link-local IPv6 addresses with `%0` as the scope id. · Issue #1361 · python-zeroconf/python-zeroconf
X Title: `parsed_scoped_addresses()` may return link-local IPv6 addresses with `%0` as the scope id. · Issue #1361 · python-zeroconf/python-zeroconf
Description: OS: Ubuntu 22.04.3 LTS Python: 3.10.12 (though the issue occurs with 3.12 as well.) zeroconf: 0.131.0 Hi all, I've noticed that the parsed_scoped_addresses() will sometimes return IPv6 addresses with the scope ID uninitialized, e.g. fe80...
Open Graph Description: OS: Ubuntu 22.04.3 LTS Python: 3.10.12 (though the issue occurs with 3.12 as well.) zeroconf: 0.131.0 Hi all, I've noticed that the parsed_scoped_addresses() will sometimes return IPv6 addresses wi...
X Description: OS: Ubuntu 22.04.3 LTS Python: 3.10.12 (though the issue occurs with 3.12 as well.) zeroconf: 0.131.0 Hi all, I've noticed that the parsed_scoped_addresses() will sometimes return IPv6 addresse...
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/issues/1361
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`parsed_scoped_addresses()` may return link-local IPv6 addresses with `%0` as the scope id.","articleBody":"OS: Ubuntu 22.04.3 LTS\r\nPython: 3.10.12 (though the issue occurs with 3.12 as well.)\r\nzeroconf: 0.131.0\r\n\r\nHi all,\r\n\r\nI've noticed that the `parsed_scoped_addresses()` will _sometimes_ return IPv6 addresses with the scope ID uninitialized, e.g. `fe80::be0f:a7ff:fe00:8a54%0`.\r\n\r\nWhen using the address this naturally results in an invalid argument (errno 22) `OSError` (e.g. from `socket.connect`.)\r\n\r\nHere's some code I've been using to replicate the issue. (Naturally, replicating the issue requires that there be some services on the network matching those specified in the code.) Any idea what I'm doing wrong?\r\n\r\n```\r\nimport time\r\nfrom zeroconf import ServiceBrowser, ServiceListener, Zeroconf, InterfaceChoice, IPVersion\r\n\r\nclass MyListener(ServiceListener):\r\n\r\n def __init__(self):\r\n self.address_cache_ = {}\r\n\r\n def update_service(self, zc: Zeroconf, type_: str, name: str) -\u003e None:\r\n pass\r\n\r\n def remove_service(self, zc: Zeroconf, type_: str, name: str) -\u003e None:\r\n pass\r\n\r\n def add_service(self, zc: Zeroconf, type_: str, name: str) -\u003e None:\r\n info = zc.get_service_info(type_, name)\r\n if info:\r\n print(info.parsed_scoped_addresses())\r\n\r\nzeroconf = Zeroconf(InterfaceChoice.All, False, IPVersion.All)\r\nlistener = MyListener()\r\nbrowser = ServiceBrowser(zeroconf, [\"_roger._tcp.local.\", \"_ouster-lidar._tcp.local.\"], listener)\r\ntime.sleep(10)\r\nzeroconf.close()\r\n```\r\n\r\nHere is some output from the script showing the addresses with the uninitialized scope ids:\r\n\r\n```\r\n['\u003credacted\u003e.65', 'fe80::be0f:a7ff:fe00:8a98%0', '\u003credacted\u003e:8a98']\r\n['\u003credacted\u003e.65', 'fe80::be0f:a7ff:fe00:8a98%0', '\u003credacted\u003e:8a98']\r\n['\u003credacted\u003e.124', 'fe80::be0f:a7ff:fe00:8a54%0', '\u003credacted\u003e:8a54']\r\n['\u003credacted\u003e.124', 'fe80::be0f:a7ff:fe00:8a54%0', '\u003credacted\u003e:8a54']\r\n['\u003credacted\u003e.149']\r\n['\u003credacted\u003e.149']\r\n['\u003credacted\u003e.24', 'fe80::be0f:a7ff:fe00:8a20%0', '\u003credacted\u003e:8a20']\r\n['\u003credacted\u003e.24', 'fe80::be0f:a7ff:fe00:8a20%0', '\u003credacted\u003e:8a20']\r\n['\u003credacted\u003e.200', 'fe80::be0f:a7ff:fe00:9bd9%0', '\u003credacted\u003e:9bd9']\r\n['\u003credacted\u003e.200', 'fe80::be0f:a7ff:fe00:9bd9%0', '\u003credacted\u003e:9bd9']\r\n['\u003credacted\u003e.114', 'fe80::be0f:a7ff:fe00:83bc%0', '\u003credacted\u003e:83bc']\r\n['\u003credacted\u003e.114', 'fe80::be0f:a7ff:fe00:83bc%0', '\u003credacted\u003e:83bc']\r\n['\u003credacted\u003e.184', 'fe80::be0f:a7ff:fe00:8be5%0', '\u003credacted\u003e:8be5']\r\n['\u003credacted\u003e.184', 'fe80::be0f:a7ff:fe00:8be5%0', '\u003credacted\u003e:8be5']\r\n```","author":{"url":"https://github.com/twslankard","@type":"Person","name":"twslankard"},"datePublished":"2024-02-14T01:29:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1361/python-zeroconf/issues/1361"}
| 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:c37a33c9-b7d3-3c5e-355d-409ade4e80ac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C320:1AD3B8:FFDC87:156A043:69732821 |
| html-safe-nonce | be1a2fed5a7a8f7ddad11bcb92fc72f44913da1d5a4507d86b089fbd175ac8ae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzIwOjFBRDNCODpGRkRDODc6MTU2QTA0Mzo2OTczMjgyMSIsInZpc2l0b3JfaWQiOiIyNDIzMTkwOTI3NzgyOTE0MDgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7afbc4784d80e2e15835c0caea29d154014901292f0785ba98fa408bf277a5d9 |
| hovercard-subject-tag | issue:2133396432 |
| 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/1361/issue_layout |
| twitter:image | https://opengraph.githubassets.com/18c04bf0fd808f0b82186ea603e1ad348d51cd1826f09b266de7b8863239538c/python-zeroconf/python-zeroconf/issues/1361 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/18c04bf0fd808f0b82186ea603e1ad348d51cd1826f09b266de7b8863239538c/python-zeroconf/python-zeroconf/issues/1361 |
| og:image:alt | OS: Ubuntu 22.04.3 LTS Python: 3.10.12 (though the issue occurs with 3.12 as well.) zeroconf: 0.131.0 Hi all, I've noticed that the parsed_scoped_addresses() will sometimes return IPv6 addresses wi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | twslankard |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| 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 | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width