From owner-freebsd-net@freebsd.org Sat Jan 9 18:47:53 2021 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 DC44E4DF6B8 for ; Sat, 9 Jan 2021 18:47:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DCpr942Bvz3s2c; Sat, 9 Jan 2021 18:47:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 109IlcqA071528 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 9 Jan 2021 20:47:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 109IlcqA071528 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 109Ilcpf071527; Sat, 9 Jan 2021 20:47:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 9 Jan 2021 20:47:38 +0200 From: Konstantin Belousov To: Vasily Postnicov Cc: Mark Johnston , freebsd-net@freebsd.org Subject: Re: DNS using Name Service Switch module and Casper Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DCpr942Bvz3s2c X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 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, 09 Jan 2021 18:47:53 -0000 On Sat, Jan 09, 2021 at 08:25:46PM +0300, Vasily Postnicov wrote: > Brilliant! It took me almost a day to dive into ZeroMQ to reassure > myself that there is nothing wrong with it. When I tried to write > minimal test programs which call fork after pthread_create() in all > combinations. When I realized that NSS stub module is what I need. > > Instructions: > > 1) Compile NSS stub module: cc -shared -fPIC -pthread -o > nss_zerodns.so.1 test.c (Note '.1' at the end). > 2) Copy nss_zerodns.so.1 to /usr/local/lib > 3) Apply the patch src_sbin_ping_main.c to ping source code. With this > patch ping will not quit too early when the initial call to > getaddrinfo() fails. > 4) Add stub module to /etc/nsswitch.conf: edit 'hosts' line to be > 'hosts: files dns zerodns' > 5) Ping non-existent host, like 'ping foo.bar' > 6) Ping will hang. The child process which it creates cannot be killed > even with killall -9 ping This is exactly what I do not want. Provide a standalone binary (or binaries) that can be just run and demonstrate the issue. Without editing nsswitch.conf or patching ping.