E58C Touch-up error-message and godoc for ConfigVXLANUDPPort · moby/libnetwork@cf408c7 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf408c7

Browse files
committed
Touch-up error-message and godoc for ConfigVXLANUDPPort
Minor changes following review of the engine pull request for this feature; - Remove the name of the function from the error message as it's not a debug message. - Add the valid range to the error message, so that a user has sufficient information to address the problem. - Update GoDoc for the function to describe the default port, and valid port-ranges. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 411d314 commit cf408c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/overlay/overlayutils/utils.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ func init() {
1717
vxlanUDPPort = defaultVXLANUDPPort
1818
}
1919

20-
// ConfigVXLANUDPPort configures vxlan udp port number.
20+
// ConfigVXLANUDPPort configures the VXLAN UDP port (data path port) number.
21+
// If no port is set, the default (4789) is returned. Valid port numbers are
22+
// between 1024 and 49151.
2123
func ConfigVXLANUDPPort(vxlanPort uint32) error {
22-
// if the value comes as 0 by any reason we set it to default value 4789
2324
if vxlanPort == 0 {
2425
vxlanPort = defaultVXLANUDPPort
2526
}
@@ -29,7 +30,7 @@ func ConfigVXLANUDPPort(vxlanPort uint32) error {
2930
// The Dynamic Ports, aka the Private Ports, from 49152-65535
3031
// So we can allow range between 1024 to 49151
3132
if vxlanPort < 1024 || vxlanPort > 49151 {
32-
return fmt.Errorf("ConfigVxlanUDPPort Vxlan UDP port number is not in valid range %d", vxlanPort)
33+
return fmt.Errorf("VXLAN UDP port number is not in valid range (1024-49151): %d", vxlanPort)
3334
}
3435
mutex.Lock()
3536
vxlanUDPPort = vxlanPort

0 commit comments

Comments
 (0)
0