Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Mar 2009 13:41:23 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190151 - head/sys/net
Message-ID:  <200903201341.n2KDfN1U003699@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Fri Mar 20 13:41:23 2009
New Revision: 190151
URL: http://svn.freebsd.org/changeset/base/190151

Log:
  Call the interface's if_ioctl from ifioctl(), if the protocol didn't
  handle the ioctl.  There are other paths that already call it, but this
  allows for a non-interface socket (like AF_LOCAL which ifconfig now
  uses) to use a broader class of interface ioctls.
  
  Approved by:	bz (mentor), rwatson

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Fri Mar 20 13:27:51 2009	(r190150)
+++ head/sys/net/if.c	Fri Mar 20 13:41:23 2009	(r190151)
@@ -2025,6 +2025,8 @@ ifioctl(struct socket *so, u_long cmd, c
 	error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
 								 data,
 								 ifp, td));
+	if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+		error = (*ifp->if_ioctl)(ifp, cmd, data);
 #else
 	{
 		int ocmd = cmd;
@@ -2066,6 +2068,9 @@ ifioctl(struct socket *so, u_long cmd, c
 								   cmd,
 								   data,
 								   ifp, td));
+		if (error == EOPNOTSUPP && ifp != NULL &&
+		    ifp->if_ioctl != NULL)
+			error = (*ifp->if_ioctl)(ifp, cmd, data);
 		switch (ocmd) {
 
 		case OSIOCGIFADDR:



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