From: Vincent Bernat Date: Sun, 25 Dec 2016 07:46:56 +0000 (+0100) Subject: linux: make ethtool stuff run as root again X-Git-Tag: 0.9.6~19^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F212%2Fhead;p=thirdparty%2Flldpd.git linux: make ethtool stuff run as root again This is needed for ETHTOOL_GLINKSETTINGS. --- diff --git a/src/daemon/lldpd.h b/src/daemon/lldpd.h index 762e83b7..5c475f40 100644 --- a/src/daemon/lldpd.h +++ b/src/daemon/lldpd.h @@ -227,9 +227,7 @@ struct ethtool_link_usettings { int priv_open(char*); void asroot_open(void); int priv_ethtool(char*, struct ethtool_link_usettings*); -# ifdef ENABLE_OLDIES void asroot_ethtool(void); -# endif #endif int priv_iface_init(int, char *); int asroot_iface_init_os(int, char *, int *); diff --git a/src/daemon/priv-linux.c b/src/daemon/priv-linux.c index a24051ec..20263df1 100644 --- a/src/daemon/priv-linux.c +++ b/src/daemon/priv-linux.c @@ -134,12 +134,12 @@ end: } /* Proxy for ethtool ioctl (GSET/GLINKSETTINGS only). Not needed since - * 0fdc100bdc4b7ab61ed632962c76dfe539047296 (2.6.37). */ + * 0fdc100bdc4b7ab61ed632962c76dfe539047296 (2.6.37). But needed until + * 8006f6bf5e39f11c697f48df20382b81d2f2f8b8 (4.9). */ int priv_ethtool(char *ifname, struct ethtool_link_usettings *uset) { int rc; -#ifdef ENABLE_OLDIES int len; enum priv_cmd cmd = PRIV_ETHTOOL; must_write(PRIV_UNPRIVILEGED, &cmd, sizeof(enum priv_cmd)); @@ -151,9 +151,6 @@ priv_ethtool(char *ifname, struct ethtool_link_usettings *uset) if (rc != 0) return rc; must_read(PRIV_UNPRIVILEGED, uset, sizeof(struct ethtool_link_usettings)); -#else - rc = asroot_ethtool_real(ifname, uset); -#endif return rc; } @@ -217,7 +214,6 @@ asroot_open() close(fd); } -#ifdef ENABLE_OLDIES void asroot_ethtool() { @@ -236,7 +232,6 @@ asroot_ethtool() if (rc == -1) return; must_write(PRIV_PRIVILEGED, &uset, sizeof(struct ethtool_link_usettings)); } -#endif int asroot_iface_init_os(int ifindex, char *name, int *fd) diff --git a/src/daemon/priv.c b/src/daemon/priv.c index 1c37f326..f03c90aa 100644 --- a/src/daemon/priv.c +++ b/src/daemon/priv.c @@ -387,9 +387,7 @@ static struct dispatch_actions actions[] = { {PRIV_GET_HOSTNAME, asroot_gethostname}, #ifdef HOST_OS_LINUX {PRIV_OPEN, asroot_open}, -# ifdef ENABLE_OLDIES {PRIV_ETHTOOL, asroot_ethtool}, -# endif #endif {PRIV_IFACE_INIT, asroot_iface_init}, {PRIV_IFACE_MULTICAST, asroot_iface_multicast},