summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1995-04-11 15:42:06 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1995-04-11 15:42:06 +0000
commitc9538b59164e6c7b219c5dbc462b7c1cf2e323ed (patch)
tree83b5c875f9dbff190809ab89850264755ebb1bb4 /security
parentFix for new inpcb style. (diff)
Fix inpcb handling
Notes
Notes: svn path=/head/; revision=1335
Diffstat (limited to 'security')
-rw-r--r--security/pidentd/files/patch-ac119
1 files changed, 75 insertions, 44 deletions
diff --git a/security/pidentd/files/patch-ac b/security/pidentd/files/patch-ac
index a00d4a47009e..4626f04860ea 100644
--- a/security/pidentd/files/patch-ac
+++ b/security/pidentd/files/patch-ac
@@ -1,5 +1,5 @@
-*** src/kernel/freebsd.c.orig Fri Oct 21 03:07:37 1994
---- src/kernel/freebsd.c Tue Apr 11 18:17:25 1995
+*** freebsd.c.orig Fri Oct 21 03:07:37 1994
+--- src/kernel/freebsd.c Tue Apr 11 19:30:45 1995
***************
*** 1,5 ****
/*
@@ -14,67 +14,98 @@
** This program is in the public domain and may be used freely by anyone
** who wants to.
***************
-*** 77,82 ****
---- 77,83 ----
+*** 76,82 ****
+
+ static int nfile;
+
+! static struct inpcb tcb;
+
+ int k_open()
+ {
+--- 76,82 ----
+
static int nfile;
- static struct inpcb tcb;
-+ static struct inpcb *dummy_tcb;
+! static struct inpcbhead tcb;
int k_open()
{
***************
-*** 140,146 ****
+*** 127,158 ****
+ ** Returns NULL if no match.
+ */
+ static struct socket *
+! getlist(pcbp, faddr, fport, laddr, lport)
+! struct inpcb *pcbp;
+ struct in_addr *faddr;
+ int fport;
+ struct in_addr *laddr;
+ int lport;
+ {
+! struct inpcb *head;
+
+! if (!pcbp)
return NULL;
-
-! head = pcbp->inp_prev;
+-
+- head = pcbp->inp_prev;
do
{
- if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
---- 141,147 ----
+! if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
+! pcbp->inp_laddr.s_addr == laddr->s_addr &&
+! pcbp->inp_fport == fport &&
+! pcbp->inp_lport == lport )
+! return pcbp->inp_socket;
+! } while (pcbp->inp_next != head &&
+! getbuf((long) pcbp->inp_next,
+! pcbp,
+! sizeof(struct inpcb),
+! "tcblist"));
+
+ return NULL;
+ }
+--- 127,159 ----
+ ** Returns NULL if no match.
+ */
+ static struct socket *
+! getlist(pcbphead, faddr, fport, laddr, lport)
+! struct inpcbhead *pcbphead;
+ struct in_addr *faddr;
+ int fport;
+ struct in_addr *laddr;
+ int lport;
+ {
+! struct inpcb *head, pcbp;
+
+! head = pcbphead->lh_first;
+! if (!head)
return NULL;
-
-! head = *(pcbp->inp_list.le_prev);
do
{
- if ( pcbp->inp_faddr.s_addr == faddr->s_addr &&
-***************
-*** 148,155 ****
- pcbp->inp_fport == fport &&
- pcbp->inp_lport == lport )
- return pcbp->inp_socket;
-! } while (pcbp->inp_next != head &&
-! getbuf((long) pcbp->inp_next,
- pcbp,
- sizeof(struct inpcb),
- "tcblist"));
---- 149,156 ----
- pcbp->inp_fport == fport &&
- pcbp->inp_lport == lport )
- return pcbp->inp_socket;
-! } while (pcbp->inp_list.le_next != head &&
-! getbuf((long) pcbp->inp_list.le_next,
- pcbp,
- sizeof(struct inpcb),
- "tcblist"));
+! if (!getbuf((long) head,
+! &pcbp,
+! sizeof(struct inpcb),
+! "tcblist"))
+! break;
+! if ( pcbp.inp_faddr.s_addr == faddr->s_addr &&
+! pcbp.inp_laddr.s_addr == laddr->s_addr &&
+! pcbp.inp_fport == fport &&
+! pcbp.inp_lport == lport )
+! return pcbp.inp_socket;
+! head = pcbp.inp_list.le_next;
+! } while (head != NULL);
+
+ return NULL;
+ }
***************
*** 185,192 ****
/* -------------------- TCP PCB LIST -------------------- */
if (!getbuf(nl[N_TCB].n_value, &tcb, sizeof(tcb), "tcb"))
return -1;
-!
-! tcb.inp_prev = (struct inpcb *) nl[N_TCB].n_value;
- sockp = getlist(&tcb, faddr, fport, laddr, lport);
-
- if (!sockp)
---- 186,193 ----
- /* -------------------- TCP PCB LIST -------------------- */
- if (!getbuf(nl[N_TCB].n_value, &tcb, sizeof(tcb), "tcb"))
- return -1;
-! dummy_tcb = ((struct inpcb *) nl[N_TCB].n_value);
-! tcb.inp_list.le_prev = &dummy_tcb;
+-
+- tcb.inp_prev = (struct inpcb *) nl[N_TCB].n_value;
sockp = getlist(&tcb, faddr, fport, laddr, lport);
if (!sockp)
+--- 186,191 ----