2014-09-30 13:59 GMT+04:00 Martin Pieuchot <mpieuc...@nolizard.org>:
> Hey Vadim, I'm happy to see you've put some efforts into improving
> how wireless networks are configured on OpenBSD.  I have some questions
> below.
>
> On 26/09/14(Fri) 21:38, Vadim Zhukov wrote:
>>
>> This is a proof-of-concept patch that implements network "profiles"
>> in kernel, using IEEE 802.11 network name and/or BSSID.
>
> Why did you choose to put this in the kernel, did you encounter any
> technical problem, or was it easier/better that way?

I was asked to try this way some time ago, when I presented autonetd.

I don't feel myself enough experienced to judge hard which way it's
better. Actually, there are pros and cons either way. All I want is to
have easy-to-use and robust Wi-Fi (at least) configuration. :) So I'm
open to any ideas and improvements.

>> Current idea is as following:
>>
>>   1. Each 802.11 interface now have flag "autoassoc". If enabled,
>>      kernel will automatically scan for known networks. Interval
>>      between scans is hardcoded to 3 seconds for now.
>>
>>
>>      If a known network is found, the interface gets automatically
>>      reconfigured using corresponding profile, and userland will
>>      receive notification via routing socket.
>
> But if a new network is selected, assuming that I run dhclient(8) on
> this interface, what will happen?

With autonetd, dhclient(8) will be stopped/(re-)run, depending on
profile. But your question gave me an idea - we could forcefully
remove all addresses on interface, as a matter of sanity. dhclient(8)
will die itself then.

>>      If another known network is already configured and has higher
>>      precedence (i.e., it's placed earlier in the list), nothing
>>      will be done (for that interface).
>>
>>   2. Profiles are loaded (and could be viewed) via sysctl syscall.
>>      At the present, there is not support to display profiles,
>>      though (lazy me).
>>
>>   3. There is a userland companion for this functionality - reworked
>>      autonetd, that I'll present separately, if this patch (after
>>      polishing, of course) will go in.
>
> What does this daemon do?

1. Loads profiles to kernel at startup or reload.

2. Monitors interfaces marked with "autoassoc" flag for changes of
current profile; when this happens, it performs userland-side
configuration steps: static addressing, running dhclient,
notifications, etc.

> How does it integrate itself with the
> existing way of configuring interfaces (/etc/hostname.if*)?

# echo nwflag autoassoc >/etc/hostname.iwn0

(or ">>", if you want to configure some interface options, too).

>> Oh, and about the sys/net/if_slvar.h and sys/net/ppdefs.h: we were
>> lucky enough that duplicated definition didn't bite us yet, but
>> now it is.
>
> Don't worry about that, if_slvar.h is going to disappear soon ;)

Cool. :)

>> I'm posting this right before going to country for the weekend.
>> So, unfortunately, I'll be able to answer any questions in the Monday.
>
> Your diff below is really big and will scare a lot of people.  I don't
> think we can discuss it without having a clear picture of how to auto-
> configure wireless network.  But I'd recommend you to make sure it
> respects style(9) and you could even split it into various parts.

I'll try to compile some sort of presentation tomorrow, explaining all
the stuff I'm working on.

Thank you for overview!

--
  WBR,
  Vadim Zhukov

Reply via email to