Skip to content

Commit

Permalink
Merge pull request #50 from markafarrell/fix/support-big-asn-on-32-bit
Browse files Browse the repository at this point in the history
Handle ASN > 2147483647 on 32-bit architectures
  • Loading branch information
gizmoguy committed Apr 21, 2024
2 parents 620b1df + ec1341b commit 3729f4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/exabgp/events.go
Expand Up @@ -77,15 +77,15 @@ func (e *Event) setAnnouncements(ra *Announcements) {
// Peer represents a neighbor and its state
type Peer struct {
IP string
ASN int
ASN uint32
State string
Reason string
}

// Self represents the local bgp instance
type Self struct {
IP string
ASN int
ASN uint32
}

// Announcements represents all the bgp `announce` messages
Expand Down
4 changes: 2 additions & 2 deletions pkg/exabgp/messages/jsonevent.go
Expand Up @@ -57,8 +57,8 @@ type Neighbor struct {
Peer string `json:"peer"`
} `json:"address"`
ASN struct {
Local int `json:"local"`
Peer int `json:"peer"`
Local uint32 `json:"local"`
Peer uint32 `json:"peer"`
} `json:"asn"`
Direction string `json:"direction"`
State string `json:"state"`
Expand Down
3 changes: 2 additions & 1 deletion pkg/exabgp/testdata/exabgp.log
Expand Up @@ -365,4 +365,5 @@
{ "exabgp": "4.0.1", "time": 1555358295.5599377, "host" : "db8beb8cd197", "pid" : 1161, "ppid" : 1137, "counter": 236, "type": "update", "neighbor": { "address": { "local": "127.0.0.1", "peer": "127.0.0.1" }, "asn": { "local": 64496, "peer": 64496 } , "direction": "send", "message": { "update": { "withdraw": { "ipv4 unicast": [ { "nlri": "192.168.88.248/29" } ] } } } } }
{ "exabgp": "4.0.1", "time": 1555383406.820952, "host" : "bc909a99ad83", "pid" : 58, "ppid" : 57, "counter": 162, "type": "update", "neighbor": { "address": { "local": "127.0.0.1", "peer": "127.0.0.1" }, "asn": { "local": 64496, "peer": 64496 } , "direction": "send", "message": { "update": { "attribute": { "origin": "igp", "local-preference": 100, "extended-community": [ { "value": 9225060888030898984, "string": "rate-limit:1000000000" }, { "value": 9225626697116680858, "string": "redirect:666:666" } ] }, "announce": { "ipv4 flow": { "no-nexthop": [ { "destination-ipv4": [ "192.168.88.96/29" ], "string": "flow destination-ipv4 192.168.88.96/29" } ] } } } } } }
{ "exabgp": "4.0.1", "time": 1555383382.099188, "host" : "bc909a99ad83", "pid" : 58, "ppid" : 57, "counter": 160, "type": "update", "neighbor": { "address": { "local": "127.0.0.1", "peer": "127.0.0.1" }, "asn": { "local": 64496, "peer": 64496 } , "direction": "send", "message": { "update": { "attribute": { "origin": "igp", "local-preference": 100, "extended-community": [ { "value": 9225060888030898984, "string": "rate-limit:1000000000" }, { "value": 9225626697116680858, "string": "redirect:666:666" } ] }, "withdraw": { "ipv4 flow": [ { "destination-ipv4": [ "192.168.88.96/29" ], "string": "flow destination-ipv4 192.168.88.96/29" } ] } } } } }
{ "exabgp": "4.0.1", "time": 1555437135.581991, "host" : "fed111dfb0e7", "pid" : 22, "ppid" : 20, "counter": 5, "type": "signal", "neighbor": { "address": { "local": "127.0.0.1", "peer": "127.0.0.1" }, "asn": { "local": 64496, "peer": 64496 } , "name": "UNKNOWN", "code": "0" } }
{ "exabgp": "4.0.1", "time": 1555437135.581991, "host" : "fed111dfb0e7", "pid" : 22, "ppid" : 20, "counter": 5, "type": "signal", "neighbor": { "address": { "local": "127.0.0.1", "peer": "127.0.0.1" }, "asn": { "local": 64496, "peer": 64496 } , "name": "UNKNOWN", "code": "0" } }
{ "exabgp": "4.0.1", "time": 1554851049.928668, "host" : "node1", "pid" : 8059, "ppid" : 1, "counter": 25, "type": "state", "neighbor": { "address": { "local": "192.168.1.184", "peer": "192.168.1.2" }, "asn": { "local": 2147483648, "peer": 2147483648 } , "state": "up" } }

0 comments on commit 3729f4a

Please sign in to comment.