1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
*** freebsd.c.orig Fri Oct 21 03:07:37 1994
--- src/kernel/freebsd.c Tue Apr 11 19:30:45 1995
***************
*** 1,5 ****
/*
! ** kernel/other.c Low level kernel access functions for FreeBSD 2.x
**
** This program is in the public domain and may be used freely by anyone
** who wants to.
--- 1,5 ----
/*
! ** kernel/other.c Low level kernel access functions for FreeBSD 2.1
**
** This program is in the public domain and may be used freely by anyone
** who wants to.
***************
*** 76,82 ****
static int nfile;
! static struct inpcb tcb;
int k_open()
{
--- 76,82 ----
static int nfile;
! static struct inpcbhead tcb;
int k_open()
{
***************
*** 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;
do
{
! 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;
do
{
! 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,191 ----
|