Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet clear m->m_pkthdr.rcvif before calling ip_output().



details:   https://anonhg.NetBSD.org/src/rev/7fa295aeb783
branches:  trunk
changeset: 475807:7fa295aeb783
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Aug 26 02:56:59 1999 +0000

description:
clear m->m_pkthdr.rcvif before calling ip_output().
the member is used to pass struct socket to ip{,6}_output for ipsec decisions.

(i agree it is kind of ugly.  we need to modify struct mbuf if we are
to do better - which seems to me a bit too much)

diffstat:

 sys/netinet/ip_fil.c  |  15 +++++++++++++--
 sys/netinet/ip_ipip.c |   6 +++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diffs (69 lines):

diff -r f65aa401606d -r 7fa295aeb783 sys/netinet/ip_fil.c
--- a/sys/netinet/ip_fil.c      Thu Aug 26 02:40:27 1999 +0000
+++ b/sys/netinet/ip_fil.c      Thu Aug 26 02:56:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil.c,v 1.35 1999/08/26 02:15:35 marc Exp $ */
+/*     $NetBSD: ip_fil.c,v 1.36 1999/08/26 02:56:59 itojun Exp $       */
 
 /*
  * Copyright (C) 1993-1998 by Darren Reed.
@@ -9,13 +9,21 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.35 1999/08/26 02:15:35 marc Exp $";
+static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.36 1999/08/26 02:56:59 itojun Exp $";
 #else
 static const char sccsid[] = "@(#)ip_fil.c     2.41 6/5/96 (C) 1993-1995 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil.c,v 2.0.2.44.2.10 1998/11/22 01:50:22 darrenr Exp ";
 #endif
 #endif
 
+#if defined(__NetBSD__) && defined(_KERNEL)
+# ifdef _LKM
+#  define IPSEC
+# else
+#  include "opt_ipsec.h"
+# endif
+#endif
+
 #ifndef        SOLARIS
 #define        SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
 #endif
@@ -906,6 +914,9 @@
        ip->ip_ttl = ip_defttl;
 # endif
 
+#ifdef IPSEC
+       m->m_pkthdr.rcvif = NULL;
+#endif
 # if defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)
        bzero((char *)&ro, sizeof(ro));
        err = ip_output(m, (struct mbuf *)0, &ro, 0, 0);
diff -r f65aa401606d -r 7fa295aeb783 sys/netinet/ip_ipip.c
--- a/sys/netinet/ip_ipip.c     Thu Aug 26 02:40:27 1999 +0000
+++ b/sys/netinet/ip_ipip.c     Thu Aug 26 02:56:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_ipip.c,v 1.6 1999/04/04 09:10:27 tron Exp $ */
+/*     $NetBSD: ip_ipip.c,v 1.7 1999/08/26 02:56:59 itojun Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -45,6 +45,7 @@
 
 #include "ipip.h"
 #include "opt_mrouting.h"
+#include "opt_ipsec.h"
 
 #if NIPIP > 0 || defined(MROUTING)
 
@@ -272,6 +273,9 @@
        ifp->if_opackets++;
        ifp->if_obytes += m0->m_pkthdr.len;
 
+#ifdef IPSEC
+       m0->m_pkthdr.rcvif = NULL;
+#endif
        error = ip_output(m0, NULL, &sc->sc_route, 0, NULL);
        if (error)
                ifp->if_oerrors++;



Home | Main Index | Thread Index | Old Index