Avoid socket #0 used by DHCP
This commit is contained in:
parent
58d1d99701
commit
09b83e96b3
@ -106,8 +106,8 @@ int wiznet5k_socket_socket(mod_network_socket_obj_t *socket, int *_errno) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (socket->u_param.fileno == -1) {
|
if (socket->u_param.fileno == -1) {
|
||||||
// get first unused socket number
|
// get first unused socket number ... 0 is reserved for DHCP
|
||||||
for (mp_uint_t sn = 0; sn < _WIZCHIP_SOCK_NUM_; sn++) {
|
for (mp_uint_t sn = 1; sn < _WIZCHIP_SOCK_NUM_; sn++) {
|
||||||
if ((wiznet5k_obj.socket_used & (1 << sn)) == 0) {
|
if ((wiznet5k_obj.socket_used & (1 << sn)) == 0) {
|
||||||
wiznet5k_obj.socket_used |= (1 << sn);
|
wiznet5k_obj.socket_used |= (1 << sn);
|
||||||
socket->u_param.fileno = sn;
|
socket->u_param.fileno = sn;
|
||||||
|
Loading…
Reference in New Issue
Block a user