use u_int16_t, not u_short, for port #.

This commit is contained in:
itojun 2000-02-03 13:17:39 +00:00
parent 54cb3be873
commit 03993c84d3
2 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_pcb.c,v 1.17 2000/02/03 12:50:05 itojun Exp $ */
/* $NetBSD: in6_pcb.c,v 1.18 2000/02/03 13:17:39 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -141,7 +141,7 @@ in6_pcbbind(in6p, nam)
struct in6pcb *head = in6p->in6p_head;
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)NULL;
struct proc *p = curproc; /* XXX */
u_short lport = 0;
u_int16_t lport = 0;
int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
int error;
@ -293,10 +293,10 @@ in6_pcbsetport(laddr, in6p)
{
struct socket *so = in6p->in6p_socket;
struct in6pcb *head = in6p->in6p_head;
u_short last_port, lport = 0;
u_int16_t last_port, lport = 0;
int wild = 0;
void *t;
u_short min, max;
u_int16_t min, max;
#ifndef IPNOPRIVPORTS
struct proc *p = curproc; /*XXX*/
#endif
@ -818,7 +818,7 @@ in6_pcbnotify(head, dst, fport_arg, laddr6, lport_arg, cmd, notify)
{
struct in6pcb *in6p, *oin6p;
struct in6_addr faddr6;
u_short fport = fport_arg, lport = lport_arg;
u_int16_t fport = fport_arg, lport = lport_arg;
int errno;
int nmatch = 0;
@ -940,7 +940,7 @@ in6_pcblookup(head, faddr6, fport_arg, laddr6, lport_arg, flags)
{
struct in6pcb *in6p, *match = 0;
int matchwild = 3, wildcard;
u_short fport = fport_arg, lport = lport_arg;
u_int16_t fport = fport_arg, lport = lport_arg;
for (in6p = head->in6p_next; in6p != head; in6p = in6p->in6p_next) {
if (in6p->in6p_lport != lport)
@ -1052,7 +1052,7 @@ in6_pcblookup_connect(head, faddr6, fport_arg, laddr6, lport_arg, faith)
int faith;
{
struct in6pcb *in6p;
u_short fport = fport_arg, lport = lport_arg;
u_int16_t fport = fport_arg, lport = lport_arg;
for (in6p = head->in6p_next; in6p != head; in6p = in6p->in6p_next) {
#if defined(NFAITH) && NFAITH > 0
@ -1085,7 +1085,7 @@ in6_pcblookup_bind(head, laddr6, lport_arg, faith)
int faith;
{
struct in6pcb *in6p, *match;
u_short lport = lport_arg;
u_int16_t lport = lport_arg;
match = NULL;
for (in6p = head->in6p_next; in6p != head; in6p = in6p->in6p_next) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_pcb.h,v 1.9 2000/02/02 23:28:10 thorpej Exp $ */
/* $NetBSD: in6_pcb.h,v 1.10 2000/02/03 13:17:41 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -85,9 +85,9 @@ struct in6pcb {
struct in6pcb *in6p_head; /* pointer back to chain of
in6pcb's for this protocol */
struct in6_addr in6p_faddr; /* foreign host table entry */
u_short in6p_fport; /* foreign port */
u_int16_t in6p_fport; /* foreign port */
struct in6_addr in6p_laddr; /* local host table entry */
u_short in6p_lport; /* local port */
u_int16_t in6p_lport; /* local port */
u_int32_t in6p_flowinfo; /* priority and flowlabel */
struct socket *in6p_socket; /* back pointer to socket */
caddr_t in6p_ppcb; /* pointer to per-protocol pcb */