diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-06-10 10:02:22 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-06-10 10:02:22 +0000 |
commit | 04e4e4bef528b51cd37d0b19c865062f3de6852f (patch) | |
tree | 22544eed48de8bdf0a4bc625212e9a48f84be2d1 /usr.sbin | |
parent | 38bf32c05341b43c3f094cea79170097648de89f (diff) |
Make sure that the ATTR_EXTLEN flag is unset if the attribute length is
smaller than 255 bytes.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde_attr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 0a64a18f14c..1547d926572 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.47 2005/06/10 09:58:09 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.48 2005/06/10 10:02:21 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -40,8 +40,10 @@ attr_write(void *p, u_int16_t p_len, u_int8_t flags, u_int8_t type, if (data_len > 255) { tot_len += 2 + data_len; flags |= ATTR_EXTLEN; - } else + } else { tot_len += 1 + data_len; + flags &= ~ATTR_EXTLEN; + } if (tot_len > p_len) return (-1); |