Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings and enable -Werror #436

Merged
merged 6 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ project('baseboxd', 'cpp',
'b_asneeded=false',
'prefix=/usr',
'sysconfdir=/etc',
'werror=true',
])

sources = files('''
Expand Down
1 change: 0 additions & 1 deletion src/netlink/cnetlink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ int cnetlink::handle_source_mac_learn() {
cnt < nl_proc_max && _packet_in.size() && state == NL_STATE_RUNNING;
cnt++) {
auto p = _packet_in.front();
int ifindex = port_man->get_ifindex(p.port_id);

// pass process packets to port_man
port_man->enqueue(p.port_id, p.pkt);
Expand Down
2 changes: 0 additions & 2 deletions src/netlink/knet_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ bool knet_manager::portdev_removed(rtnl_link *link) {

int ifindex(rtnl_link_get_ifindex(link));
std::string portname(rtnl_link_get_name(link));
int rv = 0;
bool port_removed(false);
std::lock_guard<std::mutex> lock{tn_mutex};

auto ifi2id_it = ifindex_to_id.find(ifindex);
Expand Down
2 changes: 1 addition & 1 deletion src/netlink/nl_bond.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ int nl_bond::add_lag_member(rtnl_link *bond, rtnl_link *link) {
if (mem_it == lag_members.end()) { // No ports in lag
std::set<uint32_t> members;
members.insert(port_id);
auto lm_rv = lag_members.emplace(lag_id, members);
lag_members.emplace(lag_id, members);
} else {
mem_it->second.insert(port_id);
}
Expand Down
4 changes: 2 additions & 2 deletions src/netlink/nl_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ int nl_bridge::mdb_entry_add(rtnl_mdb *mdb_entry) {
&mdb);

for (auto i : mdb) {
uint32_t port_ifindex = rtnl_mdb_entry_get_ifindex(i);
int port_ifindex = rtnl_mdb_entry_get_ifindex(i);
uint32_t port_id = nl->get_port_id(port_ifindex);
uint16_t vid = rtnl_mdb_entry_get_vid(i);
unsigned char buf[ETH_ALEN];
Expand Down Expand Up @@ -991,7 +991,7 @@ int nl_bridge::mdb_entry_remove(rtnl_mdb *mdb_entry) {
&mdb);

for (auto i : mdb) {
uint32_t port_ifindex = rtnl_mdb_entry_get_ifindex(i);
int port_ifindex = rtnl_mdb_entry_get_ifindex(i);
uint32_t port_id = nl->get_port_id(port_ifindex);
uint16_t vid = rtnl_mdb_entry_get_vid(i);
unsigned char buf[ETH_ALEN];
Expand Down
1 change: 0 additions & 1 deletion src/netlink/nl_l3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,6 @@ int nl_l3::get_neighbours_of_route(
rtnl_route *route, std::deque<struct rtnl_neigh *> *neighs,
std::deque<nh_stub> *unresolved_nh) noexcept {

auto route_dst = rtnl_route_get_dst(route);
std::deque<struct rtnl_nexthop *> nhs;

assert(route);
Expand Down
Loading