Skip to content

Commit

Permalink
packet/bgp: Use ESI str in EVPN Ethernet Segment Route
Browse files Browse the repository at this point in the history
This patch fixes to use the string representation of ESI in the string
representation of EVPN Ethernet Segment Route.
Currently, displayed in the default representation of ESI structure.

Signed-off-by: IWASE Yusuke <[email protected]>
  • Loading branch information
iwaseyusuke authored and fujita committed Nov 21, 2017
1 parent 794a164 commit 517a943
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/sources/evpn.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ GoBGP will receive these four routes and re-advertise them to YABGP peer on "10.
$ gobgp global rib -a evpn
Network Labels Next Hop AS_PATH Age Attrs
*> [type:A-D][rd:1.1.1.1:32867][esi:single-homed][etag:100] [161] 10.75.44.254 hh:mm:ss [{Extcomms: [esi-label: 8001]} {Origin: i} {LocalPref: 100}]
*> [type:esi][rd:172.16.0.1:8888][esi:{0 [0 0 0 0 0 0 0 0 0]}][ip:192.168.0.1] 10.75.44.254 hh:mm:ss [{Extcomms: [es-import rt: 00:11:22:33:44:55]} {Origin: i} {LocalPref: 100}]
*> [type:esi][rd:172.16.0.1:8888][esi:single-homed][ip:192.168.0.1] 10.75.44.254 hh:mm:ss [{Extcomms: [es-import rt: 00:11:22:33:44:55]} {Origin: i} {LocalPref: 100}]
*> [type:macadv][rd:172.17.0.3:2][etag:108][mac:00:11:22:33:44:55][ip:11.11.11.1] [0] 10.75.44.254 hh:mm:ss [{Extcomms: [mac-mobility: 500, sticky]} {Origin: i} {LocalPref: 100} [ESI: single-homed]]
*> [type:multicast][rd:172.16.0.1:5904][etag:100][ip:192.168.0.1] 10.75.44.254 hh:mm:ss [{Origin: i} {LocalPref: 100}]
```
Expand Down
2 changes: 1 addition & 1 deletion packet/bgp/bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,7 @@ func (er *EVPNEthernetSegmentRoute) String() string {
// For the purpose of BGP route key processing, only the Ethernet
// Segment ID, IP Address Length, and Originating Router's IP Address
// fields are considered to be part of the prefix in the NLRI.
return fmt.Sprintf("[type:esi][rd:%s][esi:%d][ip:%s]", er.RD, er.ESI, er.IPAddress)
return fmt.Sprintf("[type:esi][rd:%s][esi:%s][ip:%s]", er.RD, er.ESI.String(), er.IPAddress)
}

func (er *EVPNEthernetSegmentRoute) MarshalJSON() ([]byte, error) {
Expand Down

0 comments on commit 517a943

Please sign in to comment.