From owner-freebsd-net@freebsd.org Sun Jul 28 14:51:02 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DB1DACDD7 for ; Sun, 28 Jul 2019 14:51:02 +0000 (UTC) (envelope-from vit@otcnet.ru) Received: from mail.otcnet.ru (mail.otcnet.ru [194.190.78.3]) by mx1.freebsd.org (Postfix) with ESMTP id 31F8997C81 for ; Sun, 28 Jul 2019 14:51:00 +0000 (UTC) (envelope-from vit@otcnet.ru) Received: from Victors-MacBook-Air-2.local (unknown [194.190.78.9]) by mail.otcnet.ru (Postfix) with ESMTPSA id D85DE73486 for ; Sun, 28 Jul 2019 17:50:52 +0300 (MSK) To: freebsd-net@freebsd.org From: Victor Gamov Subject: how to down interface at startup Organization: OTCnet Message-ID: <8e49d9c0-6950-dcb3-ac62-25a9a1f86c2e@otcnet.ru> Date: Sun, 28 Jul 2019 17:50:52 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 31F8997C81 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of vit@otcnet.ru designates 194.190.78.3 as permitted sender) smtp.mailfrom=vit@otcnet.ru X-Spamd-Result: default: False [-0.90 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.981,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.otcnet.ru]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; HAS_ORG_HEADER(0.00)[]; DMARC_NA(0.00)[otcnet.ru]; NEURAL_SPAM_SHORT(0.58)[0.583,0]; MX_GOOD(-0.01)[mail.otcnet.ru]; NEURAL_HAM_MEDIUM(-0.29)[-0.292,0]; IP_SCORE(0.00)[country: RU(0.01)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:50822, ipnet:194.190.78.0/24, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2019 14:51:02 -0000 Hi All I have configuration where bridge interface need to be down at startup. But "ifconfig_bridge2="down" is not working: bridge always up How I can 'down' bridge interface at startup? -- CU, Victor Gamov From owner-freebsd-net@freebsd.org Sun Jul 28 15:09:19 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1CB7AD4A9 for ; Sun, 28 Jul 2019 15:09:19 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 70771684E7 for ; Sun, 28 Jul 2019 15:09:08 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x6SF8wWx059186 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 28 Jul 2019 15:09:01 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: vit@otcnet.ru Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x6SF8nrU088145 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 28 Jul 2019 22:08:50 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: how to down interface at startup To: Victor Gamov , freebsd-net@freebsd.org References: <8e49d9c0-6950-dcb3-ac62-25a9a1f86c2e@otcnet.ru> From: Eugene Grosbein Message-ID: <9e135f5f-48c1-44b0-1eea-fe47f7a61fc7@grosbein.net> Date: Sun, 28 Jul 2019 22:08:44 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <8e49d9c0-6950-dcb3-ac62-25a9a1f86c2e@otcnet.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 70771684E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-2.52 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.935,0]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.24)[-0.235,0]; IP_SCORE(-0.75)[ipnet: 2a01:4f8::/29(-1.93), asn: 24940(-1.82), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2019 15:09:19 -0000 28.07.2019 21:50, Victor Gamov wrote: > I have configuration where bridge interface need to be down at startup. > > But "ifconfig_bridge2="down" is not working: bridge always up > > How I can 'down' bridge interface at startup? If you use rc.conf to configure it, please read rc.conf(5) manual page carefully: ... Interfaces that the administrator wishes to store configuration for, but not start at boot should be configured with the "NOAUTO" keyword in their ifconfig_ variables as described below. From owner-freebsd-net@freebsd.org Sun Jul 28 15:33:39 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79F47ADDC4 for ; Sun, 28 Jul 2019 15:33:39 +0000 (UTC) (envelope-from vit@otcnet.ru) Received: from mail.otcnet.ru (mail.otcnet.ru [194.190.78.3]) by mx1.freebsd.org (Postfix) with ESMTP id B2FEF6AC28 for ; Sun, 28 Jul 2019 15:33:38 +0000 (UTC) (envelope-from vit@otcnet.ru) Received: from Victors-MacBook-Air-2.local (unknown [194.190.78.9]) by mail.otcnet.ru (Postfix) with ESMTPSA id 9F08A7349E; Sun, 28 Jul 2019 18:33:37 +0300 (MSK) Subject: Re: how to down interface at startup To: Eugene Grosbein , freebsd-net@freebsd.org References: <8e49d9c0-6950-dcb3-ac62-25a9a1f86c2e@otcnet.ru> <9e135f5f-48c1-44b0-1eea-fe47f7a61fc7@grosbein.net> From: Victor Gamov Organization: OTCnet Message-ID: Date: Sun, 28 Jul 2019 18:33:36 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <9e135f5f-48c1-44b0-1eea-fe47f7a61fc7@grosbein.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: B2FEF6AC28 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of vit@otcnet.ru designates 194.190.78.3 as permitted sender) smtp.mailfrom=vit@otcnet.ru X-Spamd-Result: default: False [-1.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.41)[-0.409,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.otcnet.ru]; NEURAL_HAM_LONG(-0.98)[-0.976,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[otcnet.ru]; NEURAL_SPAM_SHORT(0.57)[0.570,0]; HAS_ORG_HEADER(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.otcnet.ru]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(0.00)[country: RU(0.01)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:50822, ipnet:194.190.78.0/24, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2019 15:33:39 -0000 On 28/07/2019 18:08, Eugene Grosbein wrote: > 28.07.2019 21:50, Victor Gamov wrote: > >> I have configuration where bridge interface need to be down at startup. >> >> But "ifconfig_bridge2="down" is not working: bridge always up >> >> How I can 'down' bridge interface at startup? > > If you use rc.conf to configure it, please read rc.conf(5) manual page carefully: > > ... Interfaces that the > administrator wishes to store configuration for, but not > start at boot should be configured with the "NOAUTO" keyword > in their ifconfig_ variables as described below. Eugene Thank you very much! I really need be more carefully while reading docs. Thanks! -- CU Victor Gamov From owner-freebsd-net@freebsd.org Sun Jul 28 21:01:55 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EA4BB4052 for ; Sun, 28 Jul 2019 21:01:55 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 62B8576AA4 for ; Sun, 28 Jul 2019 21:01:20 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 49B2AB3FA0; Sun, 28 Jul 2019 21:01:12 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4979FB3F9F for ; Sun, 28 Jul 2019 21:01:12 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7C7D767C9 for ; Sun, 28 Jul 2019 21:00:52 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC9E21D957 for ; Sun, 28 Jul 2019 21:00:50 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x6SL0o1O096034 for ; Sun, 28 Jul 2019 21:00:50 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x6SL0oFx096026 for net@FreeBSD.org; Sun, 28 Jul 2019 21:00:50 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201907282100.x6SL0oFx096026@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: net@FreeBSD.org Subject: Problem reports for net@FreeBSD.org that need special attention Date: Sun, 28 Jul 2019 21:00:50 +0000 MIME-Version: 1.0 X-Rspamd-Queue-Id: B7C7D767C9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2019 21:01:55 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- In Progress | 221146 | [ixgbe] Problem with second laggport In Progress | 235700 | oce(4) driver causes fatal trap 12 on boot with e New | 204438 | setsockopt() handling of kern.ipc.maxsockbuf limi New | 205592 | TCP processing in IPSec causes kernel panic New | 213410 | [carp] service netif restart causes hang only whe Open | 193452 | Dell PowerEdge 210 II -- Kernel panic bce (broadc Open | 194485 | Userland cannot add IPv6 prefix routes Open | 200319 | Bridge+CARP crashes/freezes Open | 202510 | [CARP] advertisements sourced from CARP IP cause Open | 222273 | igb(4): Kernel panic (fatal trap 12) due to netwo Open | 225438 | panic in6_unlink_ifa() due to race Open | 227720 | Kernel panic in ppp server Open | 233952 | jme NICs non functional after 11.2 to 12.0 upgrad Open | 236888 | ppp daemon: Allow MTU to be overridden for PPPoE Open | 236983 | bnxt(4) VLAN not operational unless explicit "ifc Open | 237072 | netgraph(4): performance issue [on HardenedBSD]? Open | 237391 | route get returns no result for network addresses Open | 237840 | Removed dummynet dependency on ipfw 18 problems total for which you should take action. From owner-freebsd-net@freebsd.org Mon Jul 29 05:35:38 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AB95BDCE8 for ; Mon, 29 Jul 2019 05:35:38 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0566D8F0C7 for ; Mon, 29 Jul 2019 05:35:36 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yv.noip.me (c-67-180-169-236.hsd1.ca.comcast.net [67.180.169.236]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id x6T5ZZXI097362 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 28 Jul 2019 22:35:35 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-67-180-169-236.hsd1.ca.comcast.net [67.180.169.236] claimed to be yv.noip.me To: "freebsd-net@freebsd.org" From: Yuri Subject: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)? Message-ID: Date: Sun, 28 Jul 2019 22:35:34 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 0566D8F0C7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of yuri@rawbw.com designates 198.144.192.42 as permitted sender) smtp.mailfrom=yuri@rawbw.com X-Spamd-Result: default: False [-4.77 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:198.144.192.32/27]; HAS_XAW(0.00)[]; MX_GOOD(-0.01)[cached: mx.rawbw.net]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; RCVD_NO_TLS_LAST(0.10)[]; RECEIVED_SPAMHAUS_PBL(0.00)[236.169.180.67.zen.spamhaus.org : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:7961, ipnet:198.144.192.0/20, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[rawbw.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[42.192.144.198.list.dnswl.org : 127.0.10.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; IP_SCORE(-2.58)[ip: (-5.90), ipnet: 198.144.192.0/20(-3.22), asn: 7961(-3.72), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 05:35:38 -0000 I am asking because wireshark doesn't sense the interface list changes, and it just always shows the list from the time it was launched . Yuri From owner-freebsd-net@freebsd.org Mon Jul 29 05:58:48 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 944C9BE1EA for ; Mon, 29 Jul 2019 05:58:48 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail.allbsd.org (mx.allbsd.org [IPv6:2001:2f0:104:e001::41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8D8B8FA6C for ; Mon, 29 Jul 2019 05:58:47 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:4700:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id x6T5wJUt058815 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) (Client CN "/CN=mail-d.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=Let's+20Encrypt+20Authority+20X3"); Mon, 29 Jul 2019 14:58:30 +0900 (JST) (envelope-from hrs@allbsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=allbsd.org; s=20190220; t=1564379923; bh=YVwujWuM1qd0LMJw+C+Yqcv+/voMPn2DccKgezt2+fQ=; h=Date:To:Cc:Subject:From:In-Reply-To:References; b=q68k9fRT8QCzPrr82sg8GhKQ88OMGTPwal+pg6HujwP4iE3pcHfsowJ2NY1Iv68Yt QSiIZi6hRpJyOCExPx3wnTCyxSsLbY0kaWQy173P+CqXy6Ufv0BlYhFf6KWz6JXBL/ OjufjzQ9B6P3QmUBycMVnDEgbx77PgcqROoBJr64= Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:4700:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id x6T5wDKN080793 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 29 Jul 2019 14:58:14 +0900 (JST) (envelope-from hrs@allbsd.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id x6T5wBj0080790; Mon, 29 Jul 2019 14:58:13 +0900 (JST) (envelope-from hrs@allbsd.org) Date: Mon, 29 Jul 2019 14:56:54 +0900 (JST) Message-Id: <20190729.145654.1521764302694128109.hrs@allbsd.org> To: yuri@rawbw.com Cc: freebsd-net@freebsd.org Subject: Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)? From: Hiroki Sato In-Reply-To: References: X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jul_29_14_56_54_2019_268)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Mon, 29 Jul 2019 14:58:37 +0900 (JST) X-Spam-Status: No, score=4.7 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1, RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY,RCVD_IN_AHBL_SPAM,RDNS_NONE, UNPARSEABLE_RELAY,URIBL_SC2_SURBL,URIBL_XS_SURBL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx.allbsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 05:58:48 -0000 ----Security_Multipart(Mon_Jul_29_14_56_54_2019_268)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Yuri wrote in : yu> I am asking because wireshark doesn't sense the interface list yu> changes, and it just always shows the list from the time it was yu> launched . You can open a routing socket and watch it to see if RTM_IFANNOUNCE message is coming. The following command lines (on two different terminals on the same machine) show how this works when a new interface arrives: termA% route monitor (this waits for routing messages) termB# ifconfig tap0 create An example code to handle routing messages can be found in src/sbin/route/route.c. -- Hiroki ----Security_Multipart(Mon_Jul_29_14_56_54_2019_268)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAl0+iqYACgkQTyzT2CeTzy1ctACff7pORjAKQnbAzG8s3Iubfhe4 fzIAoNzC6pAIDNpFBEdFVaUcHs2EX3QY =q6Vo -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jul_29_14_56_54_2019_268)---- From owner-freebsd-net@freebsd.org Mon Jul 29 06:04:42 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4690BE405 for ; Mon, 29 Jul 2019 06:04:42 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F8238FD86 for ; Mon, 29 Jul 2019 06:04:31 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x6T64GVL010970 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jul 2019 06:04:23 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: yuri@rawbw.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x6T64B3S003468 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 29 Jul 2019 13:04:11 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)? To: Yuri , "freebsd-net@freebsd.org" References: From: Eugene Grosbein Message-ID: <4c60eb9c-2947-1d2b-3c65-8b87201a0487@grosbein.net> Date: Mon, 29 Jul 2019 13:04:05 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 0F8238FD86 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-2.17 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.927,0]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.90)[-0.901,0]; IP_SCORE(-0.75)[ipnet: 2a01:4f8::/29(-1.93), asn: 24940(-1.82), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 06:04:42 -0000 29.07.2019 12:35, Yuri wrote: > I am asking because wireshark doesn't sense the interface list changes, and it just always shows the list from the time it was launched . There is a way as we have devd(8) reading kernel-generated events and running commands in response. Look at default /etc/devd.conf rules for example: notify 0 { match "system" "IFNET"; match "subsystem" "!(usbus|wlan)[0-9]+"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; Quoting devd(8) manual page: > Since devctl(4) allows only one active reader, devd multiplexes it, > forwarding all events to any number of connected clients. Clients > connect by opening the SOCK_SEQPACKET UNIX domain socket at > /var/run/devd.seqpacket.pipe. We have bsnmpd(1) in base system and its module usr.sbin/bsnmpd/modules/snmp_hostres acting as client of devd, for example. From owner-freebsd-net@freebsd.org Mon Jul 29 14:17:16 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46D62AAB32 for ; Mon, 29 Jul 2019 14:17:16 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B227185689; Mon, 29 Jul 2019 14:17:05 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x6TEGuwr044413; Mon, 29 Jul 2019 07:16:56 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x6TEGtl4044412; Mon, 29 Jul 2019 07:16:55 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201907291416.x6TEGtl4044412@gndrsh.dnsmgr.net> Subject: Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)? In-Reply-To: To: Yuri Date: Mon, 29 Jul 2019 07:16:55 -0700 (PDT) CC: "freebsd-net@freebsd.org" , tuexen@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B227185689 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.53 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.87)[0.874,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.74)[0.743,0]; MX_GOOD(-0.01)[gndrsh.dnsmgr.net,gndrsh.dnsmgr.net]; NEURAL_SPAM_LONG(0.98)[0.979,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 14:17:16 -0000 > I am asking because wireshark doesn't sense the interface list changes, > and it just always shows the list from the time it was launched . I am cc'ing Michael Tuexen , both a FreeBSD and long time wireshare developer. I see there has been at least 2 ways proposed to you for doing this, I would suggest using the route socket as the prefered method as that should be some what portable accross all the BSD type platforms, a devd solution would be FreeBSD specific. > Yuri -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-net@freebsd.org Mon Jul 29 15:39:44 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 229E4ADF88 for ; Mon, 29 Jul 2019 15:39:44 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C208C88C9B for ; Mon, 29 Jul 2019 15:39:43 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2a02:8109:1140:c3d:5980:18c2:160b:3bc5] (unknown [IPv6:2a02:8109:1140:c3d:5980:18c2:160b:3bc5]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id ACDB3721E2825; Mon, 29 Jul 2019 17:39:39 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)? From: Michael Tuexen In-Reply-To: <201907291416.x6TEGtl4044412@gndrsh.dnsmgr.net> Date: Mon, 29 Jul 2019 17:39:39 +0200 Cc: Yuri , "freebsd-net@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <96735BB9-3316-4E0E-A029-DC17893CCC8F@freebsd.org> References: <201907291416.x6TEGtl4044412@gndrsh.dnsmgr.net> To: "Rodney W. Grimes" X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 15:39:44 -0000 > On 29. Jul 2019, at 16:16, Rodney W. Grimes = wrote: >=20 >> I am asking because wireshark doesn't sense the interface list = changes,=20 >> and it just always shows the list from the time it was launched . Does it also not show up after selecting Capture/Refresh Interfaces? Best regards Michael >=20 > I am cc'ing Michael Tuexen , > both a FreeBSD and long time wireshare developer. >=20 > I see there has been at least 2 ways proposed to you for > doing this, I would suggest using the route socket as the > prefered method as that should be some what portable > accross all the BSD type platforms, a devd solution would > be FreeBSD specific. >=20 >=20 >> Yuri > --=20 > Rod Grimes = rgrimes@freebsd.org > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-net@freebsd.org Mon Jul 29 18:00:31 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDADAB1025 for ; Mon, 29 Jul 2019 18:00:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9527F8D2B2; Mon, 29 Jul 2019 18:00:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 0D0F114430; Mon, 29 Jul 2019 18:00:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: mmap kernel chunk into user space To: Laurie Jennings , FreeBSD Net Cc: Konstantin Belousov References: <2146491394.4652133.1563758485195.ref@mail.yahoo.com> <2146491394.4652133.1563758485195@mail.yahoo.com> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <4e1e8544-6205-3a38-7267-ada19c862e62@FreeBSD.org> Date: Mon, 29 Jul 2019 11:00:29 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <2146491394.4652133.1563758485195@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9527F8D2B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 18:00:32 -0000 On 7/21/19 6:21 PM, Laurie Jennings wrote: > > Im wondering if there have been changes to the api since FreeBSD 9 as I can't get some code I'm porting to work. > I have a block of kernel memory wired down and I want to map it to user space. Its just a big structure that has stats and other volatile info. In 9.x I was able to simply do: > // kptr has the kernel address obtained from an ioctl call > > fd=open("/dev/kmem",O_RDWR);memp=mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,(off_t)kptr); > > And it just worked. In 11.3 it fails, and I havent been able to get ANYTHING to work with this method. I'm open to another method; I read something about mmap no longer supportinjgkmem. In which case, what can I do? Supporting arbitrary mmap of /dev/kmem is not safe as the user mappings weren't updated if the kernel mappings changed. To do what you want, you would create a dedicated device in /dev that you can mmap to access your data structure. The simplest way is to just have your device's d_mmap callback use the offset as an offset into your in-kernel pointer and then use pmap_kextract() to get the physical address to return. A fancier version would be to build an sglist describing your buffer and create an OBJT_SG VM object that you returned from the d_mmap_single callback, but if you only ever have a single object that is never freed, the simple version will work fine. -- John Baldwin From owner-freebsd-net@freebsd.org Wed Jul 31 12:07:08 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25A48BCDC0 for ; Wed, 31 Jul 2019 12:07:08 +0000 (UTC) (envelope-from viktor@dukhovni.org) Received: from straasha.imrryr.org (straasha.imrryr.org [100.2.39.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zBxR0rjRz3G53 for ; Wed, 31 Jul 2019 12:07:06 +0000 (UTC) (envelope-from viktor@dukhovni.org) Received: by straasha.imrryr.org (Postfix, from userid 1001) id CBC2647039; Wed, 31 Jul 2019 08:07:05 -0400 (EDT) Date: Wed, 31 Jul 2019 08:07:05 -0400 From: Viktor Dukhovni To: freebsd-net@freebsd.org Subject: Preferring internal IPv6 source address over gif tunnel IP? Message-ID: <20190731120705.GC24255@straasha.imrryr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 45zBxR0rjRz3G53 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of viktor@dukhovni.org designates 100.2.39.101 as permitted sender) smtp.mailfrom=viktor@dukhovni.org X-Spamd-Result: default: False [0.20 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:100.2.39.101]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dukhovni.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.17)[asn: 701(0.88), country: US(-0.05)]; RCVD_IN_DNSWL_MED(-0.20)[101.39.2.100.list.dnswl.org : 127.0.6.2]; MX_GOOD(-0.01)[smtp.dukhovni.org]; NEURAL_HAM_SHORT(-0.45)[-0.454,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:701, ipnet:100.2.0.0/16, country:US]; MIME_TRACE(0.00)[0:+] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 12:07:08 -0000 My FreeBSD machine is also my router, and for lack IPv6 support by Verizon, now uses a "gif" tunnel via Hurricane Electric. HE provides me with two prefixes: 1. Point to point tunnel /128: cloned_interfaces="gif0" create_args_gif0="tunnel " ifconfig_gif0_ipv6="inet6 ::2 ::1 prefixlen 128" ipv6_defaultrouter="::1" 2. A /64 for my network: ipv6_network_interfaces="igb1" ifconfig_igb1_ipv6="inet6 ::1 prefixlen 64" They support DNS reverse resolution delegation for "my-network" (the /64), but not the point-to-point "tunnel-prefix" (the /128). Since a bunch of my traffic is SMTP, I need reverse resolution for outgoing IPv6, which means that I need the outgoing sources address to be ::1, not ::2, even though the routing table lists "gif0" as the interface with the default route. Is it possible to configure my system to use the internal /64 address as the default source address of outgoing IPv6 packets? If it would help, I can assign the "::1" address to the external physical network interface (same one that has the tunnel v4 address) or the loopback interface... RFC3484 section4 hints at such possibilities (https://tools.ietf.org/html/rfc3484#page-9): It is RECOMMENDED that the candidate source addresses be the set of unicast addresses assigned to the interface that will be used to send to the destination. (The "outgoing" interface.) On routers, the candidate set MAY include unicast addresses assigned to any interface that forwards packets, subject to the restrictions described below. Discussion: The Neighbor Discovery Redirect mechanism [14] requires that routers verify that the source address of a packet identifies a neighbor before generating a Redirect, so it is advantageous for hosts to choose source addresses assigned to the outgoing interface. Implementations that wish to support the use of global source addresses assigned to a loopback interface should behave as if the loopback interface originates and forwards the packet. Or could I assign an explicit non-global scope to the tunnel address? Or ... (whatever works). Any help much appreciated. -- Viktor. I used to use 6to4 with stf0, but it seems that 6to4 is deprecated, and the standard anycast address I was using for the gateway seems has recently become unreachable. From owner-freebsd-net@freebsd.org Wed Jul 31 12:07:27 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3B66BCE2E for ; Wed, 31 Jul 2019 12:07:27 +0000 (UTC) (envelope-from ietf-dane@dukhovni.org) Received: from straasha.imrryr.org (straasha.imrryr.org [100.2.39.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zBxq2Tkfz3G95 for ; Wed, 31 Jul 2019 12:07:27 +0000 (UTC) (envelope-from ietf-dane@dukhovni.org) Received: by straasha.imrryr.org (Postfix, from userid 1001) id 4794247060; Wed, 31 Jul 2019 08:07:27 -0400 (EDT) Date: Wed, 31 Jul 2019 08:07:27 -0400 From: Viktor Dukhovni To: freebsd-net@freebsd.org Subject: Preferring internal IPv6 source address over gif tunnel IP? Message-ID: <20190731120726.GD24255@straasha.imrryr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 45zBxq2Tkfz3G95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ietf-dane@dukhovni.org designates 100.2.39.101 as permitted sender) smtp.mailfrom=ietf-dane@dukhovni.org X-Spamd-Result: default: False [-2.20 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:100.2.39.101:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dukhovni.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.70)[ip: (-6.21), ipnet: 100.2.0.0/16(-3.11), asn: 701(0.88), country: US(-0.05)]; RCVD_IN_DNSWL_MED(-0.20)[101.39.2.100.list.dnswl.org : 127.0.6.2]; MX_GOOD(-0.01)[cached: smtp.dukhovni.org]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:701, ipnet:100.2.0.0/16, country:US]; SUBJECT_ENDS_QUESTION(1.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 12:07:27 -0000 My FreeBSD machine is also my router, and for lack IPv6 support by Verizon, now uses a "gif" tunnel via Hurricane Electric. HE provides me with two prefixes: 1. Point to point tunnel /128: cloned_interfaces="gif0" create_args_gif0="tunnel " ifconfig_gif0_ipv6="inet6 ::2 ::1 prefixlen 128" ipv6_defaultrouter="::1" 2. A /64 for my network: ipv6_network_interfaces="igb1" ifconfig_igb1_ipv6="inet6 ::1 prefixlen 64" They support DNS reverse resolution delegation for "my-network" (the /64), but not the point-to-point "tunnel-prefix" (the /128). Since a bunch of my traffic is SMTP, I need reverse resolution for outgoing IPv6, which means that I need the outgoing sources address to be ::1, not ::2, even though the routing table lists "gif0" as the interface with the default route. Is it possible to configure my system to use the internal /64 address as the default source address of outgoing IPv6 packets? If it would help, I can assign the "::1" address to the external physical network interface (same one that has the tunnel v4 address) or the loopback interface... RFC3484 section4 hints at such possibilities (https://tools.ietf.org/html/rfc3484#page-9): It is RECOMMENDED that the candidate source addresses be the set of unicast addresses assigned to the interface that will be used to send to the destination. (The "outgoing" interface.) On routers, the candidate set MAY include unicast addresses assigned to any interface that forwards packets, subject to the restrictions described below. Discussion: The Neighbor Discovery Redirect mechanism [14] requires that routers verify that the source address of a packet identifies a neighbor before generating a Redirect, so it is advantageous for hosts to choose source addresses assigned to the outgoing interface. Implementations that wish to support the use of global source addresses assigned to a loopback interface should behave as if the loopback interface originates and forwards the packet. Or could I assign an explicit non-global scope to the tunnel address? Or ... (whatever works). Any help much appreciated. -- Viktor. I used to use 6to4 with stf0, but it seems that 6to4 is deprecated, and the standard anycast address I was using for the gateway seems has recently become unreachable. From owner-freebsd-net@freebsd.org Wed Jul 31 12:46:31 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A89DBDABC for ; Wed, 31 Jul 2019 12:46:31 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from kagate.punkt.de (kagate.punkt.de [217.29.33.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zCpn2nC0z3J3q for ; Wed, 31 Jul 2019 12:46:25 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from hugo10.ka.punkt.de (hugo10.ka.punkt.de [217.29.44.10]) by gate2.intern.punkt.de with ESMTP id x6VCkGme008547; Wed, 31 Jul 2019 14:46:16 +0200 (CEST) Received: from [217.29.44.222] ([217.29.44.222]) by hugo10.ka.punkt.de (8.14.2/8.14.2) with ESMTP id x6VCkEWH092585; Wed, 31 Jul 2019 14:46:15 +0200 (CEST) (envelope-from hausen@punkt.de) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? From: "Patrick M. Hausen" In-Reply-To: <20190731120705.GC24255@straasha.imrryr.org> Date: Wed, 31 Jul 2019 14:46:14 +0200 Cc: freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190731120705.GC24255@straasha.imrryr.org> To: Viktor Dukhovni X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 45zCpn2nC0z3J3q X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hausen@punkt.de designates 217.29.33.131 as permitted sender) smtp.mailfrom=hausen@punkt.de X-Spamd-Result: default: False [0.06 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.29.32.0/20]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[punkt.de]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mailin.pluspunkthosting.de,mailin.pluspunkthosting.de]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[131.33.29.217.list.dnswl.org : 127.0.10.0]; NEURAL_HAM_SHORT(-0.90)[-0.897,0]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:16188, ipnet:217.29.32.0/20, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.23)[ip: (-0.22), ipnet: 217.29.32.0/20(-0.52), asn: 16188(-0.42), country: DE(-0.01)] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 12:46:31 -0000 Hi! > Am 31.07.2019 um 14:07 schrieb Viktor Dukhovni : > Since a bunch of my traffic is SMTP, I need reverse resolution for > outgoing IPv6, which means that I need the outgoing sources address > to be ::1, not ::2, even though the > routing table lists "gif0" as the interface with the default route. >=20 > Is it possible to configure my system to use the internal /64 address > as the default source address of outgoing IPv6 packets? That is probably pretty easy depending on your preferred mail server. Make your mail server listen to ::1 only instead of :: It will then automatically accept connections on that address and use it for outbound, too, because it does not have a choice. Add IP4c and loopback of course. E.g. for Sendmail: = https://www.computing.net/answers/linux/sendmail-bind-to-ip-address/31045.= html HTH, Patrick --=20 punkt.de GmbH Internet - Dienstleistungen - Beratung Kaiserallee 13a Tel.: 0721 9109-0 Fax: -100 76133 Karlsruhe info@punkt.de http://punkt.de AG Mannheim 108285 Gf: Juergen Egeling From owner-freebsd-net@freebsd.org Wed Jul 31 12:50:29 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3911BDBAB for ; Wed, 31 Jul 2019 12:50:29 +0000 (UTC) (envelope-from ietf-dane@dukhovni.org) Received: from straasha.imrryr.org (straasha.imrryr.org [100.2.39.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zCvT40stz3J9s for ; Wed, 31 Jul 2019 12:50:29 +0000 (UTC) (envelope-from ietf-dane@dukhovni.org) Received: by straasha.imrryr.org (Postfix, from userid 1001) id EBCE047148; Wed, 31 Jul 2019 08:50:28 -0400 (EDT) Date: Wed, 31 Jul 2019 08:50:28 -0400 From: Viktor Dukhovni To: freebsd-net@freebsd.org Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? Message-ID: <20190731125028.GE24255@straasha.imrryr.org> Reply-To: freebsd-net@freebsd.org References: <20190731120726.GD24255@straasha.imrryr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190731120726.GD24255@straasha.imrryr.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 45zCvT40stz3J9s X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ietf-dane@dukhovni.org designates 100.2.39.101 as permitted sender) smtp.mailfrom=ietf-dane@dukhovni.org X-Spamd-Result: default: False [2.94 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[freebsd-net@freebsd.org]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:100.2.39.101]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dukhovni.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.57)[ip: (-5.79), ipnet: 100.2.0.0/16(-2.89), asn: 701(0.88), country: US(-0.05)]; RCVD_IN_DNSWL_MED(-0.20)[101.39.2.100.list.dnswl.org : 127.0.6.2]; MX_GOOD(-0.01)[cached: smtp.dukhovni.org]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:701, ipnet:100.2.0.0/16, country:US]; MIME_TRACE(0.00)[0:+]; REPLYTO_EQ_TO_ADDR(5.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 12:50:29 -0000 On Wed, Jul 31, 2019 at 08:07:26AM -0400, Viktor Dukhovni wrote: > HE provides me with two prefixes: > > 1. Point to point tunnel /128: > > cloned_interfaces="gif0" > create_args_gif0="tunnel " > ifconfig_gif0_ipv6="inet6 ::2 ::1 prefixlen 128" > ipv6_defaultrouter="::1" > > 2. A /64 for my network: > > ipv6_network_interfaces="igb1" > ifconfig_igb1_ipv6="inet6 ::1 prefixlen 64" > > Is it possible to configure my system to use the internal /64 address > as the default source address of outgoing IPv6 packets? After further manpage reading, it seems to work with: ifconfig_gif0_ipv6="inet6 ::2 ::1 prefixlen 128 no_prefer_iface" ifconfig_igb1_ipv6="inet6 ::1 prefixlen 64 prefer_source" ip6addrctl_policy="AUTO" and in /etc/ip6addrctl.conf: ... # Default IPv6 label is 1 # Use internal address as source for generic IPv6 destinations. ::/0 40 1 ::/64 40 1 ... Likely some of this is not needed, but not sure which. -- Viktor. From owner-freebsd-net@freebsd.org Wed Jul 31 12:56:14 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB3DCBDE15 for ; Wed, 31 Jul 2019 12:56:14 +0000 (UTC) (envelope-from artem@viklenko.net) Received: from alf.viklenko.net (alf.viklenko.net [IPv6:2001:470:71:d72::61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.viklenko.net", Issuer "Art&Co. CA Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zD254TdWz3JYn for ; Wed, 31 Jul 2019 12:56:13 +0000 (UTC) (envelope-from artem@viklenko.net) Received: from [10.0.31.12] (ua1.etadirect.net [91.198.140.16] (may be forged)) (authenticated bits=0) by alf.viklenko.net (8.15.2/8.15.2) with ESMTPSA id x6VCttTO081417 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Wed, 31 Jul 2019 15:55:59 +0300 (EEST) (envelope-from artem@viklenko.net) Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? To: Viktor Dukhovni , freebsd-net@freebsd.org References: <20190731120726.GD24255@straasha.imrryr.org> From: Artem Viklenko Organization: Art&Co. Message-ID: Date: Wed, 31 Jul 2019 15:55:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190731120726.GD24255@straasha.imrryr.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (alf.viklenko.net [192.168.32.61]); Wed, 31 Jul 2019 15:55:59 +0300 (EEST) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 12:56:14 -0000 Hi! You can set option "deprecated" at your gif0 interface. gif0: flags=8051 metric 0 mtu 1480 inet6 YYYY:YYY:YYY:YYY::2 --> YYYY:YYY:YYY::1 prefixlen 128 deprecated Works for me. On 31.07.19 15:07, Viktor Dukhovni wrote: > > My FreeBSD machine is also my router, and for lack IPv6 support by > Verizon, now uses a "gif" tunnel via Hurricane Electric. > > HE provides me with two prefixes: > > 1. Point to point tunnel /128: > > cloned_interfaces="gif0" > create_args_gif0="tunnel " > ifconfig_gif0_ipv6="inet6 ::2 ::1 prefixlen 128" > ipv6_defaultrouter="::1" > > 2. A /64 for my network: > > ipv6_network_interfaces="igb1" > ifconfig_igb1_ipv6="inet6 ::1 prefixlen 64" > > They support DNS reverse resolution delegation for "my-network" > (the /64), but not the point-to-point "tunnel-prefix" (the /128). > > Since a bunch of my traffic is SMTP, I need reverse resolution for > outgoing IPv6, which means that I need the outgoing sources address > to be ::1, not ::2, even though the > routing table lists "gif0" as the interface with the default route. > > Is it possible to configure my system to use the internal /64 address > as the default source address of outgoing IPv6 packets? > > If it would help, I can assign the "::1" address to the > external physical network interface (same one that has the tunnel > v4 address) or the loopback interface... RFC3484 section4 hints > at such possibilities (https://tools.ietf.org/html/rfc3484#page-9): > > It is RECOMMENDED that the candidate source addresses be the set of > unicast addresses assigned to the interface that will be used to send > to the destination. (The "outgoing" interface.) On routers, the > candidate set MAY include unicast addresses assigned to any interface > that forwards packets, subject to the restrictions described below. > > Discussion: The Neighbor Discovery Redirect mechanism [14] > requires that routers verify that the source address of a packet > identifies a neighbor before generating a Redirect, so it is > advantageous for hosts to choose source addresses assigned to the > outgoing interface. Implementations that wish to support the use > of global source addresses assigned to a loopback interface should > behave as if the loopback interface originates and forwards the > packet. > > Or could I assign an explicit non-global scope to the tunnel address? > Or ... (whatever works). Any help much appreciated. > -- Regards! From owner-freebsd-net@freebsd.org Wed Jul 31 12:57:24 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B6F3BDECE for ; Wed, 31 Jul 2019 12:57:24 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Received: from plan-b.pwste.edu.pl (plan-b.pwste.edu.pl [IPv6:2001:678:618::40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "plan-b.pwste.edu.pl", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zD3R6t63z3Jft for ; Wed, 31 Jul 2019 12:57:23 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Received: from fomalhaut.potoki.eu (static62133140050.ostnet.pl [62.133.140.50]) (authenticated bits=0) by plan-b.pwste.edu.pl (8.15.2/8.15.2) with ESMTPSA id x6VCv7tN089769 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 31 Jul 2019 14:57:07 +0200 (CEST) (envelope-from zarychtam@plan-b.pwste.edu.pl) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=plan-b.pwste.edu.pl; s=plan-b-mailer; t=1564577827; bh=ROkcl7YhgaC8S7VVd0VTeWGLVBLwOVOssJgCkyI7zy0=; h=To:References:From:Subject:Date:In-Reply-To; b=Ev8IezyQsNtXUcM/2sefhnUyKWDTkuWy1wb3BKYBzg3SaZmUwVRQjRz+vHVg8y1WC c+qD0S2l2vBUf5ddwHeLOyTEcSRF8YeaXntvna7bop+XjA5+j6Be93Xcj8kkDmPReV 34dB292a8zCEA+JWIEOI35wdz57XQVERNCbyTwu80yyYCal1AnNdsPe8myGTAud10n scsgcybahWPrucPjt6Mk2Dn42vkHdV9cJHIRhLcFl6tyv+ESMqpd/WgikKAsmWBsYb PkxChLMcnc+oHPiB6khZ8NEEkQ3tDJk+/D5e9HXBP7BEMSmE+ofyqZugzZ2JcRhVU2 RMX4AeeGHWPwQ== X-Authentication-Warning: plan-b.pwste.edu.pl: Host static62133140050.ostnet.pl [62.133.140.50] claimed to be fomalhaut.potoki.eu To: Viktor Dukhovni , freebsd-net@freebsd.org References: <20190731120705.GC24255@straasha.imrryr.org> From: Marek Zarychta Openpgp: preference=signencrypt Autocrypt: addr=zarychtam@plan-b.pwste.edu.pl; prefer-encrypt=mutual; keydata= mQENBFfi3cMBCADLecMTFXad4uDXqv3eRuB4qJJ8G9tzzFezeRnnwxOsPdytW5ES2z1ibSrR IsiImx6+PTqrAmXpTInxAi7yiZGdSiONRI4CCxKY9d1YFiNYT/2WyNXCekm9x29YeIU7x0JB Llbz0f/9HC+styBIu2H+PY/X98Clzm110CS+n/b9l1AtiGxTiVFj7/uavYAKxH6LNWnbkuc5 v8EVNc7NkEcl5h7Z9X5NEtzDxTOiBIFQ/kOT7LAtkYUPo1lqLeOM2DtWSXTXQgXl0zJI4iP1 OAu4qQYm2nXwq4b2AH9peknelvnt1mpfgDCGSKnhc26q6ibTfMwydp+tvUtQIQYpA6b9ABEB AAG0N01hcmVrIFphcnljaHRhIChQbGFuLWIpIDx6YXJ5Y2h0YW1AcGxhbi1iLnB3c3RlLmVk dS5wbD6JATcEEwEIACEFAlfi4LkCGwMFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQHZW8 vIFppoJXdgf8D9X3VRFSNaR9lthSx/+uqas17J3FJKBo1xMQsC2a+44vzNvYJSuPGLLJ+LW2 HPVazjP/BWZJbxOYpliY4zxNRU0YCp0BLIVLibc//yax+mE42FND/+NiIZhqJscl6MLPrSwo sIwXec4XYkldkyqW/xBbBYXoIkBqdKB9j5j42Npy1IV/RizOSdmvTWY27ir8e/yGMR1RLr4F 8P5K3OWTdlGy2H2F/3J8bIPBLG6FpaIyLQw4dHSx8V02PYqDxK1cNo2kAOnU8PnZL/AGuMOH iv3MN1VYL8ehcmpBBsrZGebQJxrjY2/5IaTSgp9xHYT70kshuU6Qb97vk1mOjNZxgbkBDQRX 4t3DAQgA10h6RCXuBLMHxq5B8X/ZIlj9sgLoeyfRdDZEc9rT2KUeUJVHDsbvOFf4/7F1ovWY hJbA6GK/LUZeHHTjnbZcH1uDYQeHly4UOLxeEvhGoz4JhS2C7JzN/uRnwbdOAUbJr8rUj/IY a7gk906rktsc/Ldrxrxh7O6WO0JCh2XO/p4pDfEwwB37g4xHprSab28ECYJ9JMbtA8Sy4M55 g3+GQ28FvSlGnx48OoGXU2BZdc1vZKSQmNOlikB+9/hDX8zdYWVfDaX1TLQ8Ib4+xTUmapza mV/bxIsaZRBw+jFjLQHhTbIMfPEU+4mxFDvTdbKPruKPqVf1ydgMnPZWngowdwARAQABiQEf BBgBCAAJBQJX4t3DAhsMAAoJEB2VvLyBaaaC6qkIAJs9sDPqrqW0bYoRfzY6XjDWQ59p9tJi v8aogxacQNCfAu+WkJ8PNVUtC1dlVcG5NnZ80gXzd1rc8ueIvXlvdanUt/jZd8jbb3gaDbK3 wh1yMCGBl/1fOJTyEGYv1CRojv97KK89KP5+r8x1P1iHcSrunlDNqGxTMydNCwBH23QcOM+m u4spKnJ/s0VRBkw3xoKBZfZza6fTQ4gTpAipjyk7ldOGBV+PvkKATdhK2yLwuWXhKbg/GRlD 1r5P0gxzSqfV4My+KJuc2EDcrqp1y0wOpE1m9iZqCcd0fup5f7HDsYlLWshr7NQl28f6+fQb sylq/j672BHXsdeqf/Ip9V65AQ0EV+OTdwEIAMxnGg7OO/ZAnSwiIiABA9lil1Lfa5BWTH3c l1rz4slz7Gw99G9J3bX3FiPA0vU89dgBZ2k0/UVk5cI5EsMAvwJN4bPwRsfBELQqjCKkVZr4 vUeGyvgQ2jnoK1fcEFOnCRdwFy4EJ6Y/fsZCTj4IfQpkM1W7C3KuSGPcjPDA9XCLDjjp8bbA Q9VgQ68MntAnYxMqK0S3CrHp5Pruvb0x4MfFLNwaKtWK+UnJGPT4umj8PMP6XLsFC3g+SGoP aWoYRDI297ZGx4IBWEaJq181oEC5iUQ6WREti9fNQ3TsAB3Q2CjNlkx1geSczIFJSyOHmyJZ RqAocw1sIuPopvhWtR0AEQEAAYkCRAQYAQgADwUCV+OTdwIbAgUJCWYBgAEpCRAdlby8gWmm gsBdIAQZAQgABgUCV+OTdwAKCRB1n+z//VKNLOETCAC3ggwAAQij4hkIxQFapnRuIVb5vq7D AwJ9+Ld5/zYHOj2Tfu+BPSNGzI2edqboz2w1t55UHEYzYDp2axxIfPrZrXsBV4DsjtGwzVV/ jZ9or5qTaYFDEStRkzL4mRpTyYhl/T7GgWpwOJWOih+cU7RWzjSOxiYMi4QSYlkpDUCcZew0 C3HfcxeFqpeL46zgysHC2ptjINXQ+xR2/F6dbed+l7OsvJAfkBqJoQ/48m+8ly1lbViKck7q gWw143ljaKn2qGIjZdb95zcI/CP4L45SXq8NOweACdx2NfUphLrIMbNCqLkMUJcrnruKfbnp C8OMjFJIqlu+PsW593NcZyOugEAH/0cBsDxlSauSVK4kp8ald26pcBI6igNnIMgjaxMiZBjn eoxBiKAOAO93sPnPr9/64CMMwv1T+0vU2lj8SMKOdHVrB9sW/ICGji5skE85xPEAtUkdAQN+ +c2clotujcaj9lBZKJdncKmSxY0SshEa66H+s76u+2Q3jGK6vOrdxakWYCvh2P0/l52Nd/t2 eazLFgwtk5rbo7O0MSC1GNXUsG07vtZ+zxJXFRx7PQ3ZIn0Y4HqwvXUvqgZ9EHiKy8F+ondz 9IS8/Fs81N5ieujHhSWqbaibapnpeDHvT/FWf8iXfJqWq+F7C8lGShSkmsS5AOhB4TNNH5/m ZzECJa1ql64= Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? Message-ID: <228a86f5-8c93-be6e-3847-896c89d430dc@plan-b.pwste.edu.pl> Date: Wed, 31 Jul 2019 14:57:01 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190731120705.GC24255@straasha.imrryr.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PczUBOGNFEvpyi4slqFcTrTGqNOq9OAnS" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 12:57:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PczUBOGNFEvpyi4slqFcTrTGqNOq9OAnS Content-Type: multipart/mixed; boundary="w8hs3posPVBiwINpQHyBwh6igtE8MSeJn"; protected-headers="v1" From: Marek Zarychta To: Viktor Dukhovni , freebsd-net@freebsd.org Message-ID: <228a86f5-8c93-be6e-3847-896c89d430dc@plan-b.pwste.edu.pl> Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? References: <20190731120705.GC24255@straasha.imrryr.org> In-Reply-To: <20190731120705.GC24255@straasha.imrryr.org> --w8hs3posPVBiwINpQHyBwh6igtE8MSeJn Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable W dniu 31.07.2019 o=C2=A014:07, Viktor Dukhovni pisze: >=20 > My FreeBSD machine is also my router, and for lack IPv6 support by > Verizon, now uses a "gif" tunnel via Hurricane Electric. >=20 > HE provides me with two prefixes: >=20 > 1. Point to point tunnel /128: >=20 > cloned_interfaces=3D"gif0" > create_args_gif0=3D"tunnel " > ifconfig_gif0_ipv6=3D"inet6 ::2 ::1 pref= ixlen 128" > ipv6_defaultrouter=3D"::1" >=20 > 2. A /64 for my network: >=20 > ipv6_network_interfaces=3D"igb1" > ifconfig_igb1_ipv6=3D"inet6 ::1 prefixlen 64" >=20 > They support DNS reverse resolution delegation for "my-network" > (the /64), but not the point-to-point "tunnel-prefix" (the /128). >=20 > Since a bunch of my traffic is SMTP, I need reverse resolution for > outgoing IPv6, which means that I need the outgoing sources address > to be ::1, not ::2, even though the > routing table lists "gif0" as the interface with the default route. >=20 > Is it possible to configure my system to use the internal /64 address > as the default source address of outgoing IPv6 packets? >=20 > If it would help, I can assign the "::1" address to the > external physical network interface (same one that has the tunnel > v4 address) or the loopback interface... RFC3484 section4 hints > at such possibilities (https://tools.ietf.org/html/rfc3484#page-9): >=20 > It is RECOMMENDED that the candidate source addresses be the set of > unicast addresses assigned to the interface that will be used to sen= d > to the destination. (The "outgoing" interface.) On routers, the > candidate set MAY include unicast addresses assigned to any interfac= e > that forwards packets, subject to the restrictions described below. >=20 > Discussion: The Neighbor Discovery Redirect mechanism [14] > requires that routers verify that the source address of a packet > identifies a neighbor before generating a Redirect, so it is > advantageous for hosts to choose source addresses assigned to the= > outgoing interface. Implementations that wish to support the use= > of global source addresses assigned to a loopback interface shoul= d > behave as if the loopback interface originates and forwards the > packet. >=20 > Or could I assign an explicit non-global scope to the tunnel address? > Or ... (whatever works). Any help much appreciated. >=20 Setting source address for MTA will be sufficient in this case. For example Sendmail requires ClientPortOptions to be set in .mc config file:= CLIENT_OPTIONS(`Family=3Dinet6, Addr=3D::1') --=20 Marek Zarychta --w8hs3posPVBiwINpQHyBwh6igtE8MSeJn-- --PczUBOGNFEvpyi4slqFcTrTGqNOq9OAnS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEMOqvKm6wKvS1/ZeCdZ/s//1SjSwFAl1BkCMACgkQdZ/s//1S jSwxMAgAqIEAH+7Ggtzbd66G5RYHDqBYH9CfdXb/wYVKjAeChyo8To6Afe7WqCVe cc0k1wjPCqk3P19s6hM47kp8/DRy+jM+MnpmLl6NgLbGVBf1/SqsbR3q7MuS++6Q doHdLgCGtspEBACwWQ3J6jQ1SiRVdt1iN1ncsz1vgGUJ5JFaXAf0St8NpLxyWaSK 81pRwNAX049A01bknwXDOIh/XH8CEhsl13lmv31O52093onz3LzwkPVFaq4jUfe1 pOIn8go/zN1TfsjmFzKY4GitScyFz/7YU0U5ZMDRbIH3CTTtS9FH7oFYw8A02c5i HZ5AKKVU0z5MgQK3vBtpXlIau/Wd2g== =xeAT -----END PGP SIGNATURE----- --PczUBOGNFEvpyi4slqFcTrTGqNOq9OAnS-- From owner-freebsd-net@freebsd.org Wed Jul 31 13:03:20 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D266BE213 for ; Wed, 31 Jul 2019 13:03:20 +0000 (UTC) (envelope-from ietf-dane@dukhovni.org) Received: from straasha.imrryr.org (straasha.imrryr.org [100.2.39.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zDBH5Bmdz3KF8 for ; Wed, 31 Jul 2019 13:03:19 +0000 (UTC) (envelope-from ietf-dane@dukhovni.org) Received: by straasha.imrryr.org (Postfix, from userid 1001) id 9093247160; Wed, 31 Jul 2019 08:57:04 -0400 (EDT) Date: Wed, 31 Jul 2019 08:57:04 -0400 From: Viktor Dukhovni To: freebsd-net@freebsd.org Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? Message-ID: <20190731125704.GF24255@straasha.imrryr.org> Reply-To: freebsd-net@freebsd.org References: <20190731120705.GC24255@straasha.imrryr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 45zDBH5Bmdz3KF8 X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ietf-dane@dukhovni.org designates 100.2.39.101 as permitted sender) smtp.mailfrom=ietf-dane@dukhovni.org X-Spamd-Result: default: False [3.16 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[freebsd-net@freebsd.org]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:100.2.39.101:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dukhovni.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.36)[ip: (-5.07), ipnet: 100.2.0.0/16(-2.54), asn: 701(0.88), country: US(-0.05)]; RCVD_IN_DNSWL_MED(-0.20)[101.39.2.100.list.dnswl.org : 127.0.6.2]; MX_GOOD(-0.01)[cached: smtp.dukhovni.org]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:701, ipnet:100.2.0.0/16, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; GREYLIST(0.00)[pass,body]; REPLYTO_EQ_TO_ADDR(5.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 13:03:20 -0000 On Wed, Jul 31, 2019 at 02:46:14PM +0200, Patrick M. Hausen wrote: > > Is it possible to configure my system to use the internal /64 address > > as the default source address of outgoing IPv6 packets? > > That is probably pretty easy depending on your preferred mail server. > Make your mail server listen to ::1 only instead of :: Many thanks, but I was looking for the network stack to do this automatically (and seem to have found a way, if perhaps over-specified). I don't just use Postfix (for which I do know how to specify the outbound IPv6 address. :-). I also have various tools related to the DANE/DNSSEC survey which have not to date needed knobs to specify the outbound IPv6 address... > It will then automatically accept connections on that address and use > it for outbound, too, because it does not have a choice. Actually, with Postfix, the listening address is indepdent of the IP address for outgoing active (me as SMTP client) connections. Both are of course configurable, the listener in master.cf, or else via "inet_interfaces", and the SMTP client via smtp_bind_address{,6}, (defaults to inet_interfaces if non-loopback singleton). -- Viktor. From owner-freebsd-net@freebsd.org Wed Jul 31 13:48:19 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACE6EBEFAB for ; Wed, 31 Jul 2019 13:48:19 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::606]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zFB866kqz3M7P for ; Wed, 31 Jul 2019 13:48:16 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 440A25F82525; Wed, 31 Jul 2019 16:48:12 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback4o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NZAZr3BshH-mBPu3Wvc; Wed, 31 Jul 2019 16:48:12 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1564580892; bh=Il644n1WR2ZIQihj7UHlydX927iseB3Xlp24Ifaxj4k=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=nHGhwsWIiklekNp0uieVWaazNYWCbGIavlIz5OeuKvkxom2z3Y5UllqRe7GYxW6hv X5VspZsdsUZJ/32y6VQLAaJVARCSl7HWs1BN1Yr7Ug25FGVdqIY41V/WtgGUMVwuIH RGeHydw0p1Wc88+0nYe4hTct59+Alum1cZV0xBLk= Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Z8unrFXFdt-mBsm5vmL; Wed, 31 Jul 2019 16:48:11 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? To: freebsd-net@freebsd.org, Viktor Dukhovni References: <20190731120726.GD24255@straasha.imrryr.org> <20190731125028.GE24255@straasha.imrryr.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <9763ff43-cace-6acf-ef27-0964e2594ad7@yandex.ru> Date: Wed, 31 Jul 2019 16:45:20 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190731125028.GE24255@straasha.imrryr.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="D6EJ6aqfIPdXZo2Ffz0amhbIrRTlnpbpL" X-Rspamd-Queue-Id: 45zFB866kqz3M7P X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=nHGhwsWI; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of bu7cher@yandex.ru designates 2a02:6b8:0:1a2d::606 as permitted sender) smtp.mailfrom=bu7cher@yandex.ru X-Spamd-Result: default: False [-4.19 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yandex.ru]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1000::/52]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yandex.ru:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; MX_GOOD(-0.01)[mx.yandex.ru,mx.yandex.ru,mx.yandex.ru,mx.yandex.ru,mx.yandex.ru]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; RCVD_IN_DNSWL_LOW(-0.10)[6.0.6.0.0.0.0.0.0.0.0.0.0.0.0.0.d.2.a.1.0.0.0.0.8.b.6.0.2.0.a.2.list.dnswl.org : 127.0.5.1]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; RCVD_TLS_LAST(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[yandex.ru.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-9.60), ipnet: 2a02:6b8::/32(-4.64), asn: 13238(-3.74), country: RU(0.01)] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 13:48:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --D6EJ6aqfIPdXZo2Ffz0amhbIrRTlnpbpL Content-Type: multipart/mixed; boundary="wAbGSMWZRMcvNcYpzFexzeX3ZRYr2JI59"; protected-headers="v1" From: "Andrey V. Elsukov" To: freebsd-net@freebsd.org, Viktor Dukhovni Message-ID: <9763ff43-cace-6acf-ef27-0964e2594ad7@yandex.ru> Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? References: <20190731120726.GD24255@straasha.imrryr.org> <20190731125028.GE24255@straasha.imrryr.org> In-Reply-To: <20190731125028.GE24255@straasha.imrryr.org> --wAbGSMWZRMcvNcYpzFexzeX3ZRYr2JI59 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 31.07.2019 15:50, Viktor Dukhovni wrote: > After further manpage reading, it seems to work with: >=20 > ifconfig_gif0_ipv6=3D"inet6 ::2 ::1 p= refixlen 128 no_prefer_iface" > ifconfig_igb1_ipv6=3D"inet6 ::1 prefixlen 64 prefer_sou= rce" > ip6addrctl_policy=3D"AUTO" Yes, in general this should help. "no_prefer_iface" will lead to ignoring of "Rule 5: Prefer outgoing interface", and then address with "prefer_source" flag will be chosen in "Rule 10: prefer address with `prefer_source' flag" before "Rule 14: Use longest matching prefix". --=20 WBR, Andrey V. Elsukov --wAbGSMWZRMcvNcYpzFexzeX3ZRYr2JI59-- --D6EJ6aqfIPdXZo2Ffz0amhbIrRTlnpbpL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAl1Bm3QACgkQAcXqBBDI oXoSQggAoXuGOd64Xx7mdAmMxVQtUGMt8C/6uFIfshNu8fIpwRCQ/yQNBaOSX3wv +Jy6P1SgGE0Eg8ZantrsJDKtMIoehBbbZC9BO5Lxf2PqC79ig0Y0lY75Ml/FiQux CcWlcwPpxoKjlmBlfb4UsoXbBwG14Bj2wASv9W2jn7JP+N8JxAI9pw9NnaEWlDXV 8DCNjCyHW9urDoSYcRn2q8b+EzihjIxbUKy1L+pxosSy2E6KdFHIwIfUOsqT0XWw pk8FT74eK0bvo7iSTzNWUPbg+/uTp4DnQmpekFPd/FoB9PIzzNGl5sZqhc1mZ8S5 BU3mc5aNVQGsSGQnPl0yO4h/HW3l7g== =yiFe -----END PGP SIGNATURE----- --D6EJ6aqfIPdXZo2Ffz0amhbIrRTlnpbpL-- From owner-freebsd-net@freebsd.org Wed Jul 31 19:38:40 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50ED1A6B7F for ; Wed, 31 Jul 2019 19:38:40 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 45zNyL3VVRz4FSJ for ; Wed, 31 Jul 2019 19:38:34 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yv.noip.me (c-67-180-169-236.hsd1.ca.comcast.net [67.180.169.236]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id x6VJcWOp021616 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 31 Jul 2019 12:38:32 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-67-180-169-236.hsd1.ca.comcast.net [67.180.169.236] claimed to be yv.noip.me To: "freebsd-net@freebsd.org" From: Yuri Subject: ipfw questions: how to forward incoming TCP connections from the same host? Message-ID: <16dd8ba4-26e4-928b-c448-8294d13ece02@rawbw.com> Date: Wed, 31 Jul 2019 12:38:31 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 45zNyL3VVRz4FSJ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of yuri@rawbw.com designates 198.144.192.42 as permitted sender) smtp.mailfrom=yuri@rawbw.com X-Spamd-Result: default: False [-2.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[236.169.180.67.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:198.144.192.32/27]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; MX_GOOD(-0.01)[mx.rawbw.net]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; RCVD_IN_DNSWL_NONE(0.00)[42.192.144.198.list.dnswl.org : 127.0.10.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; IP_SCORE(-2.54)[ip: (-5.82), ipnet: 198.144.192.0/20(-3.13), asn: 7961(-3.73), country: US(-0.05)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:7961, ipnet:198.144.192.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_NA(0.00)[rawbw.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 19:38:40 -0000 I need to forward incoming TCP connections made to my host 192.168.5.3 on the port 3100 to the IP address 10.0.0.101 port 3000 connected through another interface. These rules work when connection is made from a remote host: ipfw -q nat 19001 config redirect_port tcp 10.0.0.101:3000 192.168.5.3:3100 ipfw -q add 19001 nat 19001 tcp from any to 192.168.5.3 3100 in recv sk0 ipfw -q add 19001 nat 19001 tcp from 10.0.0.101 3000 to any out xmit sk0 Question#1: How to allow connections from the same host to be forwarded the same way? Connections from the host's LAN IP address pass through lo0, but this rule doesn't work when added: ipfw -q add 19001 nat 19001 tcp from 192.168.5.3 to 192.168.5.3 3100 in recv lo0 Wireshark shows that the incoming connection is from 192.168.5.3 to 192.168.5.3 on 3100 but it gets immediately rejected instead of being forwarded. This rule looks very similar to the second rule above, just the interface is different. Why doesn't it work? Question#2: When lo0 is added to the third rule above it stops working for the return traffic: ipfw -q add 19001 nat 19001 tcp from 10.0.0.101 3000 to any out xmit sk0 xmit lo0 Just adding "xmit lo0" makes it to fail for sk0 too. When several interfaces are present in the rule, doesn't this mean that it should apply to all of them? Perhaps multiple interfaces can only be used in recv/xmit combination? Why does this command accept two xmit clauses then? Thank you, Yuri From owner-freebsd-net@freebsd.org Wed Jul 31 20:36:22 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B71B5A81B3 for ; Wed, 31 Jul 2019 20:36:22 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 45zQF15rmSz4KNJ for ; Wed, 31 Jul 2019 20:36:21 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: by mail-io1-xd2c.google.com with SMTP id z3so20405487iog.0 for ; Wed, 31 Jul 2019 13:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xMBLRe5eJPBFPo7Equ+uy7GHi+Jvz3m2aRYYiZ1k6LE=; b=jyPUlGIT19ky7P7mIMlhwLGoTNB3E1+FsDbYGv8b4rgCEk+sghzAAvT0BlTJz1sdAc XctiQWIUc2T7m9CcMN85zQrmlq2w40zcPF7JDTN9of6EGCu8AaER3VYLIW6TVlVxIhVm yBj1GUR3RUVrS/+dwxJJmqEHAv5wLZjcq1b+wlm7pBafg15jmHjCbQCQiSWRQeTmAFTD krqPNQpMiqujHTmWiNQibdBmZnsR09s0vJd8BNLNY5cXedvi7Y3NUdpdgLgfMl9Edug4 3vS1ocyiW3wle+GJZT/HWk3stFW5iah38v5HThK0GlwVC6Em48ltzwGjDt5iUZxwsGlW p9/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xMBLRe5eJPBFPo7Equ+uy7GHi+Jvz3m2aRYYiZ1k6LE=; b=GiaHoaJaTYwvXLsJIYebdasSweeylry7Yv9cmgbQRvlW0Jxw1VDt1AJ8zHZU/2t385 xuBL9+jisRkp9tCFXfxkPjOvXLzLGD8S9v78rH2T+P2ZvybjPDZ73oJkOpV6UZY5WndM XeTTaA/sRJeJYrksRQ5NgC4588dSY6v6cykPLlVSuouX7xAdCYp4OlUKbL9bCISnDRPV 0peEo20oHqC4CI11T3syNvLjF8AEbL0Q70KVBP44WlJVeqVcIpFY7CGo2mR0abZUOnwO ZuZlFy3XJNC3sfUEFTx/3Y9mHDupjwXPQNw5FY4SZyDH4X8Z2M7QZ7vVmxg/BIquHSjg +PmQ== X-Gm-Message-State: APjAAAVJU6ewpDO3j3waEnxn3RgPbtzf6OjoYpaNUqJkDvnbOtE7EG7L EWj4H4TMwaleXGDt3KHwDyeotENKyGa491kjcJsk7Vx/ X-Google-Smtp-Source: APXvYqzrqUOJxdJxd3DKZki0946K1d51lUv9GIWrlwXXKL50s+LE6bIQdmFzC7orXz8s0efgUg9lUDoKISqjct5kIkw= X-Received: by 2002:a5d:83cd:: with SMTP id u13mr110297406ior.297.1564605380341; Wed, 31 Jul 2019 13:36:20 -0700 (PDT) MIME-Version: 1.0 From: Dheeraj Kandula Date: Wed, 31 Jul 2019 16:36:08 -0400 Message-ID: Subject: Socket Sleep and Wakeup clarification To: freebsd-net@freebsd.org X-Rspamd-Queue-Id: 45zQF15rmSz4KNJ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=jyPUlGIT; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dkandula@gmail.com designates 2607:f8b0:4864:20::d2c as permitted sender) smtp.mailfrom=dkandula@gmail.com X-Spamd-Result: default: False [-1.96 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; TO_DN_NONE(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.00)[ip: (-5.12), ipnet: 2607:f8b0::/32(-3.09), asn: 15169(-2.45), country: US(-0.05)]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[c.2.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2019 20:36:22 -0000 Hi All, I am reading through the socket code in uipc_socket.c file of FreeBSD 12. The code invokes wakeup with the channel as so->so_timeo in the following functions: soisconnected soisdisconnected soisdisconnecting and soshutdown The callers of soconnect invoke sleep so that the thread that invokes soconnect wakes up when the TCP 3 way handshake is done. The soconnect in kernel returns immediately unlike user space connect which sleeps. I also see tsleep in soclose when the socket's state is SS_ISCONNECTED. My questions: 1. Is it possible to close a socket when the application is sleeping after the application invokes soconnect. Basically I am trying to figure out how multiple threads can access the same socket for soconnect and soclose to happen at the same time. 2. soshutdown also invokes wakeup. This wakeup again corresponds to the sleep by soconnect. Isn't it? How can we have two threads accessing the same socket with one thread sleeping on a socket for the soconnect, while another shuts down the same socket in either the RD or WR or RW direction. Dheeraj From owner-freebsd-net@freebsd.org Thu Aug 1 13:43:36 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AECABE23F for ; Thu, 1 Aug 2019 13:43:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 45zs2J1ksfz4fJC for ; Thu, 1 Aug 2019 13:43:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 39BFDBE23E; Thu, 1 Aug 2019 13:43:36 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39857BE23C for ; Thu, 1 Aug 2019 13:43:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zs2J0p1Fz4fJB for ; Thu, 1 Aug 2019 13:43:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F14B81B239 for ; Thu, 1 Aug 2019 13:43:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x71DhZXo091100 for ; Thu, 1 Aug 2019 13:43:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x71DhZ07091097 for net@FreeBSD.org; Thu, 1 Aug 2019 13:43:35 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 184141] [ppp] [patch] Kernel PPPoE sends bad echo-req magic number on big endian machines Date: Thu, 01 Aug 2019 13:43:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: sparc64 X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: emaste@freebsd.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Rspamd-Queue-Id: 45zs2J1ksfz4fJC X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.71 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.63)[-0.633,0]; NEURAL_HAM_SHORT(-0.08)[-0.080,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 13:43:36 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D184141 --- Comment #7 from commit-hook@freebsd.org --- A commit references this bug: Author: emaste Date: Thu Aug 1 13:42:59 UTC 2019 New revision: 350497 URL: https://svnweb.freebsd.org/changeset/base/350497 Log: ppp: correct echo-req magic number on big endian archs The magic number is a 32-bit quantity; use uint32_t to match hton's return type and avoid sending zeros (upper 32 bits) on big-endian architectures. PR: 184141 MFC after: 1 week Sponsored by: The FreeBSD Foundation Changes: head/sys/net/if_spppsubr.c --=20 You are receiving this mail because: You are on the CC list for the bug.= From owner-freebsd-net@freebsd.org Thu Aug 1 18:01:50 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4166C41A7 for ; Thu, 1 Aug 2019 18:01:50 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail.allbsd.org (mx.allbsd.org [IPv6:2001:2f0:104:e001::41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45zymC5d4Hz41hs for ; Thu, 1 Aug 2019 18:01:47 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:4700:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id x71I16H9012377 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) (Client CN "/CN=mail-d.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=Let's+20Encrypt+20Authority+20X3"); Fri, 2 Aug 2019 03:01:19 +0900 (JST) (envelope-from hrs@allbsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=allbsd.org; s=20190220; t=1564682494; bh=BA2x2wsxLHEEodGWYa/rroqu6hrBGyqI3IDxeCqVrNU=; h=Date:To:Cc:Subject:From:In-Reply-To:References; b=Zyvj9px8NNGeaJKAMj39i8Ts/F1/tSGwR3q4oLj8vsXDvTDwc7vuGx/CgtJDgiJ9K XQc8M92nfMxW4undq19dubX/G7mbe9kCm+1S59/xRTjCM8ZP0x3DTFimlWNDr7sNPc g2W9Na7M8PUZFPTEeS+zxul/JN4CRg0HH6japwXc= Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:4700:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id x71I11V4062536 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 2 Aug 2019 03:01:01 +0900 (JST) (envelope-from hrs@allbsd.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id x71I0xQI062405; Fri, 2 Aug 2019 03:01:01 +0900 (JST) (envelope-from hrs@allbsd.org) Date: Fri, 02 Aug 2019 03:00:53 +0900 (JST) Message-Id: <20190802.030053.435733628684510322.hrs@allbsd.org> To: viktor@dukhovni.org Cc: freebsd-net@freebsd.org Subject: Re: Preferring internal IPv6 source address over gif tunnel IP? From: Hiroki Sato In-Reply-To: <20190731120705.GC24255@straasha.imrryr.org> References: <20190731120705.GC24255@straasha.imrryr.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Fri_Aug__2_03_00_53_2019_115)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Fri, 02 Aug 2019 03:01:27 +0900 (JST) X-Spam-Status: No, score=4.7 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1, RCVD_IN_AHBL,RCVD_IN_AHBL_PROXY,RCVD_IN_AHBL_SPAM,RDNS_NONE, UNPARSEABLE_RELAY,URIBL_SC2_SURBL,URIBL_XS_SURBL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx.allbsd.org X-Rspamd-Queue-Id: 45zymC5d4Hz41hs X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=allbsd.org header.s=20190220 header.b=Zyvj9px8; dmarc=none; spf=pass (mx1.freebsd.org: domain of hrs@allbsd.org designates 2001:2f0:104:e001::41 as permitted sender) smtp.mailfrom=hrs@allbsd.org X-Spamd-Result: default: False [1.66 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[allbsd.org:s=20190220]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[allbsd.org]; NEURAL_SPAM_SHORT(0.99)[0.993,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[allbsd.org:+]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:7514, ipnet:2001:2f0::/32, country:JP]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(0.77)[asn: 7514(3.89), country: JP(-0.03)] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 18:01:50 -0000 ----Security_Multipart(Fri_Aug__2_03_00_53_2019_115)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Viktor Dukhovni wrote in <20190731120705.GC24255@straasha.imrryr.org>: vi> 1. Point to point tunnel /128: vi> vi> cloned_interfaces="gif0" vi> create_args_gif0="tunnel " vi> ifconfig_gif0_ipv6="inet6 ::2 ::1 prefixlen 128" vi> ipv6_defaultrouter="::1" You do not need to use ifconfig_gif0_ipv6 for a point-to-point configuration with . The following configuration should do the trick while this is different from suggested one from he.net: cloned_interfaces="gif0" create_args_gif0="tunnel " ifconfig_gif0_ipv6="inet6 auto_linklocal" ipv6_defaultrouter="-interface gif0" Using this configuration, your source IPv6 address will be that on igb1. And if you have two or more physical interfaces you can define ip6addrctl.conf to control which address is used for the source address depending on the destination address. -- Hiroki ----Security_Multipart(Fri_Aug__2_03_00_53_2019_115)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAl1DKNUACgkQTyzT2CeTzy0HfgCdF+niasXw35fCE2svw+SmPjvs DGcAn0VefsDd7hiedp7Z0TNddXBXk+hc =GbEW -----END PGP SIGNATURE----- ----Security_Multipart(Fri_Aug__2_03_00_53_2019_115)---- From owner-freebsd-net@freebsd.org Thu Aug 1 20:06:48 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42FCAC7EE6 for ; Thu, 1 Aug 2019 20:06:48 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 4601XR3fnxz4DCG for ; Thu, 1 Aug 2019 20:06:47 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: by mail-io1-xd29.google.com with SMTP id g20so147147127ioc.12 for ; Thu, 01 Aug 2019 13:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rzNvKxTrRZYbbcqRITzMe0L4dvuH0nT5SJoN2JkDSpo=; b=kZoiONMxthA5Qn4H+hY5/ansD9YoUu/pH7hJW9fyzt8Glzzjyit3ymL/iVFZJsoiKA gD5TUNe1Y4DhHK9BK0x7opgGM6iXSdxhApDZMq8/TYYX5rM6KsnpgvSyB6s6QW10DuwW 3nYxqYM/ekNVMXMFiPzQLZLFcrueFM5gIoi/88vho/tp8QruSEVeAqpTDKOPUvKGPdx2 RjkVog4Zdw3x7jp9g2iytApxz63x7ccZfmF/EFFRmmwtlKLKyUlu0MgAY4LhuwIiG+LR t0HfXcdcPU8Irm71Ff6XvbckgTeiPXSY71h/KQUN0AI16SS9EZa33f83aU/anUHbkuhP KtLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rzNvKxTrRZYbbcqRITzMe0L4dvuH0nT5SJoN2JkDSpo=; b=LvXW35V9BDxVIgQP0Z6JLkLsPmkUKMdBY56N9N0YLAsL2id+yG7R8T8r4lBOvXi+dZ KjPbPMKKoH0OMGu0Qn5PivgRZaLnpr5kWsupoIl7YTr9koqc5zxiZY47Blonr0w9+Fml 0//yaSXKwQc7yt5nTuKMKq7hCVisrlb8HDewec4qy5xnb3jKyt6oGUEK3Tz+8KmXvadk C3nPYbYaG3axJpyCrgqV+HWpNX9Mi56xm95bLO18MnvMJYaPPjKKLCQ+myzH+ijINO1j B6p4H7D79rZvkuXLAF/zYAJWGMrjLq0TOGTZ5QeL+KnzoSkxod3G+nb6aY67mNsxboUK /hbw== X-Gm-Message-State: APjAAAV1/EZEvPL5XY7ZEXCezNlJqDwpgLeS737bZPKMCVATq97tYV0q rLc+zQNDEfpDxwANBhpLq0tV3H+K/qH7vJOOenBud25X X-Google-Smtp-Source: APXvYqxSyl3WJSIdhkBYrRA6quoLdb2OCY2wzu3n3BdROj7sNUUwc0WsmTRJ+s7TRDuggmt7mIcV2TPqsPsKISt3e50= X-Received: by 2002:a5d:9f07:: with SMTP id q7mr47309953iot.21.1564690005522; Thu, 01 Aug 2019 13:06:45 -0700 (PDT) MIME-Version: 1.0 From: Dheeraj Kandula Date: Thu, 1 Aug 2019 16:06:34 -0400 Message-ID: Subject: sol_upcall in FreeBSD 12 To: freebsd-net@freebsd.org X-Rspamd-Queue-Id: 4601XR3fnxz4DCG X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=kZoiONMx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dkandula@gmail.com designates 2607:f8b0:4864:20::d29 as permitted sender) smtp.mailfrom=dkandula@gmail.com X-Spamd-Result: default: False [-1.99 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; TO_DN_NONE(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.00)[ip: (-4.39), ipnet: 2607:f8b0::/32(-3.09), asn: 15169(-2.46), country: US(-0.05)]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[9.2.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 20:06:48 -0000 When going through the code of FreeBSD12, I see that the socket code has undergone significant change. The socket is now either a regular socket or a listen socket. The listen socket has two new fields besides others: sol_upcall and sol_upcallarg My understanding is that this callback will be used to notify the accept socket's consumers when the 3 way handshake is completed and the socket is ready to be accepted. However in soisconnected function, when the accept filter is set, the code still sets the receive socket buffer's upcall. Shouldn't we set the sol_upcall in line 3773 below instead. If not, when should the sol_upcall be set. An example will help clarify the usage. 3762 again: 3763 if ((so->so_options & SO_ACCEPTFILTER) == 0) { 3764 TAILQ_REMOVE(&head->sol_incomp, so, so_list); 3765 head->sol_incqlen--; 3766 TAILQ_INSERT_TAIL(&head->sol_comp, so, so_list); 3767 head->sol_qlen++; 3768 so->so_qstate = SQ_COMP; 3769 SOCK_UNLOCK(so); 3770 solisten_wakeup(head); /* unlocks */ 3771 } else { 3772 SOCKBUF_LOCK(&so->so_rcv); 3773 soupcall_set(so, SO_RCV, 3774 head->sol_accept_filter->accf_callback, 3775 head->sol_accept_filter_arg); 3776 so->so_options &= ~SO_ACCEPTFILTER; 3777 ret = head->sol_accept_filter->accf_callback(so, 3778 head->sol_accept_filter_arg, M_NOWAIT); 3779 if (ret == SU_ISCONNECTED) { 3780 soupcall_clear(so, SO_RCV); 3781 SOCKBUF_UNLOCK(&so->so_rcv); 3782 goto again; 3783 } 3784 SOCKBUF_UNLOCK(&so->so_rcv); 3785 SOCK_UNLOCK(so); 3786 SOLISTEN_UNLOCK(head); 3787 } Dheeraj From owner-freebsd-net@freebsd.org Sat Aug 3 12:30:05 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C2D0B0790 for ; Sat, 3 Aug 2019 12:30:05 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 4613JW4tXlz4GcW; Sat, 3 Aug 2019 12:30:03 +0000 (UTC) (envelope-from sucanjan@gmail.com) Received: by mail-wr1-x42c.google.com with SMTP id n4so79961400wrs.3; Sat, 03 Aug 2019 05:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=PiGZScSGvGJ8tG+ZijzQsGI+zWhd7lofMsQGLg7dV8s=; b=A4ca3gNRINHmXtssv5vW5aD2BOLj4XZIZ9I5Fb6nw1J85yDSzE9JZq58kHXdtCNt5V DrqkMlk0rnCFgiOF1w7rvxr++fPQL6mFcEzBDgwRSfeuPsSGglvlwKF/hxIL6Jc26C9Q 3xHD4hn/HL1pMBe2vitvsCiS5Jmvm5yTb8Xo1PxQf85Iok8zlVtU9sqjNt+6vrQ8qPrg u6DQHWxDqii3Kd//rwutzgTWbqIG1EElIAFSOD9Mpm3JhnrpT2UMEKcAZFSJLregQp3p Y4DenPyef51TpMw6EPgsjU5mTXaqti8byx6f1fbOhHqfA5M1huhcI5tAk29lZQ8fW9Xo YtNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=PiGZScSGvGJ8tG+ZijzQsGI+zWhd7lofMsQGLg7dV8s=; b=i9MMTmZkjtvsrjC9FGanNZRrzlwIuFATAz/hILrFJMEinfyq58GZm5r3ehsxg3BFrL hRBPT5dnCaglrVTY4VUv93KXr1pRIIM3tMyMZ6PELNod9Q2RY9OhOK85TnNpWRM0a+8g yojtdW734VnerafzGhmBBcFxLiKfxDESzbhJCpAUGLA+F2XJu0Uq1tOjS4syilJYp8zp Pzs8ev1r3BCsgbCYDT7WEnVUkNJph6e6rXzBbBIZyYh8o+2/kBTte5eg824eMMucsOfv WiWM9J7xE+F92+I/kSADBTnrAXMERmrKnWwtm/GyWWfgRDULcE/XxRL5h8so3jLfXP+g YH4A== X-Gm-Message-State: APjAAAVAK3z6XZmO0iA1KrXSFlE1sbixLKSMy7SgFT1AOajY/FG59fga dJYHgxoAhAZfzAuF98T8ROvujacf2MM= X-Google-Smtp-Source: APXvYqwJJxjH0EHfNXCDgHL62jpPTPuLwoAZf6083ywE/YOTsR+G5eX9pGD0RtJpE2mNb2elJIf7ZQ== X-Received: by 2002:a5d:6a90:: with SMTP id s16mr98034105wru.288.1564835401176; Sat, 03 Aug 2019 05:30:01 -0700 (PDT) Received: from [192.168.1.101] (71.215.broadband18.iol.cz. [109.81.215.71]) by smtp.gmail.com with ESMTPSA id b186sm57427898wmb.3.2019.08.03.05.30.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Aug 2019 05:30:00 -0700 (PDT) From: Jan Sucan Subject: Dual-stack ping command To: freebsd-net@freebsd.org Cc: Alan Somers Message-ID: Date: Sat, 3 Aug 2019 14:29:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4613JW4tXlz4GcW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=A4ca3gNR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sucanjan@gmail.com designates 2a00:1450:4864:20::42c as permitted sender) smtp.mailfrom=sucanjan@gmail.com X-Spamd-Result: default: False [0.01 / 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:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; RECEIVED_SPAMHAUS_PBL(0.00)[71.215.81.109.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; 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]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; INTRODUCTION(2.00)[]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-9.20), ipnet: 2a00:1450::/32(-3.10), asn: 15169(-2.46), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[c.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2019 12:30:05 -0000 Hello, my name is Jan and I'm a this year's GSoC student. My mentor is Alan Somers. I'm working on a new dual-stack ping command. You can find it here: https://github.com/jansucan/freebsd/tree/ping/sbin/ping It's still work in progress but it should be fully functional. The main goals were to remove code duplicity and make the code more maintainable while not changing stdout output. The new ping is based mainly on the old ping and ping6. The code was moved, compartmentalized, and modified rather than rewritten. Usage information can be found in the new manual page. Options for IPv4 target (ping) have not been changed. Options for IPv6 target (ping6) have been renamed not to conflict with the IPv4 options. Few of the most important features and changes are: - It's possible to build IPv4-only, IPv6-only, and IPv4-IPv6 version. - Major code duplicities have been eliminated (option parsing, initialization, signal handling, pinger loop). - Use of global variables has been eliminated. - The code has been compartmentalized into smaller separate source files. Unused code has been removed. - Capsicum and Casper support has been added for IPv6 ping code too. - Option parsing is extensively tested using ATF. I would like to ask for a feedback. Thanks Jan