mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
vlan: fix assert
This commit is contained in:
parent
931c7feac0
commit
2645f07d81
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user