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

lower-layer-if inferred to vlanX when creating vlanX in CLI #531

Closed
jovatn opened this issue Jul 4, 2024 · 1 comment · Fixed by #535
Closed

lower-layer-if inferred to vlanX when creating vlanX in CLI #531

jovatn opened this issue Jul 4, 2024 · 1 comment · Fixed by #535
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jovatn
Copy link
Contributor

jovatn commented Jul 4, 2024

Current Behavior

Creating a vlan interface (here vlan30) via CLI sets interface type to "vlan" and fills out vlan tag-type (c-vlan) and id (30), which is helpful defaults. However, the lower-layer-if is set to itself (here vlan30), which is a bad dummy value. If executing leave without changing it, we get an error message.

admin@infix-06-11-00:/> configure
admin@infix-06-11-00:/config/> edit interface vlan30
admin@infix-06-11-00:/config/interface/vlan30/> show
type vlan;
vlan {
  tag-type c-vlan;
  id 30;
  lower-layer-if vlan30;
}
admin@infix-06-11-00:/config/interface/vlan30/> leave
Error: EV ORIGIN: SHM event "done" ID 4 processing timed out.
Please check your changes, try 'diff' and 'do show interfaces'.
admin@infix-06-11-00:/config/interface/vlan30/>

Syslog shows the following

Jul  4 09:13:34 infix-06-11-00 confd[2497]: find: /run/net/3/dag/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30/vlan30: Too many levels of symbolic links
Jul  4 09:13:34 infix-06-11-00 dagger[2497]: Aborting: /run/net/3/action/init/vlan30/50-init.ip failed with exitcode 1
Jul  4 09:13:34 infix-06-11-00 dagger[2497]: Abandoned generation 3
Jul  4 09:13:34 infix-06-11-00 confd[2497]: Failed to apply interface configuration
Jul  4 09:13:34 infix-06-11-00 confd[2497]: [ERR] Oups, error detected in SR_EV_DONE 

And it turns out that we are stuck. Setting the lower-layer-if after a "leave" does not work.

admin@infix-06-11-00:/config/interface/vlan30/> set vlan lower-layer-if e9
Error: EV ORIGIN: SHM event "update" ID 5 processing timed out.
Error: Failed applying changes (2).
admin@infix-06-11-00:/config/interface/vlan30/> 

Note, if we would have changed the lower-layer-if before running "leave" it would have worked. Here an example with vlan20.

admin@infix-06-11-00:/> configure 
admin@infix-06-11-00:/config/> edit interface vlan20
admin@infix-06-11-00:/config/interface/vlan20/> set vlan lower-layer-if e8
admin@infix-06-11-00:/config/interface/vlan20/> leave
admin@infix-06-11-00:/> 

Expected Behavior

It is hard to know what we should fill out in "lower-layer-if" in this case (compare when creating interface e9.20, where we know vlan id 20 and lower-layer-if e9)

  • leave empty? with a hint to fill out?
  • set to br0 (if existing), otherwise empty? with a hint to check or fill out? see examples below
  • set to itself (vlanX), but with some better error message and ability to set it after leave
  • some more advanced algorithm (setting to bridge with lowest if-index, or ethernet port with lowest if-index if no port exist)
  • something else?

Example if br0 exist

admin@infix-06-11-00:/> configure
admin@infix-06-11-00:/config/> edit interface vlan30
Note: 'lower-layer-if' set to 'br0'. 
admin@infix-06-11-00:/config/interface/vlan30/> show
type vlan;
vlan {
  tag-type c-vlan;
  id 30;
  lower-layer-if br0;
}
admin@infix-06-11-00:/config/interface/vlan30/>

Example if br0 does not exist

admin@infix-06-11-00:/> configure
admin@infix-06-11-00:/config/> edit interface vlan30
Note: vlan 'lower-layer-if' not configured. 
admin@infix-06-11-00:/config/interface/vlan30/> show
type vlan;
vlan {
  tag-type c-vlan;
  id 30;
}
admin@infix-06-11-00:/config/interface/vlan30/> leave
Error: Mandatory node "lower-layer-if" instance does not exist. (path "/ietf-interfaces:interfaces/interface[name='vlan30']/infix-interfaces:vlan")
Failed committing candidate to running: Validation failed
admin@infix-06-11-00:/config/interface/vlan30/> 

Steps To Reproduce

This was tested using Infix v24.06.0,but behaviour is not new.
It was tested on hardware, and ought to be the same with qemu or GNS3.

Steps in current behavior should be enough to reproduce.

Additional information

No response

@jovatn jovatn added bug Something isn't working triage Pending investigation & classification (CCB) labels Jul 4, 2024
@troglobit
Copy link
Contributor

Triage gives that this behavior was introduced in #391.

IMO the most reasonable way to fix this is to not set lower-layer-if at all. We cannot, and shouldn't guess br0, and the built-in validation provides a good enough warning if the user tries to leave before setting it.

The procedure should be:

  1. I want to create a VLAN interface, vlan10
  2. Wow, the OS already filled in c-vlan and vid 10!
  3. OK, I want to create my interface on bridge72
  4. leave

@troglobit troglobit removed the triage Pending investigation & classification (CCB) label Jul 8, 2024
@troglobit troglobit self-assigned this Jul 8, 2024
@troglobit troglobit added this to the Infix v24.08 milestone Jul 8, 2024
troglobit added a commit that referenced this issue Jul 8, 2024
Inference for an interface named vlanN can only guess C-VLAN and VID,
the base interface must be left to the user to fill in.  This is also
mandatory in the model.

Fixes #531

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit linked a pull request Jul 8, 2024 that will close this issue
13 tasks
troglobit added a commit that referenced this issue Jul 11, 2024
Inference for an interface named vlanN can only guess C-VLAN and VID,
the base interface must be left to the user to fill in.  This is also
mandatory in the model.

Fixes #531

Signed-off-by: Joachim Wiberg <[email protected]>
troglobit added a commit that referenced this issue Aug 7, 2024
Inference for an interface named vlanN can only guess C-VLAN and VID,
the base interface must be left to the user to fill in.  This is also
mandatory in the model.

Fixes #531

Signed-off-by: Joachim Wiberg <[email protected]>
troglobit added a commit that referenced this issue Aug 8, 2024
Inference for an interface named vlanN can only guess C-VLAN and VID,
the base interface must be left to the user to fill in.  This is also
mandatory in the model.

Fixes #531

Signed-off-by: Joachim Wiberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants