From nobody Fri Sep 3 23:37:30 2021 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 203CE1799A03; Fri, 3 Sep 2021 23:37:38 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H1Z350kQjz3Jg1; Fri, 3 Sep 2021 23:37:37 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: by mail-lf1-x132.google.com with SMTP id m28so1378485lfj.6; Fri, 03 Sep 2021 16:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=b2y5tLsBb9BlAlTQy2dKno6NhMzG1l3piXBG1Gp36E8=; b=p2Gj2Q/GQt0bKU5ysS4oDYSJmpFu8Aizq6stqbvy7bq/OQXqR3MQkaSj4gyGRjpXnn j5A9vwdqFE/LSZQMRzKrBqg6m/1YtwIv4NDx4ykRbBAlrZ/hDGRpYUidzMEY5WBHSCTU C7smHV/uRsaGDvNZkxsLL5Cy8xkgzO/J/NR85umVSv3LqBl9blmDSiQ3nab7YhzO9nDB JCjF2GV5mKulKeHZvtTu/OYesx/SUxy7hoAMPFexiJyRO32h2qWqsLWw+7A+HXqc6Y4o rPpzw7tvt62USiylmfJ8XvVv9oI0XFqTL+qLDwPO6OjxMCFF+4n/2mktb4ABtramjqW2 HVsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=b2y5tLsBb9BlAlTQy2dKno6NhMzG1l3piXBG1Gp36E8=; b=sML5eTmWsbalPnbIEUX4m7qlgOEvibG0My1RMP4CsBvjZkfvRhuoBh93VW2OVAU05Y 4/IkrBc/l4yUsWcw5OPWG0D2yx2TMSJT6dWMjV0wxdhBdQZtGfc/B9ZPSt5mVaMIn+Ud lhr5MHGUKUBR/40qjO/IMWaKBPjrLAp93B6XssE+68DSDRiGlKQvUii3vdV/Nk9VFHl5 tWOvqbo9b1EWnyY2sJ2x7AF7FPUG+hGsd/8QoM5z26yaZqRjVYmpRlSSECUHpjgpkYMM C6Uw6XRG28Me/2VsprElYqT/hj1SiH9AupKfXRupaKNPHnzoWBtBdJM5flQ73NbMadsf u7wg== X-Gm-Message-State: AOAM533d75UOqLI9hnUx9g1uTY5OB4wIxu3jrc5B+C6wLRIYQx8CIn3S rsQZKSwCvmW4n0aje77UGSlAc3R6okU= X-Google-Smtp-Source: ABdhPJy25/x5KnHez0SQlsfWUaXZcjvND91XH8DRgDg0aRtFMMYu0YZqcq7l/9ZzAflezrVo+O4KBg== X-Received: by 2002:a05:6512:4008:: with SMTP id br8mr907915lfb.569.1630712255631; Fri, 03 Sep 2021 16:37:35 -0700 (PDT) Received: from rimwks.local ([2001:470:1f15:3d8:7285:c2ff:fe37:5722]) by smtp.gmail.com with ESMTPSA id f44sm79033lfv.259.2021.09.03.16.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 16:37:35 -0700 (PDT) From: Rozhuk Ivan X-Google-Original-From: Rozhuk Ivan Date: Sat, 4 Sep 2021 02:37:30 +0300 To: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org Cc: Rozhuk Ivan Subject: TCP connection ignore RST Message-ID: <20210904023730.5eddd6fd@rimwks.local> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4H1Z350kQjz3Jg1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b="p2Gj2Q/G"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rozhukim@gmail.com designates 2a00:1450:4864:20::132 as permitted sender) smtp.mailfrom=rozhukim@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::132:from]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi! I have strange case: FreeBSD 12.2 ignore TCP RST from windows host and continue retransmitting packets. sockstat show that socket connected even after many tcp rst packets received. Any ideas how to fix it? System build from: commit 8c01699f9194cfa3805ac734ae912529a10c063a CommitDate: Wed Jan 20 14:40:13 2021 +0100 Add some examples to script.1... root@sa# sockstat -P tcp -v -s -S -p 389 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS PATH STATE CONN STATE STACK a s 2583 35 tcp4 192.168.33.89:62284 192.168.33.200:389 ESTABLISHED freebsd root@sa# tcpdump -n -vvvvvvvv -i vmx0 tcp port 389 tcpdump: listening on vmx0, link-type EN10MB (Ethernet), capture size 262144 bytes 01:32:19.128521 IP (tos 0x0, ttl 128, id 40117, offset 0, flags [none], proto TCP (6), length 60) 192.168.33.89.62284 > 192.168.33.200.389: Flags [S], cksum 0xc4a0 (incorrect -> 0x4ba5), seq 3223907587, win 65535, options [mss 1460,nop,wscale 10,sackOK,TS val 3640114415 ecr 0], length 0 01:32:19.128918 IP (tos 0x0, ttl 128, id 22220, offset 0, flags [DF], proto TCP (6), length 60) 192.168.33.200.389 > 192.168.33.89.62284: Flags [S.], cksum 0xca32 (correct), seq 1489249264, ack 3223907588, win 8192, options [mss 1460,nop,wscale 8,sackOK,TS val 124116297 ecr 3640114415], length 0 01:32:19.128949 IP (tos 0x0, ttl 128, id 42613, offset 0, flags [none], proto TCP (6), length 52) 192.168.33.89.62284 > 192.168.33.200.389: Flags [.], cksum 0xc498 (incorrect -> 0x10ff), seq 1, ack 1, win 2049, options [nop,nop,TS val 3640114415 ecr 124116297], length 0 01:32:19.129431 IP (tos 0x0, ttl 128, id 24596, offset 0, flags [none], proto TCP (6), length 86) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc4ba (incorrect -> 0xe4b3), seq 1:35, ack 1, win 2049, options [nop,nop,TS val 3640114415 ecr 124116297], length 34 01:32:19.130310 IP (tos 0x0, ttl 128, id 22221, offset 0, flags [DF], proto TCP (6), length 74) 192.168.33.200.389 > 192.168.33.89.62284: Flags [P.], cksum 0x35bb (correct), seq 1:23, ack 35, win 260, options [nop,nop,TS val 124116297 ecr 3640114415], length 22 01:32:19.131230 IP (tos 0x0, ttl 128, id 54687, offset 0, flags [none], proto TCP (6), length 163) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc507 (incorrect -> 0x37f8), seq 35:146, ack 23, win 2049, options [nop,nop,TS val 3640114415 ecr 124116297], length 111 01:32:19.131560 IP (tos 0x0, ttl 128, id 22222, offset 0, flags [DF], proto TCP (6), length 585) 192.168.33.200.389 > 192.168.33.89.62284: Flags [P.], cksum 0x943d (correct), seq 23:556, ack 146, win 259, options [nop,nop,TS val 124116297 ecr 3640114415], length 533 01:32:19.133323 IP (tos 0x0, ttl 128, id 50714, offset 0, flags [none], proto TCP (6), length 198) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc52a (incorrect -> 0x0ba5), seq 146:292, ack 556, win 2049, options [nop,nop,TS val 3640114415 ecr 124116297], length 146 01:32:19.133861 IP (tos 0x0, ttl 128, id 22223, offset 0, flags [DF], proto TCP (6), length 471) 192.168.33.200.389 > 192.168.33.89.62284: Flags [P.], cksum 0x3b5d (correct), seq 556:975, ack 292, win 259, options [nop,nop,TS val 124116298 ecr 3640114415], length 419 01:32:19.135305 IP (tos 0x0, ttl 128, id 43284, offset 0, flags [none], proto TCP (6), length 115) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc4d7 (incorrect -> 0xac6a), seq 292:355, ack 975, win 2049, options [nop,nop,TS val 3640114415 ecr 124116298], length 63 01:32:19.135900 IP (tos 0x0, ttl 128, id 22224, offset 0, flags [DF], proto TCP (6), length 1500) 192.168.33.200.389 > 192.168.33.89.62284: Flags [.], cksum 0x5ffb (correct), seq 975:2423, ack 355, win 258, options [nop,nop,TS val 124116298 ecr 3640114415], length 1448 01:32:19.135913 IP (tos 0x0, ttl 128, id 22225, offset 0, flags [DF], proto TCP (6), length 299) 192.168.33.200.389 > 192.168.33.89.62284: Flags [P.], cksum 0x7cb3 (correct), seq 2423:2670, ack 355, win 258, options [nop,nop,TS val 124116298 ecr 3640114415], length 247 01:32:19.135935 IP (tos 0x0, ttl 128, id 32903, offset 0, flags [none], proto TCP (6), length 52) 192.168.33.89.62284 > 192.168.33.200.389: Flags [.], cksum 0xc498 (incorrect -> 0x0530), seq 355, ack 2670, win 2048, options [nop,nop,TS val 3640114415 ecr 124116298], length 0 01:32:19.139239 IP (tos 0x0, ttl 128, id 64896, offset 0, flags [none], proto TCP (6), length 148) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc4f8 (incorrect -> 0xd163), seq 355:451, ack 2670, win 2049, options [nop,nop,TS val 3640114425 ecr 124116298], length 96 01:32:19.139753 IP (tos 0x0, ttl 128, id 22226, offset 0, flags [DF], proto TCP (6), length 1218) 192.168.33.200.389 > 192.168.33.89.62284: Flags [P.], cksum 0x1c85 (correct), seq 2670:3836, ack 451, win 258, options [nop,nop,TS val 124116298 ecr 3640114425], length 1166 01:32:19.141672 IP (tos 0x0, ttl 128, id 37692, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0xaddf), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640114425 ecr 124116298], length 7 01:32:19.141924 IP (tos 0x0, ttl 128, id 22227, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R.], cksum 0xbbe5 (correct), seq 3836, ack 458, win 0, length 0 01:32:19.408167 IP (tos 0x0, ttl 128, id 51302, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0xacd0), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640114696 ecr 124116298], length 7 01:32:19.408464 IP (tos 0x0, ttl 128, id 22241, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:19.748075 IP (tos 0x0, ttl 128, id 56645, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0xab7c), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640115036 ecr 124116298], length 7 01:32:19.748381 IP (tos 0x0, ttl 128, id 22244, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:20.228076 IP (tos 0x0, ttl 128, id 16474, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0xa99c), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640115516 ecr 124116298], length 7 01:32:20.228470 IP (tos 0x0, ttl 128, id 22247, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:20.988094 IP (tos 0x0, ttl 128, id 51707, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0xa6a4), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640116276 ecr 124116298], length 7 01:32:20.988405 IP (tos 0x0, ttl 128, id 22250, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:22.308132 IP (tos 0x0, ttl 128, id 29337, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0xa17c), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640117596 ecr 124116298], length 7 01:32:22.308280 IP (tos 0x0, ttl 128, id 22340, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:24.748054 IP (tos 0x0, ttl 128, id 14340, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0x97f4), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640120036 ecr 124116298], length 7 01:32:24.748345 IP (tos 0x0, ttl 128, id 22370, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:29.428068 IP (tos 0x0, ttl 128, id 33249, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0x85ac), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640124716 ecr 124116298], length 7 01:32:29.428395 IP (tos 0x0, ttl 128, id 22375, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:38.588058 IP (tos 0x0, ttl 128, id 30609, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0x61e4), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640133876 ecr 124116298], length 7 01:32:38.588490 IP (tos 0x0, ttl 128, id 22377, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:32:56.708045 IP (tos 0x0, ttl 128, id 37650, offset 0, flags [none], proto TCP (6), length 59) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc49f (incorrect -> 0x1b1c), seq 451:458, ack 3836, win 2049, options [nop,nop,TS val 3640151996 ecr 124116298], length 7 01:32:56.708403 IP (tos 0x0, ttl 128, id 22381, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:33:26.829653 IP (tos 0x0, ttl 128, id 6370, offset 0, flags [none], proto TCP (6), length 86) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc4ba (incorrect -> 0xc579), seq 458:492, ack 3836, win 2049, options [nop,nop,TS val 3640182115 ecr 124116298], length 34 01:33:26.829919 IP (tos 0x0, ttl 128, id 22406, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:33:32.748171 IP (tos 0x0, ttl 128, id 54306, offset 0, flags [none], proto TCP (6), length 93) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc4c1 (incorrect -> 0x6cff), seq 451:492, ack 3836, win 2049, options [nop,nop,TS val 3640188036 ecr 124116298], length 41 01:33:32.748576 IP (tos 0x0, ttl 128, id 22407, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:34:08.788230 IP (tos 0x0, ttl 128, id 31457, offset 0, flags [none], proto TCP (6), length 93) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc4c1 (incorrect -> 0xe036), seq 451:492, ack 3836, win 2049, options [nop,nop,TS val 3640224076 ecr 124116298], length 41 01:34:08.788496 IP (tos 0x0, ttl 128, id 22427, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:34:44.828060 IP (tos 0x0, ttl 128, id 8424, offset 0, flags [none], proto TCP (6), length 93) 192.168.33.89.62284 > 192.168.33.200.389: Flags [P.], cksum 0xc4c1 (incorrect -> 0x536e), seq 451:492, ack 3836, win 2049, options [nop,nop,TS val 3640260116 ecr 124116298], length 41 01:34:44.828384 IP (tos 0x0, ttl 128, id 22429, offset 0, flags [DF], proto TCP (6), length 40) 192.168.33.200.389 > 192.168.33.89.62284: Flags [R], cksum 0xdf3b (correct), seq 1489253100, win 0, length 0 01:35:20.868093 IP (tos 0x0, ttl 128, id 1379, offset 0, flags [none], proto TCP (6), length 52) 192.168.33.89.62284 > 192.168.33.200.389: Flags [R.], cksum 0xc498 (incorrect -> 0x4225), seq 492, ack 3836, win 0, options [nop,nop,TS val 3640296156 ecr 124116298], length 0