Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Aug 2014 06:23:54 +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: r270868 - head/sys/net
Message-ID:  <201408310623.s7V6NsT3041044@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Sun Aug 31 06:23:54 2014
New Revision: 270868
URL: http://svnweb.freebsd.org/changeset/base/270868

Log:
  Remove ability to write to struct if_data residing in struct ifnet
  via net.link.generic.IFMIB_IFDATA.*.IFDATA_GENERAL sysctl. Reasons
  for removal are:
  - No code in tree uses this possibility.
  - The documentation ifmib(4) doesn't say that such possibility
    exist. The example provided in manual page only reads data.
  - On many interfaces the feature simply doesn't work, since they
    do accounting in hardware, and overwrite if_data on tick.
  
  Sponsored by:	Nginx, Inc.

Modified:
  head/sys/net/if_mib.c

Modified: head/sys/net/if_mib.c
==============================================================================
--- head/sys/net/if_mib.c	Sun Aug 31 04:56:34 2014	(r270867)
+++ head/sys/net/if_mib.c	Sun Aug 31 06:23:54 2014	(r270868)
@@ -109,27 +109,8 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX
 		ifmd.ifmd_snd_drops = ifp->if_snd.ifq_drops;
 
 		error = SYSCTL_OUT(req, &ifmd, sizeof ifmd);
-		if (error || !req->newptr)
-			goto out;
-
-		error = SYSCTL_IN(req, &ifmd, sizeof ifmd);
 		if (error)
 			goto out;
-
-#define DONTCOPY(fld) ifmd.ifmd_data.ifi_##fld = ifp->if_data.ifi_##fld
-		DONTCOPY(type);
-		DONTCOPY(physical);
-		DONTCOPY(addrlen);
-		DONTCOPY(hdrlen);
-		DONTCOPY(mtu);
-		DONTCOPY(metric);
-		DONTCOPY(baudrate);
-#undef DONTCOPY
-#define COPY(fld) ifp->if_##fld = ifmd.ifmd_##fld
-		COPY(data);
-		ifp->if_snd.ifq_maxlen = ifmd.ifmd_snd_maxlen;
-		ifp->if_snd.ifq_drops = ifmd.ifmd_snd_drops;
-#undef COPY
 		break;
 
 	case IFDATA_LINKSPECIFIC:



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