Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

networkd: Fix Link up #12505

Merged
merged 1 commit into from May 9, 2019
Merged

networkd: Fix Link up #12505

merged 1 commit into from May 9, 2019

Conversation

ssahani
Copy link
Contributor

@ssahani ssahani commented May 7, 2019

Fill up IFLA_INET6_ADDR_GEN_MODE while we do link_up.

dummy-test: Adding route: dst: fe80::cc89:aeff:fe07:bf/128, src: n/a, gw: n/a, prefsrc: n/a
dummy-test: Could not bring up interface: Invalid argument <====================
vxlan-test: Link state is up-to-date

After reading the kernel code when we do a link up

net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE

Since link up we don't filling up that it's failing.

Closes #12504 and possible same issue as per #10881

it seems link_configure_addrgen_mode reductant now.

@ssahani
Copy link
Contributor Author

ssahani commented May 7, 2019

@yuwata @keszybz PTAL

@yuwata yuwata added the network label May 7, 2019
Copy link
Member

@yuwata yuwata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change seems reasonable. If it works, then I'd like to drop link_configure_addrgen_mode(). As you already mentioned it is redundant.

src/network/networkd-link.c Show resolved Hide resolved
src/network/networkd-link.c Outdated Show resolved Hide resolved
@yuwata yuwata added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label May 7, 2019
@ssahani
Copy link
Contributor Author

ssahani commented May 8, 2019

updated PTAL @yuwata . Thanks for review.

@yuwata yuwata removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label May 8, 2019
@yuwata
Copy link
Member

yuwata commented May 8, 2019

Hmm, test_link_local_addressing fails...

@yuwata yuwata added the ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR label May 8, 2019
@yuwata
Copy link
Member

yuwata commented May 8, 2019

Looks nice. Still link_configure_addrgen_mode() is necessary?

@ssahani
Copy link
Contributor Author

ssahani commented May 8, 2019

yes seems to be . It bit to handle kernel. when socket_ipv6_is_supported is there we disabling the LL address with the kernel but in later when LinkLocal=no we not getting into the if part because of link_ipv6_enabled is coming as false. But it would be nice we should unify the common code in the later PR

@ssahani
Copy link
Contributor Author

ssahani commented May 8, 2019

CI failure seems unrelated

build-login          PASS
boot-and-services    FAIL non-zero exit status 1
udev                 PASS
root-unittests       PASS

Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

```
dummy-test: Adding route: dst: fe80::cc89:aeff:fe07:bf/128, src: n/a, gw: n/a, prefsrc: n/a
dummy-test: Could not bring up interface: Invalid argument <====================
vxlan-test: Link state is up-to-date
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```

Since link up we don't filling up that it's failing.

Closes systemd#12504 and possible same issue as per systemd#10881
@yuwata yuwata added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed labels May 9, 2019
@yuwata yuwata merged commit 4eb086a into systemd:master May 9, 2019
@ssahani ssahani deleted the networkd-issue-12504 branch May 9, 2019 02:30
@yuwata
Copy link
Member

yuwata commented May 9, 2019

(BTW, I think this is a bug of inet6_set_link_af(). It does not accept an empty IFLA_AF_SPEC/AF_INET6 container. E.g., inet_set_link_af() accepts an empty container.)

@ssahani
Copy link
Contributor Author

ssahani commented May 9, 2019

I think the In the code of IFF_UP --->IFLA_INET6_ADDR_GEN_MODE added or something changed. Previously we were doing that and it was working . We can actually make this configurable

enum in6_addr_gen_mode {
        IN6_ADDR_GEN_MODE_EUI64,
        IN6_ADDR_GEN_MODE_NONE,
        IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
        IN6_ADDR_GEN_MODE_RANDOM,
};

If you interested or I will add it.

@yuwata
Copy link
Member

yuwata commented May 9, 2019

I noticed 0e2fdb8 did that. This PR partially revert the commit :-p

@yuwata
Copy link
Member

yuwata commented May 9, 2019

We can actually make this configurable

I am not sure the usecase... Let's do that when someone requests.

edevolder pushed a commit to edevolder/systemd that referenced this pull request Jun 26, 2019
Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes systemd#12504.
flokli pushed a commit to flokli/systemd that referenced this pull request Jun 28, 2019
Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes systemd#12504.

(cherry picked from commit 4eb086a)
(cherry picked from commit 8fbc72f)
Mic92 pushed a commit to NixOS/systemd that referenced this pull request Jun 29, 2019
Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes systemd#12504.

(cherry picked from commit 4eb086a)
(cherry picked from commit 8fbc72f)
clrpackages pushed a commit to clearlinux-pkgs/systemd that referenced this pull request Jul 23, 2019
On torvalds/linux@7dc2bccab0ee ("Validate required parameters in
inet6_validate_link_af") inet6_set_link_af requires that at least one
of IFLA_INET6_TOKEN or IFLA_INET6_ADDR_GET_MODE is passed. If none of them
is passed, it returns -EINVAL. This was introduced for 5.2-rc2.

Currently systemd 242 is failling to bring up the interface using kernel 5.2
and was reported at systemd/systemd#12784. There recomend to use
systemd/systemd@4eb086a38712 ("networkd: fix link_up() (systemd/systemd#12505)") and
systemd/systemd@9f6e82e6eb3b ("network: do not send ipv6 token to kernel"), to
fix the issue.
KJTsanaktsidis pushed a commit to KJTsanaktsidis/systemd that referenced this pull request Apr 14, 2020
Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes systemd#12504.
vbatts pushed a commit to kinvolk/systemd that referenced this pull request Nov 12, 2020
Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes systemd#12504.
vbatts pushed a commit to kinvolk/systemd that referenced this pull request Nov 12, 2020
Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes systemd#12504.
vbatts pushed a commit to kinvolk/systemd that referenced this pull request Nov 12, 2020
Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes systemd#12504.

(cherry picked from commit 4eb086a)
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.

networkd: throwing invalid argument while bringing up the interface
2 participants