diff options
author | 2016-07-19 12:13:50 +0300 | |
---|---|---|
committer | 2016-07-19 12:13:50 +0300 | |
commit | 2ad5de1938d063ff68d5ea9c254cf2158bdf0c71 (patch) | |
tree | 1bdaa2cca386e9997f5def6887797fc8c1ea3e01 /net-firewall/ipt_netflow/files | |
parent | net-firewall/ipt_netflow: drop old version (diff) | |
download | gentoo-2ad5de1938d063ff68d5ea9c254cf2158bdf0c71.tar.gz gentoo-2ad5de1938d063ff68d5ea9c254cf2158bdf0c71.tar.bz2 gentoo-2ad5de1938d063ff68d5ea9c254cf2158bdf0c71.zip |
net-firewall/ipt_netflow: revision bump
Backport compatibility patch for Linux kernel 4.6
Package-Manager: portage-2.2.28
Diffstat (limited to 'net-firewall/ipt_netflow/files')
-rw-r--r-- | net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.6.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.6.patch b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.6.patch new file mode 100644 index 000000000000..bd9bedd3d998 --- /dev/null +++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.6.patch @@ -0,0 +1,61 @@ +commit c16ffc6cb679b3377a0d4a30a6bbcf5e2f3d0214 +Author: ABC <abc@telekom.ru> +Date: Sun May 22 22:07:14 2016 +0300 + + Support ETHTOOL_xLINKSETTINGS API (new in linux 4.6). + + Thus, making support for 4.6 kernels. + Reference to linux commit: + https://github.com/torvalds/linux/commit/3f1ac7a700d + + Fixes #56, thanks karel-un. + +diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c +index 067fd50..d27eea2 100644 +--- a/ipt_NETFLOW.c ++++ b/ipt_NETFLOW.c +@@ -3904,7 +3904,13 @@ static int ethtool_drvinfo(unsigned char *ptr, size_t size, struct net_device *d + { + struct ethtool_drvinfo info = { 0 }; + const struct ethtool_ops *ops = dev->ethtool_ops; ++#ifndef ETHTOOL_GLINKSETTINGS + struct ethtool_cmd ecmd; ++#define _KSETTINGS(x, y) (x) ++#else ++ struct ethtool_link_ksettings ekmd; ++#define _KSETTINGS(x, y) (y) ++#endif + int len = size; + int n; + +@@ -3933,11 +3939,11 @@ static int ethtool_drvinfo(unsigned char *ptr, size_t size, struct net_device *d + /* only get_settings for running devices to not trigger link negotiation */ + if (dev->flags & IFF_UP && + dev->flags & IFF_RUNNING && +- !__ethtool_get_settings(dev, &ecmd)) { ++ !_KSETTINGS(__ethtool_get_settings(dev, &ecmd), __ethtool_get_link_ksettings(dev, &ekmd))) { + char *s, *p; + + /* append basic parameters: speed and port */ +- switch (ethtool_cmd_speed(&ecmd)) { ++ switch (_KSETTINGS(ethtool_cmd_speed(&ecmd), ekmd.base.speed)) { + case SPEED_10000: s = "10Gb"; break; + case SPEED_2500: s = "2.5Gb"; break; + case SPEED_1000: s = "1Gb"; break; +@@ -3945,7 +3951,7 @@ static int ethtool_drvinfo(unsigned char *ptr, size_t size, struct net_device *d + case SPEED_10: s = "10Mb"; break; + default: s = ""; + } +- switch (ecmd.port) { ++ switch (_KSETTINGS(ecmd.port, ekmd.base.port)) { + case PORT_TP: p = "tp"; break; + case PORT_AUI: p = "aui"; break; + case PORT_MII: p = "mii"; break; +@@ -3964,6 +3970,7 @@ ret: + ops->complete(dev); + return size - len; + } ++#undef _KSETTINGS + + static const unsigned short netdev_type[] = + {ARPHRD_NETROM, ARPHRD_ETHER, ARPHRD_AX25, |