1995-05-06 00:53:16 +00:00
|
|
|
*** src/kernel/freebsd.c.orig Fri Oct 21 01:07:37 1994
|
|
|
|
--- src/kernel/freebsd.c Sun Apr 16 21:21:02 1995
|
1995-04-11 14:27:41 +00:00
|
|
|
***************
|
1995-05-06 00:53:16 +00:00
|
|
|
*** 53,58 ****
|
|
|
|
--- 53,61 ----
|
|
|
|
#include "identd.h"
|
|
|
|
#include "error.h"
|
1995-04-11 15:42:06 +00:00
|
|
|
|
1995-05-06 00:53:16 +00:00
|
|
|
+ #ifdef INPLOOKUP_SETLOCAL
|
|
|
|
+ #define _HAVE_OLD_INPCB
|
|
|
|
+ #endif
|
1995-04-11 15:42:06 +00:00
|
|
|
|
1995-05-06 00:53:16 +00:00
|
|
|
extern void *calloc();
|
|
|
|
extern void *malloc();
|
|
|
|
***************
|
|
|
|
*** 76,82 ****
|
|
|
|
--- 79,89 ----
|
1995-04-11 15:42:06 +00:00
|
|
|
|
1995-04-11 14:27:41 +00:00
|
|
|
static int nfile;
|
|
|
|
|
1995-05-06 00:53:16 +00:00
|
|
|
+ #ifdef _HAVE_OLD_INPCB
|
|
|
|
static struct inpcb tcb;
|
|
|
|
+ #else
|
|
|
|
+ static struct inpcbhead tcb;
|
|
|
|
+ #endif
|
1995-04-11 14:27:41 +00:00
|
|
|
|
|
|
|
int k_open()
|
|
|
|
{
|
|
|
|
***************
|
1995-05-06 00:53:16 +00:00
|
|
|
*** 127,148 ****
|
1995-04-11 15:42:06 +00:00
|
|
|
** Returns NULL if no match.
|
|
|
|
*/
|
|
|
|
static struct socket *
|
1995-05-06 00:53:16 +00:00
|
|
|
getlist(pcbp, faddr, fport, laddr, lport)
|
|
|
|
struct inpcb *pcbp;
|
1995-04-11 15:42:06 +00:00
|
|
|
struct in_addr *faddr;
|
|
|
|
int fport;
|
|
|
|
struct in_addr *laddr;
|
|
|
|
int lport;
|
|
|
|
{
|
1995-05-06 00:53:16 +00:00
|
|
|
struct inpcb *head;
|
1995-04-11 15:42:06 +00:00
|
|
|
|
1995-05-06 00:53:16 +00:00
|
|
|
if (!pcbp)
|
1995-04-11 14:27:41 +00:00
|
|
|
return NULL;
|
|
|
|
|
1995-05-06 00:53:16 +00:00
|
|
|
!
|
|
|
|
head = pcbp->inp_prev;
|
1995-04-11 14:27:41 +00:00
|
|
|
do
|
|
|
|
{
|
1995-05-06 00:53:16 +00:00
|
|
|
if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
|
|
|
|
pcbp->inp_laddr.s_addr == laddr->s_addr &&
|
|
|
|
pcbp->inp_fport == fport &&
|
|
|
|
--- 134,173 ----
|
1995-04-11 15:42:06 +00:00
|
|
|
** Returns NULL if no match.
|
|
|
|
*/
|
|
|
|
static struct socket *
|
1995-05-06 00:53:16 +00:00
|
|
|
+ #ifdef _HAVE_OLD_INPCB
|
|
|
|
getlist(pcbp, faddr, fport, laddr, lport)
|
|
|
|
struct inpcb *pcbp;
|
|
|
|
+ #else
|
|
|
|
+ getlist(pcbhead, faddr, fport, laddr, lport)
|
|
|
|
+ struct inpcbhead *pcbhead;
|
|
|
|
+ #endif
|
1995-04-11 15:42:06 +00:00
|
|
|
struct in_addr *faddr;
|
|
|
|
int fport;
|
|
|
|
struct in_addr *laddr;
|
|
|
|
int lport;
|
|
|
|
{
|
1995-05-06 00:53:16 +00:00
|
|
|
+ #ifdef _HAVE_OLD_INPCB
|
|
|
|
struct inpcb *head;
|
|
|
|
+ #else
|
|
|
|
+ struct inpcb *head, pcbp;
|
|
|
|
+ #endif
|
1995-04-11 15:42:06 +00:00
|
|
|
|
1995-05-06 00:53:16 +00:00
|
|
|
+ #ifdef _HAVE_OLD_INPCB
|
|
|
|
if (!pcbp)
|
1995-04-11 14:27:41 +00:00
|
|
|
return NULL;
|
1995-05-06 00:53:16 +00:00
|
|
|
+ #else
|
|
|
|
+ head = pcbhead->lh_first;
|
|
|
|
+ if (!head)
|
|
|
|
+ return NULL;
|
|
|
|
+ #endif
|
|
|
|
+
|
1995-04-11 14:27:41 +00:00
|
|
|
|
1995-05-06 00:53:16 +00:00
|
|
|
! #ifdef _HAVE_OLD_INPCB
|
|
|
|
head = pcbp->inp_prev;
|
|
|
|
+ #endif
|
1995-04-11 14:27:41 +00:00
|
|
|
do
|
|
|
|
{
|
1995-05-06 00:53:16 +00:00
|
|
|
+ #ifdef _HAVE_OLD_INPCB
|
|
|
|
if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
|
|
|
|
pcbp->inp_laddr.s_addr == laddr->s_addr &&
|
|
|
|
pcbp->inp_fport == fport &&
|
|
|
|
***************
|
|
|
|
*** 153,158 ****
|
|
|
|
--- 178,193 ----
|
|
|
|
pcbp,
|
|
|
|
sizeof(struct inpcb),
|
|
|
|
"tcblist"));
|
|
|
|
+ #else
|
|
|
|
+ if (!getbuf((long) head, &pcbp, sizeof(struct inpcb), "tcblist"))
|
|
|
|
+ break;
|
|
|
|
+ if (pcbp.inp_faddr.s_addr == faddr->s_addr &&
|
|
|
|
+ pcbp.inp_fport == fport &&
|
|
|
|
+ pcbp.inp_lport == lport )
|
|
|
|
+ return(pcbp.inp_socket);
|
|
|
|
+ head = pcbp.inp_list.le_next;
|
|
|
|
+ } while (head != NULL);
|
|
|
|
+ #endif
|
1995-04-11 15:42:06 +00:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
1995-04-11 14:27:41 +00:00
|
|
|
***************
|
1995-05-06 00:53:16 +00:00
|
|
|
*** 186,192 ****
|
|
|
|
--- 221,229 ----
|
1995-04-11 14:27:41 +00:00
|
|
|
if (!getbuf(nl[N_TCB].n_value, &tcb, sizeof(tcb), "tcb"))
|
|
|
|
return -1;
|
1995-05-06 00:53:16 +00:00
|
|
|
|
|
|
|
+ #ifdef _HAVE_OLD_INPCB
|
|
|
|
tcb.inp_prev = (struct inpcb *) nl[N_TCB].n_value;
|
|
|
|
+ #endif
|
1995-04-11 14:27:41 +00:00
|
|
|
sockp = getlist(&tcb, faddr, fport, laddr, lport);
|
|
|
|
|
|
|
|
if (!sockp)
|