summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/rde_attr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c
index 98279164539..f07f32d01e6 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.12 2004/02/19 23:07:00 claudio Exp $ */
+/* $OpenBSD: rde_attr.c,v 1.13 2004/02/23 16:46:24 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -78,6 +78,7 @@ attr_parse(u_char *p, u_int16_t len, struct attr_flags *a, int ebgp)
if (len - plen < 2)
return (-1);
UPD_READ(&attr_len, p, plen, 2);
+ attr_len = ntohs(attr_len);
} else {
UPD_READ(&tmp8, p, plen, 1);
attr_len = tmp8;
@@ -135,7 +136,8 @@ attr_parse(u_char *p, u_int16_t len, struct attr_flags *a, int ebgp)
return (-1);
if (ebgp) {
/* ignore local-pref attr for non ibgp peers */
- a->lpref = 0; /* set a default value */
+ a->lpref = 0; /* set a default value ... */
+ plen += 4; /* and ignore the real value */
break;
}
WFLAG(a->wflags, F_ATTR_LOCALPREF);