Subject: mirred, redirect action vs. dev refcount issue

From: Stephen Hemminger <[email-masked]>
Date: Wed, 21 Jul 2010 16:24:26 -0700

Both the mirrored and redirect TC actions, hold a pointer to the
target device and increment the refcount.  The problem is that administrator
may want to remove the target device (for example ifb0) and this will
cause the kernel to get in the "can't delete ifb0 with references" state.

Fixing this isn't trivial but I think that the best way would be to have
the action API have a device notifier and walk the actions and call a new
hook (device_event) similar to existing walk. The device_event in the
action ops can then redirect any mirror/redirect that are going to a dead
device off to bit bucket.

Alternatively, the mirror/redirect could just use ifindex which is
a soft reference, so if device is removed, they just drop.

Lazy me favors the later.