Skip to content

Commit

Permalink
Add initial value for weight in overlay nexthops (sonic-net#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 Jan 11, 2022
1 parent d3cd402 commit 6dae6b8
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 6dae6b8

Please sign in to comment.