Removed
Link Here
|
1 |
--- portinuse.c.orig 2017-11-02 17:38:02 UTC |
2 |
+++ portinuse.c |
3 |
@@ -280,7 +280,7 @@ static struct nlist list[] = { |
4 |
struct xinpgen *xig, *exig; |
5 |
struct xinpcb *xip; |
6 |
struct xtcpcb *xtp; |
7 |
- struct inpcb *inp; |
8 |
+ struct in_conninfo *inc; |
9 |
void *buf = NULL; |
10 |
size_t len; |
11 |
|
12 |
@@ -339,7 +339,8 @@ static struct nlist list[] = { |
13 |
free(buf); |
14 |
return -1; |
15 |
} |
16 |
- inp = &xtp->xt_inp; |
17 |
+ xip = &xtp->xt_inp; |
18 |
+ inc = &xip->inp_inc; |
19 |
break; |
20 |
case IPPROTO_UDP: |
21 |
xip = (struct xinpcb *)xig; |
22 |
@@ -349,21 +350,21 @@ static struct nlist list[] = { |
23 |
free(buf); |
24 |
return -1; |
25 |
} |
26 |
- inp = &xip->xi_inp; |
27 |
+ inc = &xip->inp_inc; |
28 |
break; |
29 |
default: |
30 |
abort(); |
31 |
} |
32 |
/* no support for IPv6 */ |
33 |
- if ((inp->inp_vflag & INP_IPV6) != 0) |
34 |
+ if ((xip->inp_vflag & INP_IPV6) != 0) |
35 |
continue; |
36 |
syslog(LOG_DEBUG, "%08lx:%hu %08lx:%hu <=> %hu %08lx:%hu", |
37 |
- (u_long)inp->inp_laddr.s_addr, ntohs(inp->inp_lport), |
38 |
- (u_long)inp->inp_faddr.s_addr, ntohs(inp->inp_fport), |
39 |
+ (u_long)inc->inc_laddr.s_addr, ntohs(inc->inc_lport), |
40 |
+ (u_long)inc->inc_faddr.s_addr, ntohs(inc->inc_fport), |
41 |
eport, (u_long)ip_addr.s_addr, iport |
42 |
); |
43 |
- if (eport == (unsigned)ntohs(inp->inp_lport)) { |
44 |
- if (inp->inp_laddr.s_addr == INADDR_ANY || inp->inp_laddr.s_addr == ip_addr.s_addr) { |
45 |
+ if (eport == (unsigned)ntohs(inc->inc_lport)) { |
46 |
+ if (inc->inc_laddr.s_addr == INADDR_ANY || inc->inc_laddr.s_addr == ip_addr.s_addr) { |
47 |
found++; |
48 |
break; /* don't care how many, just that we found at least one */ |
49 |
} |