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

bridge: Epair name for ^15 characters #820

Merged
merged 13 commits into from
Jan 26, 2025

Conversation

tschettervictor
Copy link
Collaborator

@tschettervictor tschettervictor commented Jan 19, 2025

#786

Allow bridged-VNET interface to work when interface name exceeds 15 characters. This is done by using "epairX" as the name instead of "eXa_jailname" in such cases.

Testing (all with bridged VNET, nothing else should be affected)

  1. Create jail called test, rename to test1, validate jail.conf, rc.conf, and networking

  2. Create jail called test, rename to testtesttesttest, validate jail.conf, rc.conf, and networking

  3. Create jail called testtesttesttest, rename to test1, validate jail.conf, rc.conf, and networking

  4. Create jail called testtesttesttest, rename to testing12345678, validate jail.conf, rc.conf, and networking

The purpose of the above is to validate all use cases (short name to short and long name, and long name to short and long name)

  1. Do all of the above with "clone" also.

You should find that anytime the new name exceeds 15 characters (plus the interface prefix of eXa_) it will be named "epairXa epairXb" but anytime is is shorter, the current default naming applies.

@bmac2
Copy link
Collaborator

bmac2 commented Jan 24, 2025

ok I tested this one and it made the epair names work as advertised. I don't use bridged networking so this one I had to follow his steps above.

@tschettervictor has anyone else tested this beside myself and you?

@yaazkal this one can be tested whenever in the future you get time to test.

@tschettervictor
Copy link
Collaborator Author

tschettervictor commented Jan 24, 2025

ok I tested this one and it made the epair names work as advertised. I don't use bridged networking so this one I had to follow his steps above.

@tschettervictor has anyone else tested this beside myself and you?

@yaazkal this one can be tested whenever in the future you get time to test.

Not yet. Waiting on @2Belette to also test.

@2Belette
Copy link

all working good, I have tested all the testing point listed.
the only thing I noticed, which is probably not due to this PR specifically, is when there is already an epair interface on the system, this is creating an error as there is no test made prior to the creation.
I had and epair2a on my system before creating a long name jail :

bastille create -B -V test2quiesttroplongpour15 14.2-RELEASE 10.0.0.212 vswitch_lan
Valid: (10.0.0.212).
Valid: (vswitch_lan).

Creating a thinjail...

[test2quiesttroplongpour15]:
ifconfig: interface epair2 already exists
jail: test2quiesttroplongpour15: ifconfig epair2 create: failed

[test2quiesttroplongpour15]: Not started. See 'bastille start test2quiesttroplongpour15'.
[test2quiesttroplongpour15]: Not started. See 'bastille start test2quiesttroplongpour15'.
[test2quiesttroplongpour15]:
ifconfig: interface epair2 already exists
jail: test2quiesttroplongpour15: ifconfig epair2 create: failed

I don't know if some logic can be tested and if epairX exists, trying to increment X by 1 ?

The rest is all good to me thanks for that

@tschettervictor
Copy link
Collaborator Author

There is is a test that exists. I will have to check that out.

@tschettervictor
Copy link
Collaborator Author

Can you run the same command with -x to have debug mode enabled?

@tschettervictor
Copy link
Collaborator Author

Oh wait, you had the epair already on your system?

The check will only check jail.conf files for the name.

Should we also check the system with ifconfig?

@tschettervictor
Copy link
Collaborator Author

@2Belette This seems to be another bug that is unrelated. Basically, bastille will check every jail.conf file and gather a list of defined epairs from there. If you have one that you manually created, bastille will not know about it.

I will put this on my list of things to fix.

@2Belette
Copy link

@tschettervictor that's exactly right and that the reason I said it is not due to this PR but more something we can improve in the future. So for this PR I think it is all good, but as I had this issue I thought a good idea to report but we may need another Feature Reauest for that

@tschettervictor
Copy link
Collaborator Author

It's actually a rather simple fix. I'll update this PR later with the fix included.

@tschettervictor
Copy link
Collaborator Author

@2Belette Can you test again?

Make sure to purposely create an epair on your system that is not part of any jails. Then create a jail, you should notice wit will skip over that one and go to the next highest number for the new epair.

@2Belette
Copy link

Works perfectly ! I even tried to add multiple epair manually and confirmed it is taking the highest and take the next one.
I even tried to add multiple and delete one in the middle manually and it took the one I deleted which was free to use.
Very nice!

@bmac2 bmac2 merged commit accf575 into BastilleBSD:master Jan 26, 2025
1 check passed
@tschettervictor tschettervictor deleted the interface_bridge_length_fix branch January 26, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants