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
OCPBUGS-17787: Fix sysctl breaking dots in paths #3870
OCPBUGS-17787: Fix sysctl breaking dots in paths #3870
Conversation
@mkowalski: This pull request references Jira Issue OCPBUGS-17787, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cc @trozet /cc @cybertron /cc @sinnykumari |
Skipping CI for Draft Pull Request. |
/jira refresh |
@mkowalski: This pull request references Jira Issue OCPBUGS-17787, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
sysctl -w net.ipv4.conf.${iface}.forwarding=1 | ||
sysctl -w net.ipv6.conf.${iface}.forwarding=1 | ||
echo "1" > /proc/sys/net/ipv4/conf/${iface}/forwarding | ||
echo "1" > /proc/sys/net/ipv6/conf/${iface}/forwarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please quote "${iface}"
Can interfaces ever contain a /
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
TLDR: /
and white characters are forbidden from interface names
Longer version: Validations for iproute2 are defined in this code -- https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/lib/utils.c?id=1f420318bda3cc62156e89e1b56d60cc744b48ad#n827. Different tools may allow and disallow different variations, but let's also be clear that we cannot support every single tool out there and cover for every corner case. We can fix them as they arrive though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"
should handle shell meta-characters or globbing. We could always fuzz.
Using sysctl to modify paths containing dots is known to cause issues due to the fact that sysctl blindly assumes that dot is always a separator and is changed to `/`. This is a problem when we want to configure a network interface containing a dot in its name, e.g. `bond0.354`, because `net.ipv4.conf.bond0.354.forwarding=1` expands to `/proc/sys/net/ipv4/conf/bond0/354/forwarding` when in reality it should be `/proc/sys/net/ipv4/conf/bond0.354/forwarding`. To remediate this we are changing the call from `sysctl -w net.ipv4.conf.bond0.354.forwarding=1` to `echo "1" > /proc/sys/net/ipv4/conf/bond0.354/forwarding` as there is no simple way to change the behaviour of sysctl. In the current form the call is breaking the script as writing a value to a non-existing path returns an error `cannot stat [...] No such file or directory` Fixes: OCPBUGS-17787
ecd309c
to
88fffa2
Compare
/test e2e-metal-ipi-ovn-ipv6 The OpenStack job should cover the ipv4 case and the metal job will make sure ipv6 still works. /lgtm Assuming the ci jobs pass. |
/test e2e-openstack
|
@mkowalski: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/jira refresh |
@mkowalski: This pull request references Jira Issue OCPBUGS-17787, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-4.14 |
@mkowalski: once the present PR merges, I will cherry-pick it on top of release-4.14 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cybertron, mkowalski, yuqi-zhang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
73d4728
into
openshift:master
@mkowalski: Jira Issue OCPBUGS-17787: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-17787 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@mkowalski: new pull request created: #3881 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Using sysctl to modify paths containing dots is known to cause issues due to the fact that sysctl blindly assumes that dot is always a separator and is changed to
/
.This is a problem when we want to configure a network interface containing a dot in its name, e.g.
bond0.354
, becausenet.ipv4.conf.bond0.354.forwarding=1
expands to/proc/sys/net/ipv4/conf/bond0/354/forwarding
when in reality it should be/proc/sys/net/ipv4/conf/bond0.354/forwarding
.To remediate this we are changing the call from
sysctl -w net.ipv4.conf.bond0.354.forwarding=1
toecho "1" > /proc/sys/net/ipv4/conf/bond0.354/forwarding
as there is no simple way to change the behaviour of sysctl.In the current form the call is breaking the script as writing a value to a non-existing path returns an error
cannot stat [...] No such file or directory
Fixes: OCPBUGS-17787