summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2009-12-10 21:47:12 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2009-12-10 21:47:12 +0000
commit7087808ac9347b578dd299097b324aeb14d3ec63 (patch)
tree9299694b160f611098306fe505aa1852d98f0724 /usr.sbin
parentf3d337bc9e9b86de5ea2f5505aa21461f404dd2b (diff)
Length of the host address in the FEC TLV must be encoded in number
of octets. ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ldpd/labelmapping.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c
index ba0da8ae593..c36cbc3d644 100644
--- a/usr.sbin/ldpd/labelmapping.c
+++ b/usr.sbin/ldpd/labelmapping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: labelmapping.c,v 1.2 2009/06/05 22:34:45 michele Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.3 2009/12/10 21:47:11 michele Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -481,12 +481,14 @@ gen_fec_tlv(struct buf *buf, u_int32_t prefix, u_int8_t prefixlen)
buf_add(buf, &ft, sizeof(ft));
- if (prefixlen == 32)
+ if (prefixlen == 32) {
type = FEC_ADDRESS;
- else
+ len = prefixlen/8;
+ } else {
type = FEC_PREFIX;
+ len = prefixlen;
+ }
family = htons(FEC_IPV4);
- len = prefixlen;
addr = prefix;
buf_add(buf, &type, sizeof(type));