Re: 2.1.15: Oops in unix_accept

Ion Badulescu (ionut@moisil.wal.rhno.columbia.edu)
Fri, 13 Dec 1996 23:47:58 -0500 (EST)


On Fri, 13 Dec 1996, Steffen Zahn wrote:

> I encountered the following (non-fatal) Oops:

[oops deleted]

It's the following sequence in af_unix.c:

do
{
skb=skb_dequeue(&sk->receive_queue);
if(skb==NULL)
{
if(flags&O_NONBLOCK)
return -EAGAIN;
interruptible_sleep_on(sk->sleep);
if(current->signal & ~current->blocked)
return -ERESTARTSYS;
}
if (!(UNIXCB(skb).attr & MSG_SYN))
{
tsk=skb->sk;
tsk->state_change(tsk);
kfree_skb(skb, FREE_WRITE);
skb = NULL;
}
} while(skb==NULL);

Question for a network guru: can the first if be executed without
triggering any of the two return statements? (I assume so, otherwise the
second embedded if makes no sense). If so, does adding a continue
statement at the end of the first if solve the problem?

--- linux-2.1.15/net/unix/af_unix.c.old Fri Dec 13 23:36:35 1996
+++ linux-2.1.15/net/unix/af_unix.c Fri Dec 13 23:37:41 1996
@@ -865,6 +865,7 @@
interruptible_sleep_on(sk->sleep);
if(current->signal & ~current->blocked)
return -ERESTARTSYS;
+ continue;
}
if (!(UNIXCB(skb).attr & MSG_SYN))
{

Ionut

--
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.