Skip to content

Commit 26f4395

Browse files
nxa22042Anas Nashif
authored andcommitted
net: pkt: Corrected data length appended in net_pkt_append()
The maximum data length that can be appended using net_pkt_append() should be set to TCP send_mss only if it is smaller than allowed payload length in net_pkt. Signed-off-by: Vakul Garg <[email protected]>
1 parent 687bd0d commit 26f4395

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/ip/net_pkt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ u16_t net_pkt_append(struct net_pkt *pkt, u16_t len, const u8_t *data,
12251225
max_len = pkt->data_len;
12261226

12271227
#if defined(CONFIG_NET_TCP)
1228-
if (ctx->tcp) {
1228+
if (ctx->tcp && (ctx->tcp->send_mss < max_len)) {
12291229
max_len = ctx->tcp->send_mss;
12301230
}
12311231
#endif

0 commit comments

Comments
 (0)