Skip to content

Commit

Permalink
Merge "Initialize TunnelEncap:::data_ byte array properly in the cons…
Browse files Browse the repository at this point in the history
…tructor" into R2.20
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 3, 2015
2 parents 37d5699 + 018ec1d commit 1ae54b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bgp/tunnel_encap/tunnel_encap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
#include "base/parse_object.h"

using std::copy;
using std::fill;
using std::string;

TunnelEncap::TunnelEncap(string encap) {
fill(data_.begin(), data_.end(), 0);
TunnelEncapType::Encap id = TunnelEncapType::TunnelEncapFromString(encap);
if (id == TunnelEncapType::UNSPEC) return;
data_[0] = 0x03;
Expand All @@ -25,6 +27,7 @@ TunnelEncap::TunnelEncap(string encap) {
}

TunnelEncap::TunnelEncap(TunnelEncapType::Encap tunnel_encap) {
fill(data_.begin(), data_.end(), 0);
data_[0] = 0x03;
data_[1] = 0x0C;
// Reserved
Expand Down

0 comments on commit 1ae54b3

Please sign in to comment.