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

FreeBSD MTU issue w/fix #1677

Closed
tickerguy opened this issue Oct 18, 2022 · 4 comments · Fixed by #1679
Closed

FreeBSD MTU issue w/fix #1677

tickerguy opened this issue Oct 18, 2022 · 4 comments · Fixed by #1679

Comments

@tickerguy
Copy link
Contributor

softether-4.38.9760
Server
FreeBSD 13.1-STABLE
64-bit AMD

The server attempts to modify the MTU of the local interface so as to use jumbo frames if the attempted transmission will be more than the default (typically 1500 bytes for an Ethernet controller.) This behavior is disabled if the interface is opened raw, but that is only supported on Linux.

On FreeBSD this results in multiple attempts to reset the MTU higher, and then complaints when even the interfaces maximum jumbo frame size is insufficient.

Expected behavior:
The server should function normally.

Actual behavior:
The server repeatedly attempts to modify the MTU, each of which attempts results in an up/down and is wildly destructive to network traffic and other services on the machine.

Steps to reproduce

Start server on FreeBSD (loaded from packages, or built from ports.)

Note repeated up/downs in the dmesg log and complaints in the server logfiles about MTU size.

Patch -

The following patch against src/Cedar/BridgeUnix.c resolves the problem by disabling the MTU reset function if and only if the software is compiled on FreeBSD.


*** BridgeUnix.c.orig   Tue Oct 18 14:16:09 2022
--- BridgeUnix.c        Tue Oct 18 13:31:05 2022
***************
*** 887,893 ****
--- 887,897 ----
        {
                return false;
        }
+ #ifndef       __FreeBSD__
        return true;
+ #else
+       return false;
+ #endif
  #else // defined(UNIX_LINUX) || defined(UNIX_BSD) || defined(UNIX_SOLARIS)
        return false;
  #endif        // defined(UNIX_LINUX) || defined(UNIX_BSD) || defined(UNIX_SOLARIS)
@shipitsin-ilia
Copy link

@tickerguy , please create a PR.

also, please notice that this repo belongs to "SE VPN Developer Edition" (versioned 5.x.x), code is aligned to stable edition, but accepting PR will not propse changes to stable edition automatically. i.e. you will need to test 5.x.x built from git master.

@metalefty , I recall you run SE VPN on freebsd, can you please review these changes ?

@metalefty
Copy link
Contributor

Yes, I will review after @tickerguy creates a PR for 5.x.

@metalefty
Copy link
Contributor

@tickerguy
Copy link
Contributor Author

tickerguy commented Oct 19, 2022 via email

@domosekai domosekai linked a pull request Oct 24, 2022 that will close this issue
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Nov 23, 2022
-  Fix DNS resolution when no IPv6 address is configured on any
   interface [1]
-  Disable MTU changes to avoid frequent interface up/down [2]

[1] SoftEtherVPN/SoftEtherVPN#1510
[2] SoftEtherVPN/SoftEtherVPN#1677

Obtained from:	SoftEtherVPN/SoftEtherVPN#1510
PR:		267178
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Dec 5, 2022
-  Fix DNS resolution when no IPv6 address is configured on any
   interface [1]
-  Disable MTU changes to avoid frequent interface up/down [2]

[1] SoftEtherVPN/SoftEtherVPN#1510
[2] SoftEtherVPN/SoftEtherVPN#1677

Obtained from:	SoftEtherVPN/SoftEtherVPN#1510
PR:		267178

(cherry picked from commit a2224f6)
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 a pull request may close this issue.

3 participants