Skip to content

Commit

Permalink
Add initial value for weight in overlay nexthops (#2096)
Browse files Browse the repository at this point in the history
What I did
Add initial value for weight in overlay nexthops.

Why I did it
Without initializing the weight variable, it may be initialized as non-zero values. This PR aims to prevent it from happening.
  • Loading branch information
shi-su authored and judyjoseph committed Jan 17, 2022
1 parent 691c37b commit ed58d2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion orchagent/nexthopkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct NextHopKey
}
}

NextHopKey(const IpAddress &ip, const MacAddress &mac, const uint32_t &vni, bool overlay_nh) : ip_address(ip), alias(""), vni(vni), mac_address(mac){}
NextHopKey(const IpAddress &ip, const MacAddress &mac, const uint32_t &vni, bool overlay_nh) : ip_address(ip), alias(""), vni(vni), mac_address(mac), weight(0){}

const std::string to_string() const
{
Expand Down

0 comments on commit ed58d2f

Please sign in to comment.