Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
* libax25 axio_flush bug hangs node and fix
@ 2002-10-15  9:52 Tihomir Heidelberg
  2002-10-15 18:22 ` Paul Lewis
  2002-10-16  3:21 ` Craig Small
  0 siblings, 2 replies; 9+ messages in thread
From: Tihomir Heidelberg @ 2002-10-15  9:52 UTC (permalink / raw)
  To: linux-hams

Hi

I noticed that my awznode (a variant of linux node) hangs and 
use maximum CPU when user starts any external command and 
incoming AX.25 connection get broken.

After tracing found something strange in libax25-0.0.10 in 
ax25io.c.

In function static int flush_obuf(ax25io *p)
it returns -1 if write to output file descriptor failed
if ((ret = write(p->ofd, p->obuf, p->optr < p->paclen ? p->optr : p->paclen)) < 0)
return -1

but, in axio_flush(ax25io *p)
we have following loop:
while (p->optr) {
                FD_ZERO(&fdset);
                FD_SET(p->ofd, &fdset);   
                if (select(p->ofd+1, NULL, &fdset, NULL, NULL)<0)
                        return -1;
		flushed+=flush_obuf(p);
                flushed+=j;
}
it is obvious that this loop will never end if above mentioned write
failed. After breaking this loop if flush_obuf returns -1 my awnnode
does not hangs.

Can maintainer of libax25 fix this in next release ?

73 de Tihomir Heidelberg, 9a4gl@9a0tcp.ampr.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-10-17 19:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-15  9:52 libax25 axio_flush bug hangs node and fix Tihomir Heidelberg
2002-10-15 18:22 ` Paul Lewis
2002-10-15 19:58   ` Tihomir Heidelberg
2002-10-16  3:21 ` Craig Small
2002-10-16 12:56   ` Tomi Manninen OH2BNS
2002-10-17  7:46     ` Kjell Jarl
2002-10-17 13:41       ` Tomi Manninen
2002-10-17 18:41         ` Kjell Jarl
2002-10-17 19:17           ` Jeroen Vreeken

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox