Skip to content

Commit

Permalink
Adjusting IPROUTE_INT_REGEX to match interfaces with a dash
Browse files Browse the repository at this point in the history
and/or underscore in it after the arobase.

This would now match: 11: mgmt_team.73@mgmt_team: ...

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the
    best of my knowledge, is covered under an appropriate open
    source license and I have the right under that license to
    submit that work with modifications, whether created in whole
    or in part by me, under the same open source license (unless
    I am permitted to submit under a different license), as
    Indicated in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including
    all personal information I submit with it, including my
    sign-off) is maintained indefinitely and may be redistributed
    consistent with this project or the open source license(s)
    involved.

Signed-off-by: Francis Provencher <[email protected]>
  • Loading branch information
fprovencherdrw committed Sep 1, 2023
1 parent f7d70a7 commit 3a884e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ohai/plugins/linux/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def favored_default_route_linux(routes, iface, default_route, family)
# Match the lead line for an interface from iproute2
# 3: eth0.11@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
# The '@eth0:' portion doesn't exist on primary interfaces and thus is optional in the regex
IPROUTE_INT_REGEX ||= /^(\d+): ([0-9a-zA-Z@:\.\-_]*?)(@[0-9a-zA-Z]+|):\s/.freeze
IPROUTE_INT_REGEX ||= /^(\d+): ([0-9a-zA-Z@:\.\-_]*?)(@[0-9a-zA-Z\-_]+|):\s/.freeze

if which("ip")
# families to get default routes from
Expand Down

0 comments on commit 3a884e2

Please sign in to comment.