[Dibbler] Hello quick question about dibbler and openbsd

Tomek Mrugalski thomson at klub.com.pl
Sat Sep 1 00:29:00 CEST 2012

On 12-08-30 20:59, Sly Midnight wrote:
> I just read your email and downloaded the latest copy of the git repo
> and compiled a new version of the software on my OpenBSD firewall. 
> While I do agree that the workaround you applied is indeed ugly and not
> ideal, I am happy to report it is now correctly functioning.
Thanks for your testing and the report.

I was contacted by two OpenBSD developers and they confirmed that this
is something that needs fixing. I'm afraid that the ugly workaround will
have to stay. I'm sure that they will be able to fix in their newest
release (that's 5.1, right?), but I'm not sure if there are reasonable
ways of deploying it on older releases.

> Apparently there is some missing functionality with regards to assigning
> the addresses it obtains via ifconfig and prefix delegations aren't
> supported at all under BSD systems yet it says.  But I could at least
> see the correct information that I expected.
There are 2 ways in which dibbler client can consume received
configuration: built-in functions and external script.

1. Built-in functions.
I never had a chance to implement BSD-specific interface for address
manipulation. Right now the code is taken from Mac OS with the hope of
it working on Free/Net/OpenBSD. The Mac OS interface is crude - it
simply calls external ifconfig command, but it is better than nothing.
>From your response I imagine that it didn't work on OpenBSD. Oh well.

2. External script.
Dibbler client can call external script every time a message is
received. You may take a look at scripts/notify-scripts directory. There
are scripts for Linux (works pretty well) and Mac OS (it's only can
configure DNS and domain, so not very useful yet). See Dibbler User's
Guide, section 4.8 for explanation how the script works. The basics are
very simple, just add this line:

script /path/to/the/script/script.sh

to your /etc/dibbler/client.conf.

Ultimately, dibbler will have a switch that controls which configuration
mechanism is used (built-in, script or both), but I haven't implemented
it yet.

> I would like to thank you for getting to this so quickly.  I would like
> to help with getting the functionality of adding/removing addresses via
> ifconfig fixed and to add support for prefix delegation assignment.  Is
> this done via some kind of script I could modify or is it done entirely
> within the code itself?
Your offer to help with this is much appreciated. There are 2 things to
do. The easier one is to write OpenBSD-specific script. I think with
this mail, User's Guide and Linux script as an example, you'll have no
troubles achieving this. Keep in mind that the script calling procedures
are relatively fresh and may have some rough edges. If there are things
that you think should be improved here, please let me know.

The harder thing is to make it work using built-in code. I was told by
one of the OpenBSD developers (thanks, Simon!) that the proper interface
to manipulate (add/update/delete) addresses is ioctls.

Here's the quote regarding address configuration:

> It's all ioctls.
> update lifetime: SIOCSIFALIFETIME_IN6
> Check out ifconfig.c for examples.
> http://www.openbsd.org/cgi-bin/cvsweb/src/sbin/ifconfig/ifconfig.c

There are existing functions in Port-bsd/lowlevel-bsd.c that are
dedicated to adding (ipaddr_add(), ipaddr_del() and ipaddr_update()).
The DHCP part is working, so the appropriate function will be called
when needed. You have working example code in ifconfig.c. I'm sure there
is an OpenBSD man page that explains those particular ioctl calls in
detail. It is not trivial, but it is not that scary either. Are you
willing to help with this?

If you (or anyone else familiar with OpenBSD) are willing to do this
work, I think we should continue this discussion on dibbler-devel list.


More information about the Dibbler mailing list