diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-18 18:12:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-18 18:12:55 +0200 |
commit | 630a4d9ea7298fb4a494662cbb4871069143ff56 (patch) | |
tree | 01059a8c749b0dabfd98b6f40a587e0fcdf8bfae /src/network | |
parent | 283868e1dcd8ea7475850d9c6e7d4722c473dd50 (diff) | |
parent | e0fbf1fcffe014d5af6767b29f9108c2f2444888 (diff) |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkctl.c | 2 | ||||
-rw-r--r-- | src/network/networkd-netdev-tuntap.c | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 6253cbf582..2a7a1daf0f 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -141,7 +141,7 @@ static int decode_and_sort_links(sd_rtnl_message *m, LinkInfo **ret) { c++; } - qsort(links, c, sizeof(LinkInfo), link_info_compare); + qsort_safe(links, c, sizeof(LinkInfo), link_info_compare); *ret = links; links = NULL; diff --git a/src/network/networkd-netdev-tuntap.c b/src/network/networkd-netdev-tuntap.c index dd3bd96dbb..eef8747210 100644 --- a/src/network/networkd-netdev-tuntap.c +++ b/src/network/networkd-netdev-tuntap.c @@ -172,9 +172,35 @@ static void tuntap_done(NetDev *netdev) { t->group_name = NULL; } +static int tuntap_verify(NetDev *netdev, const char *filename) { + TunTap *t = NULL; + + assert(netdev); + + if (netdev->kind == NETDEV_KIND_TUN) + t = TUN(netdev); + else + t = TAP(netdev); + + assert(t); + + if (netdev->mtu) { + log_warning_netdev(netdev, "MTU configured for %s, ignoring", + netdev_kind_to_string(netdev->kind)); + } + + if (netdev->mac) { + log_warning_netdev(netdev, "MAC configured for %s, ignoring", + netdev_kind_to_string(netdev->kind)); + } + + return 0; +} + const NetDevVTable tun_vtable = { .object_size = sizeof(TunTap), .sections = "Match\0NetDev\0Tun\0", + .config_verify = tuntap_verify, .done = tuntap_done, .create = netdev_create_tuntap, .create_type = NETDEV_CREATE_INDEPENDENT, @@ -183,6 +209,7 @@ const NetDevVTable tun_vtable = { const NetDevVTable tap_vtable = { .object_size = sizeof(TunTap), .sections = "Match\0NetDev\0Tap\0", + .config_verify = tuntap_verify, .done = tuntap_done, .create = netdev_create_tuntap, .create_type = NETDEV_CREATE_INDEPENDENT, |