Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2018 19:39:45 +0000 (UTC)
From:      Ravi Pokala <rpokala@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r329833 - stable/11/sys/dev/mxge
Message-ID:  <201802221939.w1MJdjIE093976@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpokala
Date: Thu Feb 22 19:39:44 2018
New Revision: 329833
URL: https://svnweb.freebsd.org/changeset/base/329833

Log:
  MFC r329295:
  
  Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when
  the NIC is not a member of a lagg. This came as a surprise, because the
  SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the
  laggX interface, rather than a physical port) or EINVAL (if run against a
  non-member physical port). This behavior was not seen with other drivers,
  such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl
  handlers, I found that they all called ether_ioctl() for the default (i.e.
  unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two
  specific cases, and returns ENOTTY for the default case.
  
  Remove the two cases which explicitly call ether_ioctl(), and let the
  default case call it instead. This matches what the vast majority of the NIC
  drivers do.

Modified:
  stable/11/sys/dev/mxge/if_mxge.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mxge/if_mxge.c
==============================================================================
--- stable/11/sys/dev/mxge/if_mxge.c	Thu Feb 22 19:12:32 2018	(r329832)
+++ stable/11/sys/dev/mxge/if_mxge.c	Thu Feb 22 19:39:44 2018	(r329833)
@@ -4161,11 +4161,6 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 
 	err = 0;
 	switch (command) {
-	case SIOCSIFADDR:
-	case SIOCGIFADDR:
-		err = ether_ioctl(ifp, command, data);
-		break;
-
 	case SIOCSIFMTU:
 		err = mxge_change_mtu(sc, ifr->ifr_mtu);
 		break;
@@ -4289,7 +4284,8 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		break;
 
 	default:
-		err = ENOTTY;
+		err = ether_ioctl(ifp, command, data);
+		break;
 	}
 	return err;
 }



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