Skip to content

Commit

Permalink
nl_vxlan::create_endpoint(): fix error log on add neigh failure
Browse files Browse the repository at this point in the history
There is no link variable in this nl_vxlan::create_endpoint(), only
vxlan_link and br_link. This was hidden due to the OBJ_CAST(), but when
the OBJ_CAST() was dropped, g++ started to complain.

Fix this by replacing link with neigh, since neigh is what the text
before the variable says.

Fixes the following warning:

../git/src/netlink/nl_vxlan.cc: In member function 'int basebox::nl_vxlan::create_endpoint(rtnl_link*, rtnl_link*, nl_addr*)':
../git/src/netlink/nl_vxlan.cc:674:45: warning: the address of 'int link(const char*, const char*)' will never be NULL [-Waddress]
  674 |                  << ") to add l2 neigh " << link;
      |                                             ^~~~

Fixes: ec04fe2 ("vxlan: add existing neighbors for new endpoint")
Signed-off-by: Jonas Gorski <[email protected]>
  • Loading branch information
KanjiMonster committed Nov 13, 2023
1 parent 15919be commit ab7ddc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/netlink/nl_vxlan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ int nl_vxlan::create_endpoint(rtnl_link *vxlan_link, rtnl_link *br_link,
rv = add_l2_neigh(neigh, lport_id, tunnel_id);
if (rv < 0) {
LOG(ERROR) << __FUNCTION__ << ": failed (rv=" << rv
<< ") to add l2 neigh " << link;
<< ") to add l2 neigh " << neigh;
}
}

Expand Down

0 comments on commit ab7ddc3

Please sign in to comment.