mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-21 15:54:39 +01:00
Changed EthernetClient to use IANA recommended ephemeral port range, 49152-65535.
This commit is contained in:
parent
ad0bedcbe3
commit
c01172cd1b
@ -12,7 +12,7 @@ extern "C" {
|
|||||||
#include "EthernetServer.h"
|
#include "EthernetServer.h"
|
||||||
#include "Dns.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) {
|
EthernetClient::EthernetClient() : _sock(MAX_SOCK_NUM) {
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ int EthernetClient::connect(IPAddress ip, uint16_t port) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
_srcport++;
|
_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);
|
socket(_sock, SnMR::TCP, _srcport, 0);
|
||||||
|
|
||||||
if (!::connect(_sock, rawIPAddress(ip), port)) {
|
if (!::connect(_sock, rawIPAddress(ip), port)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user