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 <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2017-06-09 12:40:12 +03:00
commit 286139e13b

View file

@ -778,7 +778,7 @@ static int send_reset(struct net_context *context,
int ret;
ret = net_tcp_prepare_reset(context->tcp, remote, &pkt);
if (ret) {
if (ret || !pkt) {
return ret;
}