Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys inpcb: use in_port_t for port numbers
details: https://anonhg.NetBSD.org/src/rev/d3515cadfe82
branches: trunk
changeset: 372254:d3515cadfe82
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Fri Nov 04 09:03:20 2022 +0000
description:
inpcb: use in_port_t for port numbers
diffstat:
sys/netinet/in.c | 6 +++---
sys/netinet/in_pcb.c | 18 +++++++++---------
sys/netinet/in_pcb.h | 10 +++++-----
sys/netinet6/in6_pcb.c | 14 +++++++-------
4 files changed, 24 insertions(+), 24 deletions(-)
diffs (195 lines):
diff -r b6ec447f85a0 -r d3515cadfe82 sys/netinet/in.c
--- a/sys/netinet/in.c Fri Nov 04 09:02:38 2022 +0000
+++ b/sys/netinet/in.c Fri Nov 04 09:03:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in.c,v 1.243 2022/09/20 02:23:37 knakahara Exp $ */
+/* $NetBSD: in.c,v 1.244 2022/11/04 09:03:20 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.243 2022/09/20 02:23:37 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.244 2022/11/04 09:03:20 ozaki-r Exp $");
#include "arp.h"
@@ -1861,7 +1861,7 @@
ia = ifatoia(ifa);
}
if (ia == NULL) {
- u_int16_t fport = sin->sin_port;
+ in_port_t fport = sin->sin_port;
struct ifaddr *ifa;
int s;
diff -r b6ec447f85a0 -r d3515cadfe82 sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c Fri Nov 04 09:02:38 2022 +0000
+++ b/sys/netinet/in_pcb.c Fri Nov 04 09:03:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.c,v 1.197 2022/11/04 09:02:38 ozaki-r Exp $ */
+/* $NetBSD: in_pcb.c,v 1.198 2022/11/04 09:03:20 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.197 2022/11/04 09:02:38 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.198 2022/11/04 09:03:20 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -187,7 +187,7 @@
table->inpt_connecthashtbl = hashinit(connecthashsize, HASH_LIST, true,
&table->inpt_connecthash);
table->inpt_lastlow = IPPORT_RESERVEDMAX;
- table->inpt_lastport = (u_int16_t)anonportmax;
+ table->inpt_lastport = (in_port_t)anonportmax;
RUN_ONCE(&control, inpcb_poolinit);
}
@@ -268,8 +268,8 @@
{
struct inpcbtable *table = inp->inp_table;
struct socket *so = inp->inp_socket;
- u_int16_t *lastport;
- u_int16_t lport = 0;
+ in_port_t *lastport;
+ in_port_t lport = 0;
enum kauth_network_req req;
int error;
@@ -744,7 +744,7 @@
{
struct inpcbhead *head;
struct inpcb *inp;
- u_int16_t fport = fport_arg, lport = lport_arg;
+ in_port_t fport = fport_arg, lport = lport_arg;
int nmatch;
if (in_nullhost(faddr) || notify == 0)
@@ -926,7 +926,7 @@
struct inpcb *match = NULL;
int matchwild = 3;
int wildcard;
- u_int16_t lport = lport_arg;
+ in_port_t lport = lport_arg;
if (vp)
vp->valid = 0;
@@ -1034,7 +1034,7 @@
{
struct inpcbhead *head;
struct inpcb *inp;
- u_int16_t fport = fport_arg, lport = lport_arg;
+ in_port_t fport = fport_arg, lport = lport_arg;
if (vp)
vp->valid = 0;
@@ -1080,7 +1080,7 @@
{
struct inpcbhead *head;
struct inpcb *inp;
- u_int16_t lport = lport_arg;
+ in_port_t lport = lport_arg;
head = INPCBHASH_BIND(table, laddr, lport);
LIST_FOREACH(inp, head, inp_hash) {
diff -r b6ec447f85a0 -r d3515cadfe82 sys/netinet/in_pcb.h
--- a/sys/netinet/in_pcb.h Fri Nov 04 09:02:38 2022 +0000
+++ b/sys/netinet/in_pcb.h Fri Nov 04 09:03:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.h,v 1.75 2022/11/04 09:01:53 ozaki-r Exp $ */
+/* $NetBSD: in_pcb.h,v 1.76 2022/11/04 09:03:20 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -101,8 +101,8 @@
struct inpcbtable *inp_table;
struct inpcbpolicy *inp_sp; /* security policy */
struct route inp_route; /* placeholder for routing entry */
- u_int16_t inp_fport; /* foreign port */
- u_int16_t inp_lport; /* local port */
+ in_port_t inp_fport; /* foreign port */
+ in_port_t inp_lport; /* local port */
int inp_flags; /* generic IP/datagram flags */
struct mbuf *inp_options; /* IP options */
bool inp_bindportonsend;
@@ -232,8 +232,8 @@
u_long inpt_porthash;
u_long inpt_bindhash;
u_long inpt_connecthash;
- u_int16_t inpt_lastport;
- u_int16_t inpt_lastlow;
+ in_port_t inpt_lastport;
+ in_port_t inpt_lastlow;
struct vestigial_hooks *vestige;
};
diff -r b6ec447f85a0 -r d3515cadfe82 sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c Fri Nov 04 09:02:38 2022 +0000
+++ b/sys/netinet6/in6_pcb.c Fri Nov 04 09:03:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_pcb.c,v 1.175 2022/11/04 09:01:53 ozaki-r Exp $ */
+/* $NetBSD: in6_pcb.c,v 1.176 2022/11/04 09:03:20 ozaki-r Exp $ */
/* $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.175 2022/11/04 09:01:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.176 2022/11/04 09:03:20 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -134,7 +134,7 @@
{
inpcb_init(table, bindhashsize, connecthashsize);
- table->inpt_lastport = (u_int16_t)ip6_anonportmax;
+ table->inpt_lastport = (in_port_t)ip6_anonportmax;
}
/*
@@ -606,7 +606,7 @@
struct inpcb *inp;
struct sockaddr_in6 sa6_src;
const struct sockaddr_in6 *sa6_dst;
- u_int16_t fport = fport_arg, lport = lport_arg;
+ in_port_t fport = fport_arg, lport = lport_arg;
int errno;
int nmatch = 0;
u_int32_t flowinfo;
@@ -836,7 +836,7 @@
struct inpcbhead *head;
struct inpcb *inp, *match = NULL;
int matchwild = 3, wildcard;
- u_int16_t lport = lport_arg;
+ in_port_t lport = lport_arg;
if (vp)
vp->valid = 0;
@@ -1047,7 +1047,7 @@
{
struct inpcbhead *head;
struct inpcb *inp;
- u_int16_t fport = fport_arg, lport = lport_arg;
+ in_port_t fport = fport_arg, lport = lport_arg;
if (vp)
vp->valid = 0;
@@ -1091,7 +1091,7 @@
{
struct inpcbhead *head;
struct inpcb *inp;
- u_int16_t lport = lport_arg;
+ in_port_t lport = lport_arg;
#ifdef INET
struct in6_addr zero_mapped;
#endif
Home |
Main Index |
Thread Index |
Old Index