Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ignoring of installation vrf table setting for SRv6 proxy… #1448

Merged
merged 1 commit into from
Sep 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/vpp/srplugin/vppcalls/vpp1901/srv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ func (h *SRv6VppHandler) addSRProxy(sidAddr net.IP, localSID *srv6.LocalSID) err
// add SR-proxy using VPP CLI
var cmd string
if strings.TrimSpace(localSID.GetEndFunction_AD().L3ServiceAddress) == "" { // L2 service
cmd = fmt.Sprintf("sr localsid address %v behavior end.ad oif %v iif %v", sidAddr, outInterface, inInterface)
cmd = fmt.Sprintf("sr localsid address %v fib-table %v behavior end.ad oif %v iif %v", sidAddr, localSID.InstallationVrfId, outInterface, inInterface)
} else { // L3 service
cmd = fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidAddr, localSID.GetEndFunction_AD().L3ServiceAddress, outInterface, inInterface)
cmd = fmt.Sprintf("sr localsid address %v fib-table %v behavior end.ad nh %v oif %v iif %v", sidAddr, localSID.InstallationVrfId, localSID.GetEndFunction_AD().L3ServiceAddress, outInterface, inInterface)
}
data, err := h.RunCli(cmd)
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions plugins/vpp/srplugin/vppcalls/vpp1901/srv6_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), memif1, memif2),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), memif1, memif2),
},
},
{
Expand All @@ -296,7 +296,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad oif %v iif %v", sidToStr(sidA), memif1, memif2),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad oif %v iif %v", sidToStr(sidA), memif1, memif2),
},
},
{
Expand All @@ -318,7 +318,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "local0", "tap0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "local0", "tap0"),
},
},
{
Expand All @@ -340,7 +340,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "host0", "vxlan0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "host0", "vxlan0"),
},
},
{
Expand All @@ -362,7 +362,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "ipsec0", "vmxnet3-0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "ipsec0", "vmxnet3-0"),
},
},
{
Expand All @@ -384,7 +384,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "loop0", "unknown0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "loop0", "unknown0"),
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions plugins/vpp/srplugin/vppcalls/vpp1904/srv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ func (h *SRv6VppHandler) addSRProxy(sidAddr net.IP, localSID *srv6.LocalSID) err
// add SR-proxy using VPP CLI
var cmd string
if strings.TrimSpace(localSID.GetEndFunction_AD().L3ServiceAddress) == "" { // L2 service
cmd = fmt.Sprintf("sr localsid address %v behavior end.ad oif %v iif %v", sidAddr, outInterface, inInterface)
cmd = fmt.Sprintf("sr localsid address %v fib-table %v behavior end.ad oif %v iif %v", sidAddr, localSID.InstallationVrfId, outInterface, inInterface)
} else { // L3 service
cmd = fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidAddr, localSID.GetEndFunction_AD().L3ServiceAddress, outInterface, inInterface)
cmd = fmt.Sprintf("sr localsid address %v fib-table %v behavior end.ad nh %v oif %v iif %v", sidAddr, localSID.InstallationVrfId, localSID.GetEndFunction_AD().L3ServiceAddress, outInterface, inInterface)
}
data, err := h.RunCli(cmd)
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions plugins/vpp/srplugin/vppcalls/vpp1904/srv6_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), memif1, memif2),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), memif1, memif2),
},
},
{
Expand All @@ -296,7 +296,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad oif %v iif %v", sidToStr(sidA), memif1, memif2),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad oif %v iif %v", sidToStr(sidA), memif1, memif2),
},
},
{
Expand All @@ -318,7 +318,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "local0", "tap0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "local0", "tap0"),
},
},
{
Expand All @@ -340,7 +340,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "host0", "vxlan0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "host0", "vxlan0"),
},
},
{
Expand All @@ -362,7 +362,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "ipsec0", "vmxnet3-0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "ipsec0", "vmxnet3-0"),
},
},
{
Expand All @@ -384,7 +384,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "loop0", "unknown0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "loop0", "unknown0"),
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions plugins/vpp/srplugin/vppcalls/vpp1908/srv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ func (h *SRv6VppHandler) addSRProxy(sidAddr net.IP, localSID *srv6.LocalSID) err
// add SR-proxy using VPP CLI
var cmd string
if strings.TrimSpace(localSID.GetEndFunction_AD().L3ServiceAddress) == "" { // L2 service
cmd = fmt.Sprintf("sr localsid address %v behavior end.ad oif %v iif %v", sidAddr, outInterface, inInterface)
cmd = fmt.Sprintf("sr localsid address %v fib-table %v behavior end.ad oif %v iif %v", sidAddr, localSID.InstallationVrfId, outInterface, inInterface)
} else { // L3 service
cmd = fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidAddr, localSID.GetEndFunction_AD().L3ServiceAddress, outInterface, inInterface)
cmd = fmt.Sprintf("sr localsid address %v fib-table %v behavior end.ad nh %v oif %v iif %v", sidAddr, localSID.InstallationVrfId, localSID.GetEndFunction_AD().L3ServiceAddress, outInterface, inInterface)
}
data, err := h.RunCli(cmd)
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions plugins/vpp/srplugin/vppcalls/vpp1908/srv6_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), memif1, memif2),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), memif1, memif2),
},
},
{
Expand All @@ -296,7 +296,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad oif %v iif %v", sidToStr(sidA), memif1, memif2),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad oif %v iif %v", sidToStr(sidA), memif1, memif2),
},
},
{
Expand All @@ -318,7 +318,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "local0", "tap0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "local0", "tap0"),
},
},
{
Expand All @@ -340,7 +340,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "host0", "vxlan0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "host0", "vxlan0"),
},
},
{
Expand All @@ -362,7 +362,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "ipsec0", "vmxnet3-0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "ipsec0", "vmxnet3-0"),
},
},
{
Expand All @@ -384,7 +384,7 @@ func TestAddLocalSID(t *testing.T) {
},
},
Expected: &vpe.CliInband{
Cmd: fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "loop0", "unknown0"),
Cmd: fmt.Sprintf("sr localsid address %v fib-table 10 behavior end.ad nh %v oif %v iif %v", sidToStr(sidA), nextHopIPv4.String(), "loop0", "unknown0"),
},
},
{
Expand Down