diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-05-23 04:36:25 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-05-28 15:47:15 +0200 |
commit | d61e4c5b6e312020b22aca5acd3765df1ce61f27 (patch) | |
tree | 58858bd9e2d3c6c060b63b95d5814ae64dee54f7 /src/network/netdev/nlmon.c | |
parent | network: add NetDevVTable::generate_mac flag (diff) | |
download | systemd-d61e4c5b6e312020b22aca5acd3765df1ce61f27.tar.xz systemd-d61e4c5b6e312020b22aca5acd3765df1ce61f27.zip |
network: add nlmon support
nlmon is a Netlink monitor device.
Diffstat (limited to 'src/network/netdev/nlmon.c')
-rw-r--r-- | src/network/netdev/nlmon.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/network/netdev/nlmon.c b/src/network/netdev/nlmon.c new file mode 100644 index 0000000000..c58a6b51ca --- /dev/null +++ b/src/network/netdev/nlmon.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ + +#include "netdev/nlmon.h" + +static int netdev_nlmon_verify(NetDev *netdev, const char *filename) { + assert(netdev); + assert(filename); + + if (netdev->mac) { + log_netdev_warning(netdev, "%s: MACAddress= is not supported. Ignoring", filename); + netdev->mac = mfree(netdev->mac); + } + + return 0; +} + +const NetDevVTable nlmon_vtable = { + .object_size = sizeof(NLMon), + .sections = "Match\0NetDev\0", + .create_type = NETDEV_CREATE_INDEPENDENT, + .config_verify = netdev_nlmon_verify, +}; |