summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2019-03-27 23:23:34 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2019-04-02 00:27:38 +0200
commit0d20cd94de79cf739659c8116d5f1e764dc50141 (patch)
tree6fb58bf77953eeb49803a91f659df484b086ae7f
parentdd1a92bdb013b4ff38d9c2e7aebf132eeb4a47fc (diff)
BGP: Fix empty tunnel encap
-rw-r--r--proto/bgp/attrs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index a27871bc..35ae4704 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -653,6 +653,12 @@ bgp_format_tunnel_encap(eattr *a, byte *buf, uint size)
{
char *pos = buf;
+ if (a->u.ptr->length == 0)
+ {
+ bsprintf(pos, "");
+ return;
+ }
+
for (uint i = 0; i < a->u.ptr->length; i++)
{
if (size < 4)