Rename ipsec4_forward -> ipsec_mtu, and switch to void.

This commit is contained in:
maxv 2018-05-10 05:08:53 +00:00
parent 161122ced1
commit f813c44d31
4 changed files with 15 additions and 15 deletions

View File

@ -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;

View File

@ -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 *destmtu)
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 *destmtu)
}
}
KEY_SP_UNREF(&sp);
return 0;
}
static int

View File

@ -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 **);

View File

@ -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);