Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec Localify one function, and switch to C99 types ...
details: https://anonhg.NetBSD.org/src/rev/984c7c726c41
branches: trunk
changeset: 445394:984c7c726c41
user: maxv <maxv%NetBSD.org@localhost>
date: Sat Oct 27 05:42:23 2018 +0000
description:
Localify one function, and switch to C99 types while here.
diffstat:
sys/netipsec/ipsec.c | 16 ++--------------
sys/netipsec/ipsec.h | 4 +---
sys/netipsec/ipsec_input.c | 16 ++++++++++++++--
3 files changed, 17 insertions(+), 19 deletions(-)
diffs (92 lines):
diff -r 3c0ead12a588 -r 984c7c726c41 sys/netipsec/ipsec.c
--- a/sys/netipsec/ipsec.c Sat Oct 27 05:38:08 2018 +0000
+++ b/sys/netipsec/ipsec.c Sat Oct 27 05:42:23 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.165 2018/07/11 05:25:45 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.166 2018/10/27 05:42:23 maxv Exp $ */
/* $FreeBSD: ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
/* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.165 2018/07/11 05:25:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.166 2018/10/27 05:42:23 maxv Exp $");
/*
* IPsec controller part.
@@ -1868,18 +1868,6 @@
return EINVAL;
}
-void
-nat_t_ports_get(struct mbuf *m, u_int16_t *dport, u_int16_t *sport)
-{
- struct m_tag *tag;
-
- if ((tag = m_tag_find(m, PACKET_TAG_IPSEC_NAT_T_PORTS, NULL))) {
- *sport = ((u_int16_t *)(tag + 1))[0];
- *dport = ((u_int16_t *)(tag + 1))[1];
- } else
- *sport = *dport = 0;
-}
-
/*
* XXXJRT This should be done as a protosw init call.
*/
diff -r 3c0ead12a588 -r 984c7c726c41 sys/netipsec/ipsec.h
--- a/sys/netipsec/ipsec.h Sat Oct 27 05:38:08 2018 +0000
+++ b/sys/netipsec/ipsec.h Sat Oct 27 05:42:23 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.h,v 1.83 2018/09/14 05:09:51 maxv Exp $ */
+/* $NetBSD: ipsec.h,v 1.84 2018/10/27 05:42:23 maxv Exp $ */
/* $FreeBSD: ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $ */
/* $KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $ */
@@ -302,8 +302,6 @@
void *m_pad(struct mbuf *, int);
int m_striphdr(struct mbuf *, int, int);
-void nat_t_ports_get(struct mbuf *, u_int16_t *, u_int16_t *);
-
extern int ipsec_used __read_mostly;
extern int ipsec_enabled __read_mostly;
diff -r 3c0ead12a588 -r 984c7c726c41 sys/netipsec/ipsec_input.c
--- a/sys/netipsec/ipsec_input.c Sat Oct 27 05:38:08 2018 +0000
+++ b/sys/netipsec/ipsec_input.c Sat Oct 27 05:42:23 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec_input.c,v 1.71 2018/09/14 05:09:51 maxv Exp $ */
+/* $NetBSD: ipsec_input.c,v 1.72 2018/10/27 05:42:23 maxv Exp $ */
/* $FreeBSD: ipsec_input.c,v 1.2.4.2 2003/03/28 20:32:53 sam Exp $ */
/* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec_input.c,v 1.71 2018/09/14 05:09:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_input.c,v 1.72 2018/10/27 05:42:23 maxv Exp $");
/*
* IPsec input processing.
@@ -170,6 +170,18 @@
return m;
}
+static void
+nat_t_ports_get(struct mbuf *m, uint16_t *dport, uint16_t *sport)
+{
+ struct m_tag *tag;
+
+ if ((tag = m_tag_find(m, PACKET_TAG_IPSEC_NAT_T_PORTS, NULL))) {
+ *sport = ((uint16_t *)(tag + 1))[0];
+ *dport = ((uint16_t *)(tag + 1))[1];
+ } else
+ *sport = *dport = 0;
+}
+
/*
* ipsec_common_input gets called when an IPsec-protected packet
* is received by IPv4 or IPv6. Its job is to find the right SA
Home |
Main Index |
Thread Index |
Old Index