Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Feb 2019 08:28:02 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343707 - head/sys/net
Message-ID:  <201902030828.x138S2CO011224@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Sun Feb  3 08:28:02 2019
New Revision: 343707
URL: https://svnweb.freebsd.org/changeset/base/343707

Log:
  Teach pfil_ioctl() about VIMAGE.
  
  Submitted by:	gallatin

Modified:
  head/sys/net/pfil.c

Modified: head/sys/net/pfil.c
==============================================================================
--- head/sys/net/pfil.c	Sun Feb  3 08:15:26 2019	(r343706)
+++ head/sys/net/pfil.c	Sun Feb  3 08:28:02 2019	(r343707)
@@ -46,6 +46,8 @@
 #include <sys/mutex.h>
 #include <sys/proc.h>
 #include <sys/queue.h>
+#include <sys/ucred.h>
+#include <sys/jail.h>
 
 #include <net/if.h>
 #include <net/if_var.h>
@@ -495,6 +497,7 @@ pfil_ioctl(struct cdev *dev, u_long cmd, caddr_t addr,
 {
 	int error;
 
+	CURVNET_SET(TD_TO_VNET(td));
 	error = 0;
 	switch (cmd) {
 	case PFILIOC_LISTHEADS:
@@ -507,9 +510,10 @@ pfil_ioctl(struct cdev *dev, u_long cmd, caddr_t addr,
 		error = pfilioc_link((struct pfilioc_link *)addr);
 		break;
 	default:
-		return (EINVAL);
+		error = EINVAL;
+		break;
 	}
-
+	CURVNET_RESTORE();
 	return (error);
 }
 



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