Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c01172c

Browse filesBrowse files
committed
Changed EthernetClient to use IANA recommended ephemeral port range, 49152-65535.
1 parent ad0bedc commit c01172c
Copy full SHA for c01172c

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎libraries/Ethernet/EthernetClient.cpp

Copy file name to clipboardExpand all lines: libraries/Ethernet/EthernetClient.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
#include "EthernetServer.h"
1313
#include "Dns.h"
1414

15-
uint16_t EthernetClient::_srcport = 1024;
15+
uint16_t EthernetClient::_srcport = 49152; //Use IANA recommended ephemeral port range 49152-65535
1616

1717
EthernetClient::EthernetClient() : _sock(MAX_SOCK_NUM) {
1818
}
@@ -51,7 +51,7 @@ int EthernetClient::connect(IPAddress ip, uint16_t port) {
5151
return 0;
5252

5353
_srcport++;
54-
if (_srcport == 0) _srcport = 1024;
54+
if (_srcport == 0) _srcport = 49152; //Use IANA recommended ephemeral port range 49152-65535
5555
socket(_sock, SnMR::TCP, _srcport, 0);
5656

5757
if (!::connect(_sock, rawIPAddress(ip), port)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.