René's URL Explorer Experiment


Title: fix: re-bind an interface that was re-created with the same address by jpc · Pull Request #1948 · python-zeroconf/python-zeroconf · GitHub

Open Graph Title: fix: re-bind an interface that was re-created with the same address by jpc · Pull Request #1948 · python-zeroconf/python-zeroconf

X Title: fix: re-bind an interface that was re-created with the same address by jpc · Pull Request #1948 · python-zeroconf/python-zeroconf

Description: Fixes #1947. What async_update_interfaces() now re-binds an interface that was removed and re-created with the same address. Such an interface (driver reset, PCI rescan, USB replug, ip link del + add) gets a new kernel interface index. The sender's multicast interface and the listen socket's group membership still point at the dead index, so mDNS on that interface stops. Until now the rescan was a no-op in this case, because the diff key (address, scope_id) hadn't changed. How get_interface_indexes() (in _utils/net.py) maps each local (address, scope_id) to its current interface index, using the same key shape as _interface_key. When a sender is wrapped, _WrappedTransport.ifindex records the index of the interface that holds its bound address (0 if unknown). During AsyncEngine.async_update_interfaces, any sender whose recorded index and live index are both known and differ is closed and dropped from current. The existing add path then re-creates it, re-joining the group on the new interface, and the usual re-announce follows. The dual-use listen socket of a Default instance is skipped, as in the rest of the reconcile. The key shape and the public API are unchanged. The only extra cost is one ifaddr.get_adapters() call per rescan and per sender creation. Testing New unit tests in tests/test_interface_update.py: the address-to-index mapping; a sender records its index; a changed index re-binds the sender and re-announces; same, unknown or missing indexes leave the sender alone; the dual-use listen socket is never torn down. Full suite, pure Python on 3.13: 520 passed. The one failure, test_integration_with_listener_ipv6, also fails on unmodified 0.154.0 in the same container, which has no IPv6. ruff, ruff format, flake8, codespell and mypy are clean. The reproduction from #1947 (veth + network namespace, the interface deleted and re-created), run against this branch: 1. initial (va ifindex 3): found 2. va re-created, same address (ifindex 5): NOT FOUND 3. after async_update_interfaces(): found 4. after update_interfaces([]) then (['10.9.0.1']): found Step 3 printed NOT FOUND on 0.154.0. Callers still need something that triggers the rescan after an interface change. That part is unchanged. 🤖 Generated with Claude Code

Open Graph Description: Fixes #1947. What async_update_interfaces() now re-binds an interface that was removed and re-created with the same address. Such an interface (driver reset, PCI rescan, USB replug, ip link del + a...

X Description: Fixes #1947. What async_update_interfaces() now re-binds an interface that was removed and re-created with the same address. Such an interface (driver reset, PCI rescan, USB replug, ip link del + a...

Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/pull/1948

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e651e4a4-6671-cda5-21ed-a7a83a539117
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE774:34D742:CE0ED:116CD8:6B008053
html-safe-nonce42c5ce1052f6b7bb6b2686e21e07d5258a7e7dbe8007e1873e521d1a0561b493
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzc0OjM0RDc0MjpDRTBFRDoxMTZDRDg6NkIwMDgwNTMiLCJ2aXNpdG9yX2lkIjoiNjA5MjUxMDkwNDczNjMxNzUyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac03cf822a1536b5d1bf1a16e9a06a491422a69dc3c5044b8237db3930e095b226
hovercard-subject-tagpull_request:5395364586
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-zeroconf/python-zeroconf/pull/1948/files
twitter:imagehttps://avatars.githubusercontent.com/u/107984?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/107984?s=400&v=4
og:image:altFixes #1947. What async_update_interfaces() now re-binds an interface that was removed and re-created with the same address. Such an interface (driver reset, PCI rescan, USB replug, ip link del + a...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python-zeroconf/python-zeroconf git https://github.com/python-zeroconf/python-zeroconf.git
octolytics-dimension-user_id120192235
octolytics-dimension-user_loginpython-zeroconf
octolytics-dimension-repository_id21548731
octolytics-dimension-repository_nwopython-zeroconf/python-zeroconf
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id21548731
octolytics-dimension-repository_network_root_nwopython-zeroconf/python-zeroconf
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released1bc2aa1939001689f5ce935982c10a6138f745c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-zeroconf%2Fpython-zeroconf%2Fpull%2F1948%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-zeroconf%2Fpython-zeroconf%2Fpull%2F1948%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python-zeroconf%2Fpython-zeroconf
Reloadhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files
Reloadhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files
Reloadhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files
python-zeroconfhttps://github.com/python-zeroconf
python-zeroconfhttps://github.com/python-zeroconf/python-zeroconf
Codehttps://github.com/python-zeroconf/python-zeroconf
Issues50 (50)https://github.com/python-zeroconf/python-zeroconf/issues
Pull requests16 (16)https://github.com/python-zeroconf/python-zeroconf/pulls
Discussionshttps://github.com/python-zeroconf/python-zeroconf/discussions
Actionshttps://github.com/python-zeroconf/python-zeroconf/actions
Projectshttps://github.com/python-zeroconf/python-zeroconf/projects
Wikihttps://github.com/python-zeroconf/python-zeroconf/wiki
Security and quality5 (5)https://github.com/python-zeroconf/python-zeroconf/security
Insightshttps://github.com/python-zeroconf/python-zeroconf/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython-zeroconf%2Fpython-zeroconf%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython-zeroconf%2Fpython-zeroconf%2Fissues%2Fnew%2Fchoose
jpchttps://github.com/jpc
python-zeroconf:masterhttps://github.com/python-zeroconf/python-zeroconf/tree/master
jpc:fix/rebind-recreated-interfacehttps://github.com/jpc/python-zeroconf/tree/fix/rebind-recreated-interface
Conversation 3 https://github.com/python-zeroconf/python-zeroconf/pull/1948
Commits 1 https://github.com/python-zeroconf/python-zeroconf/pull/1948/commits
Checks 41 https://github.com/python-zeroconf/python-zeroconf/pull/1948/checks
Files changed https://github.com/python-zeroconf/python-zeroconf/pull/1948/files
Please reload this pagehttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files
fix: re-bind an interface that was re-created with the same address https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#top
Show all changes 1 commit https://github.com/python-zeroconf/python-zeroconf/pull/1948/files
588869f fix: re-bind an interface that was re-created with the same address jpc Nov 19, 2026 https://github.com/python-zeroconf/python-zeroconf/pull/1948/commits/588869f5eca725020753a6c96fa88af3000e2482
Clear filters https://github.com/python-zeroconf/python-zeroconf/pull/1948/files
Please reload this pagehttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files
Please reload this pagehttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files
_core.py https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-334d60456692812966fc9644e6d71b6e2c60dfc6fb2d02d02d5fef6a480c360d
_engine.py https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
_transport.py https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-c394cbc8422ae77567361c7f435fc6de916373531558d0069bc3535fa7f7de1f
net.py https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-16e7dbbe84235183a0e3f58fa9fe2fce44a09848c2cb81a2c59775b27218135c
test_interface_update.py https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-6c178c122681da1325df3cb27aaf36fe56f56d55b73d4103eec8f42d4c25af3c
src/zeroconf/_core.pyhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-334d60456692812966fc9644e6d71b6e2c60dfc6fb2d02d02d5fef6a480c360d
View file https://github.com/python-zeroconf/python-zeroconf/blob/588869f5eca725020753a6c96fa88af3000e2482/src/zeroconf/_core.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-zeroconf/python-zeroconf/pull/1948/{{ revealButtonHref }}
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-334d60456692812966fc9644e6d71b6e2c60dfc6fb2d02d02d5fef6a480c360d
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-334d60456692812966fc9644e6d71b6e2c60dfc6fb2d02d02d5fef6a480c360d
src/zeroconf/_engine.pyhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
View file https://github.com/python-zeroconf/python-zeroconf/blob/588869f5eca725020753a6c96fa88af3000e2482/src/zeroconf/_engine.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-zeroconf/python-zeroconf/pull/1948/{{ revealButtonHref }}
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-8dc080e5555d9366069bd1bdbe1cee5bafd50ff8efc9e6ce469d6716bbf7663e
src/zeroconf/_transport.pyhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-c394cbc8422ae77567361c7f435fc6de916373531558d0069bc3535fa7f7de1f
View file https://github.com/python-zeroconf/python-zeroconf/blob/588869f5eca725020753a6c96fa88af3000e2482/src/zeroconf/_transport.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-zeroconf/python-zeroconf/pull/1948/{{ revealButtonHref }}
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-c394cbc8422ae77567361c7f435fc6de916373531558d0069bc3535fa7f7de1f
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-c394cbc8422ae77567361c7f435fc6de916373531558d0069bc3535fa7f7de1f
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-c394cbc8422ae77567361c7f435fc6de916373531558d0069bc3535fa7f7de1f
src/zeroconf/_utils/net.pyhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-16e7dbbe84235183a0e3f58fa9fe2fce44a09848c2cb81a2c59775b27218135c
View file https://github.com/python-zeroconf/python-zeroconf/blob/588869f5eca725020753a6c96fa88af3000e2482/src/zeroconf/_utils/net.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-zeroconf/python-zeroconf/pull/1948/{{ revealButtonHref }}
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-16e7dbbe84235183a0e3f58fa9fe2fce44a09848c2cb81a2c59775b27218135c
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-16e7dbbe84235183a0e3f58fa9fe2fce44a09848c2cb81a2c59775b27218135c
tests/test_interface_update.pyhttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-6c178c122681da1325df3cb27aaf36fe56f56d55b73d4103eec8f42d4c25af3c
View file https://github.com/python-zeroconf/python-zeroconf/blob/588869f5eca725020753a6c96fa88af3000e2482/tests/test_interface_update.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-zeroconf/python-zeroconf/pull/1948/{{ revealButtonHref }}
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-6c178c122681da1325df3cb27aaf36fe56f56d55b73d4103eec8f42d4c25af3c
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-6c178c122681da1325df3cb27aaf36fe56f56d55b73d4103eec8f42d4c25af3c
https://github.com/python-zeroconf/python-zeroconf/pull/1948/files#diff-6c178c122681da1325df3cb27aaf36fe56f56d55b73d4103eec8f42d4c25af3c
Please reload this pagehttps://github.com/python-zeroconf/python-zeroconf/pull/1948/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.