From 87c63a8a0273645c70e251abb1af7c2d3e9263b3 Mon Sep 17 00:00:00 2001
From: Christoph Petrausch <christoph.petrausch@inovex.de>
Date: Tue, 29 May 2018 12:32:01 +0200
Subject: [PATCH] Added missing mandatory LocalPref

---
 protocols/bgp/server/update_sender.go          | 4 ++++
 protocols/bgp/server/update_sender_add_path.go | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/protocols/bgp/server/update_sender.go b/protocols/bgp/server/update_sender.go
index a5d05887..b1bdd471 100644
--- a/protocols/bgp/server/update_sender.go
+++ b/protocols/bgp/server/update_sender.go
@@ -41,6 +41,10 @@ func (u *UpdateSender) AddPath(pfx net.Prefix, p *route.Path) error {
 				Next: &packet.PathAttribute{
 					TypeCode: packet.NextHopAttr,
 					Value:    p.BGPPath.NextHop,
+					Next: &packet.PathAttribute{
+						TypeCode: packet.LocalPrefAttr,
+						Value:    p.BGPPath.LocalPref,
+					},
 				},
 			},
 		},
diff --git a/protocols/bgp/server/update_sender_add_path.go b/protocols/bgp/server/update_sender_add_path.go
index e7b46577..755e9c73 100644
--- a/protocols/bgp/server/update_sender_add_path.go
+++ b/protocols/bgp/server/update_sender_add_path.go
@@ -41,6 +41,10 @@ func (u *UpdateSenderAddPath) AddPath(pfx net.Prefix, p *route.Path) error {
 				Next: &packet.PathAttribute{
 					TypeCode: packet.NextHopAttr,
 					Value:    p.BGPPath.NextHop,
+					Next: &packet.PathAttribute{
+						TypeCode: packet.LocalPrefAttr,
+						Value:    p.BGPPath.LocalPref,
+					},
 				},
 			},
 		},
-- 
GitLab