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? > 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? > 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 deamon do? How does it integrate itself with the existing way of configuring interfaces (/etc/hostname.if*)? > 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 ;) > 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. Martin