Module Name:    src
Committed By:   maxv
Date:           Thu May 10 05:08:53 UTC 2018

Modified Files:
        src/sys/netinet: ip_input.c
        src/sys/netipsec: ipsec.c ipsec.h
        src/sys/rump/librump/rumpnet: net_stub.c

Log Message:
Rename ipsec4_forward -> ipsec_mtu, and switch to void.


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.161 -r1.162 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.80 -r1.81 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.34 -r1.35 src/sys/rump/librump/rumpnet/net_stub.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/ip_input.c
diff -u src/sys/netinet/ip_input.c:1.381 src/sys/netinet/ip_input.c:1.382
--- src/sys/netinet/ip_input.c:1.381	Thu Apr 26 19:22:17 2018
+++ src/sys/netinet/ip_input.c	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_input.c,v 1.381 2018/04/26 19:22:17 maxv Exp $	*/
+/*	$NetBSD: ip_input.c,v 1.382 2018/05/10 05:08:53 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.381 2018/04/26 19:22:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.382 2018/05/10 05:08:53 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1468,7 +1468,7 @@ error:
 		}
 #ifdef IPSEC
 		if (ipsec_used)
-			(void)ipsec4_forward(mcopy, &destmtu);
+			ipsec_mtu(mcopy, &destmtu);
 #endif
 		IP_STATINC(IP_STAT_CANTFRAG);
 		break;

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.161 src/sys/netipsec/ipsec.c:1.162
--- src/sys/netipsec/ipsec.c:1.161	Sun Apr 29 11:51:08 2018
+++ src/sys/netipsec/ipsec.c	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.161 2018/04/29 11:51:08 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.162 2018/05/10 05:08:53 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.161 2018/04/29 11:51:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.162 2018/05/10 05:08:53 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -737,8 +737,8 @@ ipsec4_input(struct mbuf *m, int flags)
  *
  * XXX: And what if the MTU goes negative?
  */
-int
-ipsec4_forward(struct mbuf *m, int *destmtu)
+void
+ipsec_mtu(struct mbuf *m, int *destmtu)
 {
 	struct secpolicy *sp;
 	size_t ipsechdr;
@@ -747,14 +747,14 @@ ipsec4_forward(struct mbuf *m, int *dest
 	sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING,
 	    &error);
 	if (sp == NULL) {
-		return EINVAL;
+		return;
 	}
 
 	/* Count IPsec header size. */
 	ipsechdr = ipsec_sp_hdrsiz(sp, m);
 
 	/*
-	 * Find the correct route for outer IPv4 header, compute tunnel MTU.
+	 * Find the correct route for outer IP header, compute tunnel MTU.
 	 */
 	if (sp->req) {
 		struct secasvar *sav;
@@ -776,7 +776,6 @@ ipsec4_forward(struct mbuf *m, int *dest
 		}
 	}
 	KEY_SP_UNREF(&sp);
-	return 0;
 }
 
 static int

Index: src/sys/netipsec/ipsec.h
diff -u src/sys/netipsec/ipsec.h:1.80 src/sys/netipsec/ipsec.h:1.81
--- src/sys/netipsec/ipsec.h:1.80	Tue May  1 08:34:08 2018
+++ src/sys/netipsec/ipsec.h	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.h,v 1.80 2018/05/01 08:34:08 maxv Exp $	*/
+/*	$NetBSD: ipsec.h,v 1.81 2018/05/10 05:08:53 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 $	*/
 
@@ -257,7 +257,8 @@ void ipsec_invalpcbcacheall(void);
 struct inpcb;
 int ipsec4_output(struct mbuf *, struct inpcb *, int, u_long *, bool *, bool *);
 int ipsec4_input(struct mbuf *, int);
-int ipsec4_forward(struct mbuf *, int *);
+
+void ipsec_mtu(struct mbuf *, int *);
 
 struct inpcb;
 int ipsec_init_pcbpolicy(struct socket *so, struct inpcbpolicy **);

Index: src/sys/rump/librump/rumpnet/net_stub.c
diff -u src/sys/rump/librump/rumpnet/net_stub.c:1.34 src/sys/rump/librump/rumpnet/net_stub.c:1.35
--- src/sys/rump/librump/rumpnet/net_stub.c:1.34	Sat May  5 23:42:00 2018
+++ src/sys/rump/librump/rumpnet/net_stub.c	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: net_stub.c,v 1.34 2018/05/05 23:42:00 christos Exp $	*/
+/*	$NetBSD: net_stub.c,v 1.35 2018/05/10 05:08:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.34 2018/05/05 23:42:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.35 2018/05/10 05:08:53 maxv Exp $");
 
 #include <sys/mutex.h>
 #include <sys/param.h>
@@ -97,12 +97,12 @@ __weak_alias(esp4_ctlinput,rumpnet_stub)
 __weak_alias(esp6_ctlinput,rumpnet_stub);
 __weak_alias(ipsec4_output,rumpnet_stub);
 __weak_alias(ipsec4_common_input,rumpnet_stub);
-__weak_alias(ipsec4_forward,rumpnet_stub);
 __weak_alias(ipsec4_input,rumpnet_stub);
 __weak_alias(ipsec6_common_input,rumpnet_stub);
 __weak_alias(ipsec6_input,rumpnet_stub);
 __weak_alias(ipsec6_check_policy,rumpnet_stub);
 __weak_alias(ipsec6_process_packet,rumpnet_stub);
+__weak_alias(ipsec_mtu,rumpnet_stub);
 __weak_alias(ipsec_set_policy,rumpnet_stub);
 __weak_alias(ipsec_get_policy,rumpnet_stub);
 __weak_alias(ipsec_delete_pcbpolicy,rumpnet_stub);

Reply via email to