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)
This commit is contained in:
itojun 1999-08-26 02:56:59 +00:00
parent b1615831d2
commit a89a69391a
2 changed files with 18 additions and 3 deletions

View File

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

View File

@ -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 @@ ipip_output(ifp, m0, dst, rt)
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++;