Skip to content

Commit 6dae6b8

Browse files
authored
Add initial value for weight in overlay nexthops (sonic-net#2096)
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.
1 parent d3cd402 commit 6dae6b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

orchagent/nexthopkey.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct NextHopKey
102102
}
103103
}
104104

105-
NextHopKey(const IpAddress &ip, const MacAddress &mac, const uint32_t &vni, bool overlay_nh) : ip_address(ip), alias(""), vni(vni), mac_address(mac){}
105+
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){}
106106

107107
const std::string to_string() const
108108
{

0 commit comments

Comments
 (0)