Fix invalid host serialization for MAC-based interfaces

This commit is contained in:
Luca 2021-01-20 08:38:43 +01:00
parent 80ed58464e
commit 685bab35f4
2 changed files with 4 additions and 4 deletions

View file

@ -103,7 +103,7 @@ class Host : public GenericHashEntry, public AlertableEntity {
virtual bool isLocalHost() const = 0;
virtual bool isSystemHost() const = 0;
inline bool isBroadcastDomainHost() const { return(is_in_broadcast_domain); };
inline bool serializeByMac() const { return((isBroadcastDomainHost() || isDhcpHost()) && iface->serializeLbdHostsAsMacs()); }
inline bool serializeByMac() const { return(isLocalHost() && iface->serializeLbdHostsAsMacs()); }
inline bool isDhcpHost() const { return(is_dhcp_host); };
inline void setBroadcastDomainHost() { is_in_broadcast_domain = true; };
inline void setSystemHost() { /* TODO: remove */ };

View file

@ -1473,10 +1473,10 @@ char* Host::get_tskey(char *buf, size_t bufsize) {
char *k;
Mac *cur_mac = getMac(); /* Cache macs as they can be swapped/updated */
if(serializeByMac()) {
if(serializeByMac())
k = get_mac_based_tskey(cur_mac, buf, bufsize);
} else
else
k = get_hostkey(buf, bufsize);
return(k);
}