Skip to content

resolve: skip IP_UNICAST_IF for local sockets - #31557

Merged
poettering merged 1 commit into
systemd:mainfrom
rpigott:skip-unicast-if
Mar 1, 2024
Merged

poettering merged 1 commit into
systemd:mainfrom
rpigott:skip-unicast-if

Conversation

@rpigott

@rpigott rpigott commented Mar 1, 2024 •

Copy link
Copy Markdown
Contributor

This tests a theory for #31528. I want CI to run the test.


SO_BINDTODEVICE was used during connect() to fix an issue where IP_UNICAST_IF was improperly ignored for route lookups made by connect in linux. This has since been resolved upstream, but as a result we must apply the local socket excpetion to IP_UNICAST_IF as well.

The SO_BINDTODEVICE is no longer necessary, but left in place for 5.x kernels.

Fixes: #31528 #10487 (duplicate)

@bluca

bluca commented Mar 1, 2024

Copy link
Copy Markdown
Member

triggered the noble-amd64 job where it fails - it's not yet enabled by default

@mbiebl

mbiebl commented Mar 1, 2024

Copy link
Copy Markdown
Contributor

@rpigott at least for my local build, networkd-test.py passes now on Debian sid \o/.
Let's see what ubuntu-ci has to say.

@bluca

bluca commented Mar 1, 2024

Copy link
Copy Markdown
Member

ubuntu noble blesses this as well, so sounds like you are heading in the right direction

@bluca

bluca commented Mar 1, 2024

Copy link
Copy Markdown
Member

One question: you mentioned the issue worked around with the bind was fixed in a kernel, which version was that?

@bluca

bluca commented Mar 1, 2024

Copy link
Copy Markdown
Member

jammy is fixed too, nice

@rpigott

rpigott commented Mar 1, 2024 •

Copy link
Copy Markdown
Contributor Author

One question: you mentioned the issue worked around with the bind was fixed in a kernel, which version was that?

Fixed upstream in torvalds/linux@0e4d354762ce + torvalds/linux@526682b458b1, the latter first appeared in v6.2.

The ipv6 fix was backported to v6.1.2 in torvalds/linux@22dbe4a6ea37

...and both to v6.0.16 in torvalds/linux@45304d0db4b5 + torvalds/linux@b9c6c96523f9 respectively.

There doesn't appear to be any v5.x release with the ipv6 fix.

@rpigott

rpigott commented Mar 1, 2024

Copy link
Copy Markdown
Contributor Author

Possibly related: #30577

@rpigott rpigott changed the title [DO NOT MERGE] wip: test: resolve: skip IP_UNICAST_IF resolve: skip IP_UNICAST_IF for local sockets Mar 1, 2024
@rpigott
rpigott marked this pull request as ready for review March 1, 2024 19:05
@github-actions github-actions Bot added the please-review PR is ready for (re-)review by a maintainer label Mar 1, 2024
@rpigott

rpigott commented Mar 1, 2024

Copy link
Copy Markdown
Contributor Author

Just curious what kernel versions is systemd expected to support?

SO_BINDTODEVICE was used during connect() to fix an issue where
IP_UNICAST_IF was improperly ignored for route lookups made by connect
in linux. This has since been resolved upstream [1][2], but as a result
we must apply the local socket excpetion to IP_UNICAST_IF as well.

The SO_BINDTODEVICE is no longer necessary, but left in place for 5.x
kernels.

[1] https://lore.kernel.org/all/20220829111554.GA1771@debian/
[2] https://lore.kernel.org/all/20221208145437.GA75680@debian/
@mbiebl

mbiebl commented Mar 1, 2024

Copy link
Copy Markdown
Contributor

Just curious what kernel versions is systemd expected to support?

See https://github.com/systemd/systemd/blob/main/README

If certain networkd functionality requires a newer kernel, we can just list it there.

@mbiebl

mbiebl commented Mar 1, 2024

Copy link
Copy Markdown
Contributor

@poettering what's your take on this?

@mbiebl

mbiebl commented Mar 1, 2024

Copy link
Copy Markdown
Contributor

btw, @rpigott , I very much appreciate that you spent the time and effort to diagnose this issue.
Thanks a lot!

@poettering

Copy link
Copy Markdown
Member

looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

autopkgtest failure of networkd-test.py: ERROR: test_resolved_domain_restricted_dns (__main__.DnsmasqClientTest.test_resolved_domain_restricted_dns)

4 participants