diff options
author | phk <phk@FreeBSD.org> | 1996-08-23 18:59:07 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-08-23 18:59:07 +0000 |
commit | b8aebaca2624179f7a6d556675d3c246c8aca35c (patch) | |
tree | d473198a8bcce68dadb106e123088be159894864 /sys | |
parent | 983e14a6bcb3cb9b4197b2dc8fcb1358101a1606 (diff) | |
download | FreeBSD-src-b8aebaca2624179f7a6d556675d3c246c8aca35c.zip FreeBSD-src-b8aebaca2624179f7a6d556675d3c246c8aca35c.tar.gz |
Mark sockets where the kernel chose the port# for.
This can be used by netstat to behave more intelligently.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/in_pcb.c | 4 | ||||
-rw-r--r-- | sys/netinet/in_pcb.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index fddbfaa..c414ce2 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95 - * $Id: in_pcb.c,v 1.19 1996/05/31 05:11:22 peter Exp $ + * $Id: in_pcb.c,v 1.20 1996/08/12 14:05:54 peter Exp $ */ #include <sys/param.h> @@ -202,6 +202,8 @@ in_pcbbind(inp, nam) ushort first, last; int count; + inp->inp_flags |= INP_ANONPORT; + if (inp->inp_flags & INP_HIGHPORT) { first = ipport_hifirstauto; /* sysctl */ last = ipport_hilastauto; diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index bc56f9a..072d884 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: in_pcb.h,v 1.10 1995/12/05 21:26:34 bde Exp $ + * $Id: in_pcb.h,v 1.11 1996/02/22 21:32:22 peter Exp $ */ #ifndef _NETINET_IN_PCB_H_ @@ -80,6 +80,7 @@ struct inpcbinfo { #define INP_HDRINCL 0x08 /* user supplies entire IP header */ #define INP_HIGHPORT 0x10 /* user wants "high" port binding */ #define INP_LOWPORT 0x20 /* user wants "low" port binding */ +#define INP_ANONPORT 0x40 /* port chosen for user */ #define INPLOOKUP_WILDCARD 1 |