[RFC] Use noafif in dhcpif and sycndhcpif

Garrett Cooper yanegomi at gmail.com
Thu Sep 22 02:16:35 UTC 2011


On Wed, Sep 21, 2011 at 6:12 PM, Garrett Cooper <yanegomi at gmail.com> wrote:
> On Wed, Sep 21, 2011 at 6:08 PM, Garrett Cooper <yanegomi at gmail.com> wrote:
>> On Wed, Sep 21, 2011 at 4:40 PM, Xin LI <delphij at delphij.net> wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA256
>>>
>>> Hi,
>>>
>>> While developing FreeNAS we have hit a problem -- when
>>> ifconfig_DEFAULT is set to "DHCP", all interfaces including pfsync0
>>> and pflog0 would be probed by dhclient.
>>>
>>> It seems to be reasonable to check noafif in both dhcpif and
>>> syncdhcpif, as did in ipv6_autoconfif based on same reasoning.
>>
>> The problem, as I've noted offline, is that something like the
>> following should be done. I'm not fully convinced that this is the
>> best way to solve the problem; I'm definitely open to additional
>> suggestions..
>>
>> Thanks!
>> -Garrett
>>
>> Index: etc/network.subr
>> ===================================================================
>> --- etc/network.subr   (revision 225558)
>> +++ etc/network.subr   (working copy)
>> @@ -1260,11 +1260,16 @@
>>                _lo=
>>                for _if in ${_autolist} ; do
>>                        if autoif $_if; then
>> -                               if [ "$_if" = "lo0" ]; then
>> +                               case "$_if" in
>> +                               lo0)
>>                                        _lo="lo0 "
>> -                               else
>> +                                       ;;
>> +                               ipfw[0-9]*|\
>> +                               pflog[0-9]*|\
>> +                               pfsync[0-9]*)
>
> +                                       ;;
> +                               *)
>                                        _tmplist="${_tmplist} ${_if}"
>
>> -                               fi
>> +                                       ;;
>> +                               esac
>>                        fi
>>                done
>>                _tmplist="${_lo}${_tmplist# }"
>>
>
> I meant to use the above context :)...

Arguably, changing ifconfig -l to ifconfig -l inet (or inet6) in the
above invocation would work too, assuming that the kernel was compiled
with INET support...
Thanks,
-Garrett


More information about the freebsd-rc mailing list