Skip to content

Commit

Permalink
agent: add rpf to rpf table tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hedibouattour authored and sknat committed Dec 8, 2023
1 parent 40f4b2e commit f75968e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion calico-vpp-agent/cni/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func TruncateStr(text string, size int) string {

func (ps *LocalPodSpec) GetVrfTag(ipFamily vpplink.IpFamily, custom string) string {
h := hash(fmt.Sprintf("%s%s%s%s", ipFamily.ShortStr, ps.NetnsName, ps.InterfaceName, custom))
s := fmt.Sprintf("%s-%s-%s-%s", h, ipFamily.ShortStr, ps.InterfaceName, filepath.Base(ps.NetnsName))
s := fmt.Sprintf("%s-%s-%s%s-%s", h, ipFamily.ShortStr, ps.InterfaceName, custom, filepath.Base(ps.NetnsName))
return TruncateStr(s, MaxApiTagLen)
}

Expand Down
2 changes: 1 addition & 1 deletion calico-vpp-agent/common_tests/common_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func AssertRPFVRFExistence(vpp *vpplink.VppLink, interfaceName string, netnsName
"Failed to retrieve list of VRFs in VPP")
hbytes := sha512.Sum512([]byte(fmt.Sprintf("%s%s%s%s", "4", netnsName, interfaceName, "RPF")))
h := base64.StdEncoding.EncodeToString(hbytes[:])[:storage.VrfTagHashLen]
s := fmt.Sprintf("%s-%s-%s-%s", h, "4", interfaceName, filepath.Base(netnsName))
s := fmt.Sprintf("%s-%s-%sRPF-%s", h, "4", interfaceName, filepath.Base(netnsName))
vrfTag := storage.TruncateStr(s, storage.MaxApiTagLen)
foundRPFVRF := false
var vrfID uint32
Expand Down

0 comments on commit f75968e

Please sign in to comment.