panic on detroying tap device

Sepherosa Ziehau sepherosa at
Mon Dec 6 02:23:43 PST 2010

On Mon, Nov 22, 2010 at 12:56 AM, Jan Lentfer <Jan.Lentfer at> wrote:
> When playing with vkernel and networking a encountered a panic when doing
> ifconfig tap4 down
> ifconfig tap4 destroy

If the tap(4) is open(2)ed by vkernel, it should bypasses all cloning operation.

Your probably should add one more if_clone method besides
if_clone_creat/if_clone_destroy, like if_clone_iscloned, to fix all
pseudo devices, which support open(2) and if_clone.  Then change code
in net/if_clone.c like following:


    ifp = ifunit(name);
    if (ifp == NULL)
        return (ENXIO);

    if (!ifc->ifc_iscloned(ifp))
        return EOPNOTSUPP;

    if (ifc->ifc_destroy == NULL)
        return (EOPNOTSUPP);


BTW, after all these the TAP_CLONE test in tap_clone_destroy()
probably should be changed to assertion.

Best Regards,

Tomorrow Will Never Die

More information about the Bugs mailing list