diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-05-19 17:12:36 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-05-19 17:12:36 +0300 |
commit | 4d4eb38795b5cbc66103ae2582bccead5bf0f736 (patch) | |
tree | 8048284284f48cb7c97a5c4fef0fc712125bbffa /net/core/dev_api.c | |
parent | 8cdf00b843ea3ca0e920176937bbc906b0b5bb04 (diff) | |
parent | a5806cd506af5a7c19bcd596e4708b5c464bfd21 (diff) | |
download | linux-4d4eb38795b5cbc66103ae2582bccead5bf0f736.tar.xz |
Merge remote-tracking branch 'torvalds/master' into perf-tools-next
To pick up changes for other tools/ libraries used by perf and for
header synchronization with the kernel sources originals.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'net/core/dev_api.c')
-rw-r--r-- | net/core/dev_api.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/core/dev_api.c b/net/core/dev_api.c index 90898cd540ce..f9a160ab596f 100644 --- a/net/core/dev_api.c +++ b/net/core/dev_api.c @@ -268,6 +268,29 @@ void dev_disable_lro(struct net_device *dev) EXPORT_SYMBOL(dev_disable_lro); /** + * dev_set_promiscuity() - update promiscuity count on a device + * @dev: device + * @inc: modifier + * + * Add or remove promiscuity from a device. While the count in the device + * remains above zero the interface remains promiscuous. Once it hits zero + * the device reverts back to normal filtering operation. A negative inc + * value is used to drop promiscuity on the device. + * Return 0 if successful or a negative errno code on error. + */ +int dev_set_promiscuity(struct net_device *dev, int inc) +{ + int ret; + + netdev_lock_ops(dev); + ret = netif_set_promiscuity(dev, inc); + netdev_unlock_ops(dev); + + return ret; +} +EXPORT_SYMBOL(dev_set_promiscuity); + +/** * dev_set_allmulti() - update allmulti count on a device * @dev: device * @inc: modifier |