Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys remove ipsec_set/getsocket. now we explicitly pass sock...
details: https://anonhg.NetBSD.org/src/rev/9409f33150db
branches: trunk
changeset: 550847:9409f33150db
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Aug 22 22:00:36 2003 +0000
description:
remove ipsec_set/getsocket. now we explicitly pass socket * to ip{,6}_output.
diffstat:
sys/netinet/ip_icmp.c | 8 ++------
sys/netinet/ip_input.c | 8 ++------
sys/netinet/ip_mroute.c | 12 ++----------
sys/netinet/ip_output.c | 8 ++------
sys/netinet/raw_ip.c | 10 ++--------
sys/netinet/tcp_input.c | 11 ++---------
sys/netinet/tcp_output.c | 12 ++----------
sys/netinet/tcp_subr.c | 10 ++--------
sys/netinet/udp_usrreq.c | 11 ++---------
sys/netinet6/icmp6.c | 12 ++----------
sys/netinet6/ip6_output.c | 7 ++-----
sys/netinet6/ipsec.c | 42 ++----------------------------------------
sys/netinet6/ipsec.h | 4 +---
sys/netinet6/nd6_nbr.c | 12 ++----------
sys/netinet6/raw_ip6.c | 11 ++---------
sys/netinet6/udp6_output.c | 17 ++---------------
16 files changed, 31 insertions(+), 164 deletions(-)
diffs (truncated from 559 to 300 lines):
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/ip_icmp.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_icmp.c,v 1.77 2003/08/22 21:53:03 itojun Exp $ */
+/* $NetBSD: ip_icmp.c,v 1.78 2003/08/22 22:00:36 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.77 2003/08/22 21:53:03 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.78 2003/08/22 22:00:36 itojun Exp $");
#include "opt_ipsec.h"
@@ -873,10 +873,6 @@
if (icmpprintfs)
printf("icmp_send dst %x src %x\n", ip->ip_dst, ip->ip_src);
#endif
-#ifdef IPSEC
- /* Don't lookup socket */
- (void)ipsec_setsocket(m, NULL);
-#endif
(void) ip_output(m, opts, NULL, 0,
(struct ip_moptions *)NULL, (struct socket *)NULL);
}
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/ip_input.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_input.c,v 1.174 2003/08/22 21:53:03 itojun Exp $ */
+/* $NetBSD: ip_input.c,v 1.175 2003/08/22 22:00:37 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.174 2003/08/22 21:53:03 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.175 2003/08/22 22:00:37 itojun Exp $");
#include "opt_gateway.h"
#include "opt_pfil_hooks.h"
@@ -1736,10 +1736,6 @@
}
}
-#ifdef IPSEC
- /* Don't lookup socket in forwarding case */
- (void)ipsec_setsocket(m, NULL);
-#endif
error = ip_output(m, (struct mbuf *)0, &ipforward_rt,
(IP_FORWARDING | (ip_directedbcast ? IP_ALLOWBROADCAST : 0)),
(struct ip_moptions *)NULL, (struct socket *)NULL);
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/ip_mroute.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_mroute.c,v 1.78 2003/08/22 21:53:04 itojun Exp $ */
+/* $NetBSD: ip_mroute.c,v 1.79 2003/08/22 22:00:37 itojun Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -86,7 +86,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.78 2003/08/22 21:53:04 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.79 2003/08/22 22:00:37 itojun Exp $");
#include "opt_ipsec.h"
@@ -1847,10 +1847,6 @@
if (vifp->v_flags & VIFF_TUNNEL) {
/* If tunnel options */
-#ifdef IPSEC
- /* Don't lookup socket in forwading case */
- (void)ipsec_setsocket(m, NULL);
-#endif
ip_output(m, (struct mbuf *)0, &vifp->v_route,
IP_FORWARDING, (struct ip_moptions *)NULL,
(struct socket *)NULL);
@@ -1865,10 +1861,6 @@
imo.imo_multicast_vif = -1;
#endif
-#ifdef IPSEC
- /* Don't lookup socket in forwading case */
- (void)ipsec_setsocket(m, NULL);
-#endif
error = ip_output(m, (struct mbuf *)0, (struct route *)0,
IP_FORWARDING|IP_MULTICASTOPTS, &imo,
(struct socket *)NULL);
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/ip_output.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_output.c,v 1.116 2003/08/22 21:53:04 itojun Exp $ */
+/* $NetBSD: ip_output.c,v 1.117 2003/08/22 22:00:37 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.116 2003/08/22 21:53:04 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.117 2003/08/22 22:00:37 itojun Exp $");
#include "opt_pfil_hooks.h"
#include "opt_ipsec.h"
@@ -215,10 +215,6 @@
else
inp = NULL;
#endif /*IPSEC*/
-#ifdef IPSEC
- /* so = ipsec_getsocket(m); */
- (void)ipsec_setsocket(m, NULL);
-#endif
#ifdef DIAGNOSTIC
if ((m->m_flags & M_PKTHDR) == 0)
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/raw_ip.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip.c,v 1.73 2003/08/22 21:53:05 itojun Exp $ */
+/* $NetBSD: raw_ip.c,v 1.74 2003/08/22 22:00:37 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.73 2003/08/22 21:53:05 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.74 2003/08/22 22:00:37 itojun Exp $");
#include "opt_ipsec.h"
#include "opt_mrouting.h"
@@ -379,12 +379,6 @@
flags |= IP_RAWOUTPUT;
ipstat.ips_rawout++;
}
-#ifdef IPSEC
- if (ipsec_setsocket(m, inp->inp_socket) != 0) {
- m_freem(m);
- return ENOBUFS;
- }
-#endif /*IPSEC*/
return (ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions,
inp->inp_socket, &inp->inp_errormtu));
}
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/tcp_input.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_input.c,v 1.178 2003/08/22 21:53:05 itojun Exp $ */
+/* $NetBSD: tcp_input.c,v 1.179 2003/08/22 22:00:37 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.178 2003/08/22 21:53:05 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.179 2003/08/22 22:00:37 itojun Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -3702,13 +3702,6 @@
#endif
else
so = NULL;
-#ifdef IPSEC
- /* use IPsec policy on listening socket, on SYN ACK */
- if (ipsec_setsocket(m, so) != 0) {
- m_freem(m);
- return ENOBUFS;
- }
-#endif
}
m->m_pkthdr.rcvif = NULL;
memset(mtod(m, u_char *), 0, tlen);
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/tcp_output.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_output.c,v 1.100 2003/08/22 21:53:05 itojun Exp $ */
+/* $NetBSD: tcp_output.c,v 1.101 2003/08/22 22:00:38 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -138,7 +138,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.100 2003/08/22 21:53:05 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.101 2003/08/22 22:00:38 itojun Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -1151,14 +1151,6 @@
#endif
}
-#ifdef IPSEC
- if (ipsec_setsocket(m, so) != 0) {
- m_freem(m);
- error = ENOBUFS;
- goto out;
- }
-#endif /*IPSEC*/
-
switch (af) {
#ifdef INET
case AF_INET:
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/tcp_subr.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_subr.c,v 1.148 2003/08/22 21:53:06 itojun Exp $ */
+/* $NetBSD: tcp_subr.c,v 1.149 2003/08/22 22:00:38 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.148 2003/08/22 21:53:06 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.149 2003/08/22 22:00:38 itojun Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -825,12 +825,6 @@
#endif
else
so = NULL;
-#ifdef IPSEC
- if (ipsec_setsocket(m, so) != 0) {
- m_freem(m);
- return ENOBUFS;
- }
-#endif /*IPSEC*/
if (tp != NULL && tp->t_inpcb != NULL) {
ro = &tp->t_inpcb->inp_route;
diff -r 88096fbcce9b -r 9409f33150db sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet/udp_usrreq.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udp_usrreq.c,v 1.107 2003/08/22 21:53:06 itojun Exp $ */
+/* $NetBSD: udp_usrreq.c,v 1.108 2003/08/22 22:00:38 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.107 2003/08/22 21:53:06 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.108 2003/08/22 22:00:38 itojun Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -906,13 +906,6 @@
((struct ip *)ui)->ip_tos = inp->inp_ip.ip_tos; /* XXX */
udpstat.udps_opackets++;
-#ifdef IPSEC
- if (ipsec_setsocket(m, inp->inp_socket) != 0) {
- error = ENOBUFS;
- goto release;
- }
-#endif /*IPSEC*/
-
return (ip_output(m, inp->inp_options, &inp->inp_route,
inp->inp_socket->so_options & (SO_DONTROUTE | SO_BROADCAST),
inp->inp_moptions, inp->inp_socket));
diff -r 88096fbcce9b -r 9409f33150db sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c Fri Aug 22 21:53:01 2003 +0000
+++ b/sys/netinet6/icmp6.c Fri Aug 22 22:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icmp6.c,v 1.98 2003/08/22 21:53:07 itojun Exp $ */
+/* $NetBSD: icmp6.c,v 1.99 2003/08/22 22:00:39 itojun Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.98 2003/08/22 21:53:07 itojun Exp $");
Home |
Main Index |
Thread Index |
Old Index