> The code in the rx/HPUX.rx_knet.c is identical across all the releases.
>
> I am looking for ideas and mainly for the definition and documentation on
> the kernel allocb, sosend and soreceive routines which are not defined
> in any of the headers.


We had a similar problem and we got help from HP - they informed us that
the crash was because our socket was not associated with a file structure.
Apparently, HPUX assumes that a socket is always associated with a file
which it tries to dereference somewhere in their code.

We added this to rxk_NewSocket for HP:

---- code snippet start ----

fp = falloc();
if (!fp) {
        goto error;
}

/* Get the file descriptor so we can free the file if there is an
 * error
 */
fd = (int) u.u_r.r_val1;

/* Initialize the file */
fp->f_flag = FREAD | FWRITE;
fp->f_type = DTYPE_SOCKET;
fp->f_ops  = &socketops;

/* And associate it with the socket */
fp->f_data = (void *) newSocket;
newSocket->so_fp = (void *) fp;

error:
    if (fd >= 0) {
        uffree(fd);
    }

    /* Free other resources */

---- code snippet end ----

We don't store the allocated file descriptor (which is required
to free the file), so we'll leak a file if we ever free the socket.
Fortunately, we don't ever free the socket in the client.

Srikanth.

Reply via email to