Hi everyone on the list ..

Part of checklogin() function:
...
  tv.tv_sec = 0;
  tv.tv_usec = 0;

  if (select (maxsock + 1, &rfds, NULL, NULL, &tv) <= 0)
    return;

  for (i = 0; i < listen_sock_num; i++)
  {
      if (!FD_ISSET (listen_sock[i], &rfds))
             continue;

      addrlen = sizeof (struct full_sockaddr_ax25);
      ret = accept (listen_sock[i], (struct sockaddr *) &newconn, &addrlen);
...

This does work OK with any kernel below 2.2.12.

With 2.2.12 accept() does not correctly fill sockaddr struct
when tv.tv_sec=tv.tv_usec=0 (some binary mess instead of callsigns)
It works when tv is nonzero.

Reffering to select() man page tv=0 should cause select
to check descriptors and exit immediately (and not just
break accept() :) )
To me it seems like kernel bug ..

My system - Slackware 4.0 (gcc2.7.2.3, libc5.4.46)

If this is known bug I hope this at least saves some time
to people wondering why their software doesn't work with 2.2.12.

  Bye Jan.

Reply via email to