1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 18:55:09 +03:00

vlan: fix assert

This commit is contained in:
Susant Sahani 2015-10-25 09:30:17 +05:30
parent 931c7feac0
commit 2645f07d81

View File

@ -24,14 +24,17 @@
#include "networkd-netdev-vlan.h"
static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *req) {
VLan *v = VLAN(netdev);
VLan *v;
int r;
assert(netdev);
assert(v);
assert(link);
assert(req);
v = VLAN(netdev);
assert(v);
if (v->id <= VLANID_MAX) {
r = sd_netlink_message_append_u16(req, IFLA_VLAN_ID, v->id);
if (r < 0)
@ -42,12 +45,15 @@ static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_netlin
}
static int netdev_vlan_verify(NetDev *netdev, const char *filename) {
VLan *v = VLAN(netdev);
VLan *v;
assert(netdev);
assert(v);
assert(filename);
v = VLAN(netdev);
assert(v);
if (v->id > VLANID_MAX) {
log_warning("VLAN without valid Id (%"PRIu64") configured in %s. Ignoring", v->id, filename);
return -EINVAL;