network: de-duplicate logging in bridge_vlan_append_info() and the caller

The remaining message is changed, because the user would most likely not
understand that "append VLANs" is just talking about the netlink message.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-01-05 11:05:02 +01:00
parent eff692502b
commit 2a3cca04c4
2 changed files with 6 additions and 8 deletions

View File

@@ -65,11 +65,9 @@ int bridge_vlan_append_info(
for (int k = 0; k < BRIDGE_VLAN_BITMAP_LEN; k++) {
uint32_t untagged_map = br_untagged_bitmap[k];
uint32_t vid_map = br_vid_bitmap[k];
unsigned base_bit;
int i;
unsigned base_bit = k * 32;
int i = -1;
base_bit = k * 32;
i = -1;
done = false;
do {
int j = find_next_bit(i, vid_map);
@@ -106,14 +104,14 @@ int bridge_vlan_append_info(
r = sd_netlink_message_append_data(req, IFLA_BRIDGE_VLAN_INFO, &br_vlan, sizeof(br_vlan));
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRIDGE_VLAN_INFO attribute: %m");
return r;
} else {
br_vlan.vid = begin;
br_vlan.flags |= BRIDGE_VLAN_INFO_RANGE_BEGIN;
r = sd_netlink_message_append_data(req, IFLA_BRIDGE_VLAN_INFO, &br_vlan, sizeof(br_vlan));
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRIDGE_VLAN_INFO attribute: %m");
return r;
br_vlan.vid = end;
br_vlan.flags &= ~BRIDGE_VLAN_INFO_RANGE_BEGIN;
@@ -121,7 +119,7 @@ int bridge_vlan_append_info(
r = sd_netlink_message_append_data(req, IFLA_BRIDGE_VLAN_INFO, &br_vlan, sizeof(br_vlan));
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRIDGE_VLAN_INFO attribute: %m");
return r;
}
if (done)

View File

@@ -422,7 +422,7 @@ static int link_configure(
r = bridge_vlan_append_info(link, req, link->network->pvid, link->network->br_vid_bitmap, link->network->br_untagged_bitmap);
if (r < 0)
return log_link_debug_errno(link, r, "Could not append VLANs: %m");
return log_link_debug_errno(link, r, "Could not append VLAN information to netlink message: %m");
r = sd_netlink_message_close_container(req);
if (r < 0)