I tidied up the patch and some surrounding code, and came up with the
attached patch.
Unfortunately I don't have a means to test this, but if someone can test
attaching and detaching networks and devices, then I have no objection
to it going in.
Rich.
--
Emerging Technologies, Red Hat -
http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in
England and Wales under Company Registration No. 03798903