Skip to content

Commit

Permalink
Avoid panic by receiving vpnv6 prefixes with zebra reported in issue #…
Browse files Browse the repository at this point in the history
…2113

- Additionally bug fix which avoid panic caused by displaying vpnv6 prefixes using gobgp vrf rib
- Supporting FRRouting 7.1.x
  • Loading branch information
irino committed Jul 21, 2019
1 parent 4267098 commit 7284d4c
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 91 deletions.
3 changes: 2 additions & 1 deletion cmd/gobgp/neighbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,8 @@ func showNeighborRib(r string, name string, args []string) error {
for _, dst := range rib {
prefix := dst.Prefix
if t == api.TableType_VRF {
s := strings.Split(prefix, ":")
// extract prefix from original which is RD(AS:VRF):IPv4 or IPv6 address
s := strings.SplitN(prefix, ":", 3)
prefix = s[len(s)-1]
}
_, p, _ := net.ParseCIDR(prefix)
Expand Down
22 changes: 12 additions & 10 deletions docs/sources/zebra.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ version 4), 5.0.x (Zebra API version 5), and 7.0.x (Zebra API version
6) are supported as default. FRRouting version 5.0.x changes zebra
message and it doesn't keep backward compatibility for FRRouting
version 4.0.x although FRRouting version 4.0.x and 5.0.x use Zebra API
version 5. Also, FRRouting version 7.0.x changes zebra message and it
doesn't keep backward compatibility for FRRouting version 6.0.x
although FRRouting version 6.0.x and 7.0.x use Zebra API version 6. If
you need to integrate with FRRouting version 4.0.x or 6.0x, please use
`software-name` configuration.
version 5. Also, FRRouting version 7.0.x and 7.1.x changes zebra
message and it doesn't keep backward compatibility for FRRouting
version 6.0.x although FRRouting version 6.0.x, 7.0.x and 7.1.x use
Zebra API version 6. If you need to integrate with FRRouting version
4.0.x or 6.0x, please use `software-name` configuration.

## Contents

Expand Down Expand Up @@ -59,15 +59,17 @@ You need to enable the zebra feature in the Global configuration as follows.
For connecting to FRRouting 7.0.x, please specify `6`.

- `mpls-label-range-size` specifies mpls label range size for
requesting to Zebra. It works with FRRouting 5.0.x, FRRouting
6.0.x and FRRouting 7.0.x.
requesting to Zebra. It works with FRRouting 5.0.x, FRRouting 6.0.x,
FRRouting 7.0.x and FRRouting 7.1.x.

- `sotware-name` specifies software name for zebra when only `version`
configuration cannot specify software uniquely. This configuration
is used with 'version' configuration. For connecting to FRRouting
6.0.x, please specify `6` as `version` and `frr6` as
`software-name`. For connecting to FRRouting 4.0.x, please specify
`5` as `version` and `frr4` as `software-name`.
7.1.x, please specify `6` as `version` and `frr7.1` as
`software-name`. For connecting to FRRouting 6.0.x, please specify
`6` as `version` and `frr6` as `software-name`. For connecting to
FRRouting 4.0.x, please specify `5` as `version` and `frr4` as
`software-name`.

## Check Routes from zebra

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func setDefaultConfigValuesWithViper(v *viper.Viper, b *BgpConfigSet) error {
}

//SoftwareName for Zebra
allowableZebraSoftwareName := []string{"", "quagga", "frr3", "frr4", "frr5", "frr6", "frr7"}
allowableZebraSoftwareName := []string{"", "quagga", "frr3", "frr4", "frr5", "frr6", "frr7", "frr7.1"}
isAllowable := false
for _, allowable := range allowableZebraSoftwareName {
if b.Zebra.Config.SoftwareName == allowable {
Expand Down
Loading

0 comments on commit 7284d4c

Please sign in to comment.