Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Dec 2011 12:17:00 +0400
From:      Eygene Ryabinkin <rea@freebsd.org>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        Pyun Yong-Hyeon <pyunyh@gmail.com>, d@delphij.net, Garrett Cooper <yanegomi@gmail.com>, Gleb Smirnoff <glebius@FreeBSD.org>, freebsd-rc@freebsd.org
Subject:   Re: Annoying ERROR: 'wlan0' is not a DHCP-enabled interface
Message-ID:  <ooDmUS7742YMCurT/5XDO19d%2BS4@g5jH1yj%2BTnAiSdLOy3xs5Jutvhc>
In-Reply-To: <4EF80CA7.3070303@FreeBSD.org>
References:  <n2Hlz4MXZMNcNzN56fSf6/or7Ig@YnbH/K3/Y1Z96RV2jTofcGuSPJI> <4EF6401E.3080902@FreeBSD.org> <20111224215649.GA12789@stack.nl> <4EF80CA7.3070303@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--DMLl6fZPX8o7hGmc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Sun, Dec 25, 2011 at 09:56:55PM -0800, Doug Barton wrote:
> On 12/24/2011 13:56, Jilles Tjoelker wrote:
> > And rea@'s patch does this:
> >   service dhclient start IF
> > generates error messages if IF is not enabled for DHCP in rc.conf, while
> >   service dhclient quietstart IF
> > does not.
> >=20
> > This works the same way as service food start/quietstart when food is
> > not enabled in rc.conf.
> >=20
> > Therefore I do not see what is wrong with rea@'s patch.
>=20
> That's not the interesting case. The interesting case is the interface
> *is* configured with DHCP, but no error message is generated when it
> fails because they've been hidden.

The error message "'$ifn' is not a DHCP-enabled interface" is not generated
when $ifn is DHCP-enabled interface,
{{{
dhclient_pre_check()
{
        if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
                local msg
                msg=3D"'$ifn' is not a DHCP-enabled interface"
                if [ -z "${rc_quiet}" ]; then
                        err 1 "$msg"
                else
                        debug "$msg"
                        exit 1
                fi
        fi
}
}}}
'! dhcpif $ifn' guarantees it.  And all other errors aren't masked by
my patch, so everything is fine here.

The only way to miss the diagnostic message is to rely that devd will
configure your interface automagically while one forget to enable DHCP
on the interface he expect to automagificy.  That's pity, but the lone
'service dhclient start $if' or 'service netif start $if' will reveal
the truth.


> That's the bit that's confusing to me. I've administered hundreds of
> FreeBSD systems, servers and desktops, with and without DHCP, and I
> don't remember ever seeing these messages.

They will show up only for people who are running HEAD with /usr/src
r226879 or later: the changes weren't MFCed into any RELENG branch yet.

> Perhaps someone can show the configuration combination that will
> create them?

My way to reproduce it with Ethernet-only configuration is just to
unplug and plug back the cord to the switch to generate the linkup
event that will push devd.  You will need dhclient from r226879 and
not the patched one (with dhclient_pre_check cited above), because
it won't generate noise -- it uses 'debug' for the devd invocation.

The same thing should be seen for the WiFi interfaces that aren't
DHCP-enabled.  Left my FreeBSD-enabled notebook at home, so can't
test is just now.

> If so, I'll be glad to give the patch another look to confirm that
> my concerns about false negatives are being addressed.

Will be very good.

Thanks.
--=20
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]

--DMLl6fZPX8o7hGmc
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iF4EAREIAAYFAk74LXwACgkQFq+eroFS7PscJgD/RvU2meLFhSVfzjrQxD2dlsX8
kckdFxnsoTgwQgJ+BP4A/2+sfW1cxEBMORVVlfewFa2C3c8e9+YdmPdtYuJo2xMG
=N27O
-----END PGP SIGNATURE-----

--DMLl6fZPX8o7hGmc--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ooDmUS7742YMCurT/5XDO19d%2BS4>