Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 2014 13:31:05 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272695 - head/sys/net
Message-ID:  <201410071331.s97DV5hB088377@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Tue Oct  7 13:31:04 2014
New Revision: 272695
URL: https://svnweb.freebsd.org/changeset/base/272695

Log:
  Our packet filters use mbuf's rcvif pointer to determine incoming interface.
  Change mbuf's rcvif to enc0 and restore it after pfil processing.
  
  PR:		110959
  Sponsored by:	Yandex LLC

Modified:
  head/sys/net/if_enc.c

Modified: head/sys/net/if_enc.c
==============================================================================
--- head/sys/net/if_enc.c	Tue Oct  7 13:30:42 2014	(r272694)
+++ head/sys/net/if_enc.c	Tue Oct  7 13:31:04 2014	(r272695)
@@ -230,6 +230,7 @@ ipsec_filter(struct mbuf **mp, int dir, 
 {
 	int error, i;
 	struct ip *ip;
+	struct ifnet *rcvif;
 
 	KASSERT(encif != NULL, ("%s: encif is null", __func__));
 	KASSERT(flags & (ENC_IN|ENC_OUT),
@@ -268,6 +269,8 @@ ipsec_filter(struct mbuf **mp, int dir, 
 	}
 
 	error = 0;
+	rcvif = (*mp)->m_pkthdr.rcvif;
+	(*mp)->m_pkthdr.rcvif = encif;
 	ip = mtod(*mp, struct ip *);
 	switch (ip->ip_v) {
 #ifdef INET
@@ -298,6 +301,7 @@ ipsec_filter(struct mbuf **mp, int dir, 
 	if (error != 0)
 		goto bad;
 
+	(*mp)->m_pkthdr.rcvif = rcvif;
 	return (error);
 
 bad:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410071331.s97DV5hB088377>