summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index c6317892..f8153dd0 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -21,6 +21,7 @@
#include "lib/resource.h"
#include "lib/string.h"
#include "lib/unaligned.h"
+#include "lib/tunnel_encaps.h"
#include "bgp.h"
@@ -919,23 +920,9 @@ bgp_format_tunnel_encap(const 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)
- {
- bsprintf(pos, "...");
- return;
- }
-
- uint l = bsprintf(pos, "%02x ", a->u.ptr->data[i]);
+ int l = format_tunnel_encap(a, pos, size);
+ if (l > 0)
ADVANCE(pos, size, l);
- }
}
static void