mirror of
https://github.com/systemd/systemd.git
synced 2025-03-09 12:58:26 +03:00
networkd: cleanup of bridge vlan code (#3505)
cleanup minor nitpicks mentioned in #3428
This commit is contained in:
parent
f045931a73
commit
ceac40781b
@ -39,12 +39,6 @@ static inline void set_bit(unsigned nr, uint32_t *addr) {
|
||||
addr[nr / 32] |= (((uint32_t) 1) << (nr % 32));
|
||||
}
|
||||
|
||||
static inline int is_vid_valid(unsigned vid) {
|
||||
if (vid > VLANID_MAX || vid == 0)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int find_next_bit(int i, uint32_t x) {
|
||||
int j;
|
||||
|
||||
@ -240,21 +234,21 @@ static int parse_vid_range(const char *rvalue, uint16_t *vid, uint16_t *vid_end)
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!_vid)
|
||||
if (_vid == 0)
|
||||
return -ERANGE;
|
||||
|
||||
r = parse_vlanid(p, &_vid_end);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!_vid_end)
|
||||
if (_vid_end == 0)
|
||||
return -ERANGE;
|
||||
} else {
|
||||
r = parse_vlanid(_rvalue, &_vid);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!_vid)
|
||||
if (_vid == 0)
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
|
@ -530,8 +530,7 @@ static void link_free(Link *link) {
|
||||
|
||||
free(link->ifname);
|
||||
|
||||
if (link->kind)
|
||||
free(link->kind);
|
||||
free(link->kind);
|
||||
|
||||
(void)unlink(link->state_file);
|
||||
free(link->state_file);
|
||||
@ -2006,7 +2005,7 @@ static int link_joined(Link *link) {
|
||||
log_link_error_errno(link, r, "Could not set bridge message: %m");
|
||||
}
|
||||
|
||||
if (link->network->bridge || NETDEV_KIND_BRIDGE == netdev_kind_from_string(link->kind)) {
|
||||
if (link->network->bridge || streq("bridge", link->kind)) {
|
||||
r = link_set_bridge_vlan(link);
|
||||
if (r < 0)
|
||||
log_link_error_errno(link, r, "Could not set bridge vlan: %m");
|
||||
|
Loading…
x
Reference in New Issue
Block a user