Added some more sanity checks to the code - now it actually seems to do something sensible (at least on Linux, but OSPF bits remain to be checked within real daemon).