Skip to content

Commit cb7b274

Browse files
jukkarnashif
authored andcommitted
net: tcp: Check pkt before sending RESET
In certain TCP states we should not try to send RESET segment to peer. So check this and do not try to use NULL pkt to send a message. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent ba9b133 commit cb7b274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/ip/net_context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static int send_reset(struct net_context *context,
776776
int ret;
777777

778778
ret = net_tcp_prepare_reset(context->tcp, remote, &pkt);
779-
if (ret) {
779+
if (ret || !pkt) {
780780
return ret;
781781
}
782782

0 commit comments

Comments
 (0)