Skip to content

Commit 9e2764a

Browse files
committed
FMET 4.7.1
1 parent f86658f commit 9e2764a

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

fnet_doc/doxygen/fnet_doc.dox

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,6 +2361,10 @@ Press any key to continue . . .
23612361

23622362
FNET public releases:
23632363

2364+
- Version 4.7.1
2365+
- Broadcast a DHCP DECLINE message, instead of unicasting.
2366+
- Randomize TCP initial sequence number.
2367+
23642368
- Version 4.7.0
23652369
- Fix possible out of bounds read on a received malformed LLMNR, mDNS or IPv6 packet.
23662370
- Add null termination check for the input-name parameter of the LLMNR, mDNS and DNS services.

fnet_doc/doxygen/fnet_gen_doc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Embedded TCP/IP stack"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 4.7.0
41+
PROJECT_NUMBER = 4.7.1
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

fnet_doc/doxygen/fnet_gen_doc_chm.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Embedded TCP/IP stack"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 4.7.0
41+
PROJECT_NUMBER = 4.7.1
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

fnet_doc/fnet_user_manual.chm

652 Bytes
Binary file not shown.

fnet_stack/fnet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
* string.
7474
* @showinitializer
7575
******************************************************************************/
76-
#define FNET_VERSION "4.7.0"
76+
#define FNET_VERSION "4.7.1"
7777

7878
/*! @} */
7979

fnet_stack/service/dhcp/fnet_dhcp_cln.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static void _fnet_dhcp_cln_send_message( fnet_dhcp_cln_if_t *dhcp )
475475
message_type = FNET_DHCP_OPTION_MSG_TYPE_REQUEST;
476476
break;
477477
case FNET_DHCP_CLN_STATE_PROBING:
478-
ip_address = dhcp->current_options.public_options.dhcp_server; /* Send REQUEST to leasing server*/
478+
ip_address.s_addr = INADDR_BROADCAST; /* As the client does not have a valid network address, the client must broadcast the DHCPDECLINE message. */
479479
message->header.ciaddr = dhcp->current_options.public_options.ip_address.s_addr;
480480
message_type = FNET_DHCP_OPTION_MSG_TYPE_DECLINE; /* DHCPDECLINE - Client to server indicating network address is already in use.*/
481481
break;

fnet_stack/stack/fnet_tcp.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ static fnet_return_t _fnet_tcp_setsockopt( fnet_socket_if_t *sk, fnet_protocol_t
110110
static fnet_return_t _fnet_tcp_getsockopt( fnet_socket_if_t *sk, fnet_protocol_t level, fnet_socket_options_t optname, void *optval, fnet_size_t *optlen );
111111
static fnet_return_t _fnet_tcp_listen( fnet_socket_if_t *sk, fnet_size_t backlog );
112112
static void _fnet_tcp_drain( void );
113+
static void _fnet_tcp_initial_seq_number_update( void );
113114

114115
#if FNET_CFG_DEBUG_TRACE_TCP && FNET_CFG_DEBUG_TRACE
115116
void _fnet_tcp_trace(fnet_uint8_t *str, fnet_tcp_header_t *tcp_hdr);
@@ -127,8 +128,8 @@ static void _fnet_tcp_drain( void );
127128
/* Initial Sequence Number
128129
* tcpcb_isntime is changed by STEPISN every 0.5 sec.
129130
* Additionaly, each time a connection is established,
130-
* tcpcb_isntime is also incremented by FNET_TCP_INITIAL_SEQ_NUMBER_STEP */
131-
static fnet_uint32_t _fnet_tcp_initial_seq_number = 1u;
131+
* tcpcb_isntime is also incremented by FNET_TCP_INITIAL_SEQ_NUMBER_STEP + random value */
132+
static fnet_uint32_t _fnet_tcp_initial_seq_number;
132133

133134
/* Timers.*/
134135
static fnet_timer_desc_t fnet_tcp_fasttimer;
@@ -174,15 +175,15 @@ fnet_prot_if_t fnet_tcp_prot_if =
174175
*************************************************************************/
175176
static fnet_return_t _fnet_tcp_init( void )
176177
{
177-
/* Create the slow timer.*/
178+
/* Create the fast timer.*/
178179
fnet_tcp_fasttimer = _fnet_timer_new(FNET_TCP_FAST_TIMER_PERIOD_MS, _fnet_tcp_fasttimo, 0u);
179180

180181
if(!fnet_tcp_fasttimer)
181182
{
182183
return FNET_ERR;
183184
}
184185

185-
/* Create the fast timer.*/
186+
/* Create the slow timer.*/
186187
fnet_tcp_slowtimer = _fnet_timer_new(FNET_TCP_SLOW_TIMER_PERIOD_MS, _fnet_tcp_slowtimo, 0u);
187188

188189
if(!fnet_tcp_slowtimer)
@@ -192,6 +193,9 @@ static fnet_return_t _fnet_tcp_init( void )
192193
return FNET_ERR;
193194
}
194195

196+
/* Initialize ISN */
197+
_fnet_tcp_initial_seq_number_update();
198+
195199
return FNET_OK;
196200
}
197201

@@ -437,6 +441,14 @@ static fnet_return_t _fnet_tcp_attach( fnet_socket_if_t *sk )
437441
return FNET_OK;
438442
}
439443

444+
/************************************************************************
445+
* DESCRIPTION: This function updates TCP ISN.
446+
*************************************************************************/
447+
static void _fnet_tcp_initial_seq_number_update( void )
448+
{
449+
/* Increase Initial Sequence Number. */
450+
_fnet_tcp_initial_seq_number += FNET_TCP_INITIAL_SEQ_NUMBER_STEP + fnet_rand() & 0xFF;
451+
}
440452
/************************************************************************
441453
* DESCRIPTION: This function performs the connection termination.
442454
*
@@ -591,7 +603,7 @@ static fnet_return_t _fnet_tcp_connect( fnet_socket_if_t *sk, struct fnet_sockad
591603
sk->state = SS_CONNECTING;
592604

593605
/* Increase Initial Sequence Number.*/
594-
_fnet_tcp_initial_seq_number += FNET_TCP_INITIAL_SEQ_NUMBER_STEP;
606+
_fnet_tcp_initial_seq_number_update();
595607

596608
/* Initialize Abort Timer.*/
597609
cb->tcpcb_timers.retransmission = cb->tcpcb_rto;
@@ -1790,7 +1802,7 @@ static fnet_bool_t _fnet_tcp_inputsk( fnet_socket_if_t *sk, fnet_netbuf_t *inseg
17901802
_fnet_tcp_send_headseg(psk, FNET_TCP_SGT_SYN | FNET_TCP_SGT_ACK, options, optionlen);
17911803

17921804
/* Increase ISN (Initial Sequence Number).*/
1793-
_fnet_tcp_initial_seq_number += FNET_TCP_INITIAL_SEQ_NUMBER_STEP;
1805+
_fnet_tcp_initial_seq_number_update();
17941806

17951807
/* Initialization the connection timer.*/
17961808
pcb->tcpcb_timers.connection = FNET_TCP_ABORT_INTERVAL_CON;
@@ -2745,7 +2757,7 @@ static void _fnet_tcp_slowtimo(fnet_uint32_t cookie)
27452757
sk = nextsk;
27462758
}
27472759

2748-
_fnet_tcp_initial_seq_number += FNET_TCP_INITIAL_SEQ_NUMBER_STEP;
2760+
_fnet_tcp_initial_seq_number_update();
27492761

27502762
fnet_isr_unlock();
27512763
}

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The stack provides following protocols and services:
1717
- QCA4002 (GT202-GC3013-FRDM4-KIT board).
1818
- QCA4004 (SX-ULPAN-2401-SHIELD board).
1919
- Supported Compilers:
20-
- IAR: Embedded Workbench for ARM, version 8.50
20+
- IAR: Embedded Workbench for ARM, version 8.22
2121
- GCC: Kinetis Design Studio, version 3.2
2222
- Bare-metal TCP/IP stack. No underlying RTOS is required, although it can be used with it. FreeRTOS example is provided.
2323
- Certified logos for:

0 commit comments

Comments
 (0)