Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/arduino/Arduino.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJChristensen <jack.christensen@outlook.com>2014-10-06 06:41:39 +0400
committerJChristensen <jack.christensen@outlook.com>2014-10-06 06:41:39 +0400
commitc01172cd1bb066215fc7fdcf20c890683f39961c (patch)
tree1cbec11b0daa528e1c0ad08859808cc57fd032af
parentad0bedcbe3c8633297dbe147a6b485279bf2fb5c (diff)
Changed EthernetClient to use IANA recommended ephemeral port range, 49152-65535.
-rw-r--r--libraries/Ethernet/EthernetClient.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/Ethernet/EthernetClient.cpp b/libraries/Ethernet/EthernetClient.cpp
index ef3d19b8b..1e89c4e87 100644
--- a/libraries/Ethernet/EthernetClient.cpp
+++ b/libraries/Ethernet/EthernetClient.cpp
@@ -12,7 +12,7 @@ extern "C" {
#include "EthernetServer.h"
#include "Dns.h"
-uint16_t EthernetClient::_srcport = 1024;
+uint16_t EthernetClient::_srcport = 49152; //Use IANA recommended ephemeral port range 49152-65535
EthernetClient::EthernetClient() : _sock(MAX_SOCK_NUM) {
}
@@ -51,7 +51,7 @@ int EthernetClient::connect(IPAddress ip, uint16_t port) {
return 0;
_srcport++;
- if (_srcport == 0) _srcport = 1024;
+ if (_srcport == 0) _srcport = 49152; //Use IANA recommended ephemeral port range 49152-65535
socket(_sock, SnMR::TCP, _srcport, 0);
if (!::connect(_sock, rawIPAddress(ip), port)) {