Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions drivers/overlay/overlayutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ func init() {
vxlanUDPPort = defaultVXLANUDPPort
}

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