# From Gerd Knorr - this avoids a network deadlock that can happen when the # host side of an interface is full when the UML interface is brought up. # In this case, SIGIOs will never be delivered since no new data is ever # queued to the host side. Index: um/arch/um/drivers/net_kern.c =================================================================== --- um.orig/arch/um/drivers/net_kern.c 2004-09-10 12:12:55.000000000 -0400 +++ um/arch/um/drivers/net_kern.c 2004-09-10 12:13:04.000000000 -0400 @@ -128,6 +128,12 @@ spin_lock(&opened_lock); list_add(&lp->list, &opened); spin_unlock(&opened_lock); + /* clear buffer - it can happen that the host side of the interface + * is full when we get here. In this case, new data is never queued, + * SIGIOs never arrive, and the net never works. + */ + while((err = uml_net_rx(dev)) > 0) ; + MOD_INC_USE_COUNT; out: spin_unlock(&lp->lock);