From owner-freebsd-net@freebsd.org Fri Feb 8 07:05:35 2019 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFCDF14D663F for ; Fri, 8 Feb 2019 07:05:35 +0000 (UTC) (envelope-from ryan@ixsystems.com) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75ABB6CA07 for ; Fri, 8 Feb 2019 07:05:34 +0000 (UTC) (envelope-from ryan@ixsystems.com) Received: by mail-pf1-x42b.google.com with SMTP id j18so1260769pfe.1 for ; Thu, 07 Feb 2019 23:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ixsystems-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xX8EvmYKyqeOnzD92XiYJm+BVvF7yljZX/K6bPCcJNY=; b=ioXemtESBN8gsK0JrmZRz50wPqvdB85AJE9HOn4E28FXKpoTDGO9Cbz64QKz/8E+TD rMlap6B6eWgrBoeW1nK5UM7Xyd2Mkes95vfTqvaa0V3CNgPMYJdEtFY+ST7HimGRJeGY liEB9kKANfrS15bsYjCHPO9yEXnXho/9Cyn5oH/wBclxqXrwUN9pwLwj+hawPFVdKi++ MfWitE0hbA3YRMm2a+Mk0G1ubW7TqLesOCQYUIEdbwQ/nFFTLh3sLcQq+ZgZQ/DalKk1 sMmMf59auj9eFdBGGhfdrHaXfpyXtXp58hxnG8oLd7XlbF1jQCv47JkYGoL6oRqhw0ss oNDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xX8EvmYKyqeOnzD92XiYJm+BVvF7yljZX/K6bPCcJNY=; b=XxY14B1qjdR+aGvgfqfO8j0X3x/hTdgrD8iU7Yo3a1hjvawXRykoke6ZY6cdnCGot5 dLOsfTVcgXn6P2KobovRvGVEVzO1oYvpZH4UG0zOgr7H/U7IB58Pfzz/swC4P32hDQzw rbWrWWkIhn+XKT2Ls4+/LPbgJgSv5zhgk+I67JS+uefZ6IYkgoXfHpIV86g3ZizLBrGl ABSbLAXjT8p4PmR5C0Rru3N1ZY8aftylBA3h81jftj58X5WNv/e5FZ8Lp0YPHM3s0Qhw N/ep515WXqJS9uvRgSJdMd9FvqE78AaRw4UOAdfAw44xWbtx06h4AeJBmj77vs/JCfQA 41sQ== X-Gm-Message-State: AHQUAuZHutq7zMD//DDBOUWiK39DpalajfO4Ha0UG9QJWbK0dWzyAYIF ZE0UcWkp+mC8emcEclFQFB0dqA== X-Google-Smtp-Source: AHgI3IbTxaXhb6JEdVt0TeSJm+QKBinyb8TJmI3nib0P/AnkWNuf7gkVArnfmVGQHv6qCiRonHtAvA== X-Received: by 2002:a63:e711:: with SMTP id b17mr8444287pgi.363.1549609533289; Thu, 07 Feb 2019 23:05:33 -0800 (PST) Received: from [10.0.0.120] (c-67-160-253-209.hsd1.ca.comcast.net. [67.160.253.209]) by smtp.gmail.com with ESMTPSA id h15sm1404064pgl.43.2019.02.07.23.05.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 23:05:32 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: dhclient appears to misinterpret the exit status of dhclient-script From: Ryan Moeller In-Reply-To: Date: Thu, 7 Feb 2019 23:05:31 -0800 Cc: freebsd-net@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <478FCAF0-6263-4E6B-80C2-1C11BDA04F70@ixsystems.com> References: To: Nash Kaminski X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 75ABB6CA07 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ixsystems-com.20150623.gappssmtp.com header.s=20150623 header.b=ioXemtES; dmarc=pass (policy=none) header.from=ixsystems.com; spf=pass (mx1.freebsd.org: domain of ryan@ixsystems.com designates 2607:f8b0:4864:20::42b as permitted sender) smtp.mailfrom=ryan@ixsystems.com X-Spamd-Result: default: False [-6.19 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[ixsystems-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT3.ASPMX.L.GOOGLE.com]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; DMARC_POLICY_ALLOW(-0.50)[ixsystems.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-2.70)[ip: (-9.06), ipnet: 2607:f8b0::/32(-2.44), asn: 15169(-1.94), country: US(-0.07)]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ixsystems-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[b.2.4.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] 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: Fri, 08 Feb 2019 07:05:35 -0000 Nice catch! Apparently this was fixed in OpenBSD 11 years ago, before = they nuked the whole script thing. = https://github.com/openbsd/src/commit/b215a882fd7e98ff38505d62bfc539bee124= e0ee > On Feb 7, 2019, at 6:45 PM, Nash Kaminski = wrote: >=20 > Hello, >=20 > I have been attempting to debug a peculiar issue with dhclient on a > vanilla FreeBSD 11.2 system where it appears that even if > dhclient-script returns nonzero when invoked in response to a protocol > timeout, dhclient continues as if the address was bound successfully, > as opposed to the protocol being restarted after the defined retry > interval. >=20 > After some investigation, it appears that the root cause of this > behavior is a result of the lower byte of the exit status being > returned, instead of the upper byte containing the return code, on > line 2319 of sbin/dhclient/dhclient.c (Ref: > = https://github.com/freebsd/freebsd/blob/releng/11.2/sbin/dhclient/dhclient= .c#L2319). >=20 > Making the following change makes dhclient behave as expected. Am I > missing something or is there indeed a significant bug here? >=20 > Index: sbin/dhclient/dhclient.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sbin/dhclient/dhclient.c (revision 342377) > +++ sbin/dhclient/dhclient.c (working copy) > @@ -2316,7 +2316,7 @@ > if (ip) > script_flush_env(ip->client); >=20 > - return (wstatus & 0xff); > + return WEXITSTATUS(wstatus); >=20 > } >=20 >=20 > - Nash > _______________________________________________ > 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"