summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorTatsushi Demachi <tdemachi@gmail.com>2017-02-10 20:38:17 +0900
committerTatsushi Demachi <tdemachi@gmail.com>2017-02-10 20:57:11 +0900
commite84bf755a9740d5bca3405da494d3c4a85d30679 (patch)
tree295c691d7537bacbb00a232a91f2724b763bb20f /server
parent3703916e558624e383794b015b8f8e69422654c1 (diff)
zebra: Process per-route MTU zebra message
Since Quagga 1.0.20160309, it implements per-route MTU handling which adds MTU attribute to every ZEBRA_IPV4_ROUTE_ADD and ZEBRA_IPV6_ROUTE_ADD messages. It causes "message length invalid" error when GoBGP receives messages from Zebra and as the result, routes from Zebra are no longer added to GoBGP. This fixes the issue by decoding/encoding MTU attribute properly. Now parsed MTU attribute is not used anywhere, just kept in an internal structure.
Diffstat (limited to 'server')
-rw-r--r--server/zclient.go1
-rw-r--r--server/zclient_test.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/server/zclient.go b/server/zclient.go
index 3f8627c3..df92f038 100644
--- a/server/zclient.go
+++ b/server/zclient.go
@@ -138,6 +138,7 @@ func createPathFromIPRouteMessage(m *zebra.Message) *table.Path {
"IfIndex": body.Ifindexs,
"Metric": body.Metric,
"Distance": body.Distance,
+ "Mtu": body.Mtu,
"api": header.Command.String(),
}).Debugf("create path from ip route message.")
diff --git a/server/zclient_test.go b/server/zclient_test.go
index 7338adcb..d15155c9 100644
--- a/server/zclient_test.go
+++ b/server/zclient_test.go
@@ -38,7 +38,7 @@ func Test_createRequestFromIPRouteMessage(t *testing.T) {
b := &zebra.IPRouteBody{
Type: zebra.ROUTE_TYPE(zebra.ROUTE_STATIC),
Flags: zebra.FLAG(zebra.FLAG_SELECTED),
- Message: zebra.MESSAGE_NEXTHOP | zebra.MESSAGE_DISTANCE | zebra.MESSAGE_METRIC,
+ Message: zebra.MESSAGE_NEXTHOP | zebra.MESSAGE_DISTANCE | zebra.MESSAGE_METRIC | zebra.MESSAGE_MTU,
SAFI: zebra.SAFI(zebra.SAFI_UNICAST),
Prefix: net.ParseIP("192.168.100.0"),
PrefixLength: uint8(24),
@@ -46,6 +46,7 @@ func Test_createRequestFromIPRouteMessage(t *testing.T) {
Ifindexs: []uint32{1},
Distance: uint8(0),
Metric: uint32(100),
+ Mtu: uint32(0),
Api: zebra.API_TYPE(zebra.IPV4_ROUTE_ADD),
}