Skip to content

Conversation

@c-po
Copy link
Member

@c-po c-po commented Dec 19, 2025

Change summary

Inspired by the regex used for set interfaces ethernet [1] adjust the regex to match for interfaces acting as a bond member interface. This has been changed to also include (in addition to eth) lan, eno, ens prefixed physical interfaces.

1: https://github.com/vyos/vyos-1x/blob/617c99b89aa2b9df985f573159d78212983a5451/interface-definitions/interfaces_ethernet.xml.in#L17

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Tests

Before:

vyos@vyos# set interfaces bonding bond10 member interface <TAB>
Possible completions:
   <text>               Interface name
   eth0
   eth0.10
   eth0.201
   eth1
   eth2
   eth3

After:

vyos@vyos# set interfaces bonding bond10 member interface <TAB>
Possible completions:
   <text>               Interface name
   eth0
   eth1
   eth2
   eth3

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Inspired by the regex used for "set interfaces ethernet" adjust the regex to
match for interfaces acting as a bond member interface. This has been changed
to also include (in addition to eth) lan, eno, ens prefixed physical interfaces.
Copy link
Contributor

@jestabro jestabro left a comment

Choose a reason for hiding this comment

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

This fixes the original problem, and generalizes the regex in a reasonable way.

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

The patch certainly fixes the problem. I have reservations about extending the regex to support patterns other than eth since we don't use those names. It shouldn't be a problem since we ensure all physical Ethernet interfaces are called ethX, though.


let filter_bondable s =
let pattern = {|^(eth)(.*)$|}
let pattern = {|^(eth|lan|eno|ens)[A-Za-z0-9_-]*$|}
Copy link
Member

@dmbaturin dmbaturin Dec 30, 2025

Choose a reason for hiding this comment

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

Suggested change
let pattern = {|^(eth|lan|eno|ens)[A-Za-z0-9_-]*$|}
let pattern = {|^(eth)[A-Za-z0-9_-]*$|}

I think we can leave it to just eth until and unless we decide to start supporting different Ethernet interface name prefixes.

@dmbaturin dmbaturin merged commit e70df7b into current Dec 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants