summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-12-12 16:02:50 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-12-12 16:02:50 +0000
commitaf6489ddb740cd0bd27092d5b9ef8fea60d5822d (patch)
tree11520a429d1e04b4598e9aaece098187131fa98b /usr.sbin
parent3ecfb0c06a0b417d9609d92240d681c014cc302f (diff)
Follow RFC 4271 more closely by sending the correct error back for optional
attributes and use the correct lenght in some other error cases. OK sthen@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/rde.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index c6944b30e43..07d7679d292 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.232 2008/06/15 10:03:46 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.233 2008/12/12 16:02:49 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1168,14 +1168,14 @@ bad_len:
if (!CHECK_FLAGS(flags, ATTR_WELL_KNOWN, 0)) {
bad_flags:
rde_update_err(peer, ERR_UPDATE, ERR_UPD_ATTRFLAGS,
- op, attr_len);
+ op, len);
return (-1);
}
UPD_READ(&a->origin, p, plen, 1);
if (a->origin > ORIGIN_INCOMPLETE) {
rde_update_err(peer, ERR_UPDATE, ERR_UPD_ORIGIN,
- op, attr_len);
+ op, len);
return (-1);
}
if (a->flags & F_ATTR_ORIGIN)
@@ -1222,7 +1222,7 @@ bad_flags:
tmp32 = ntohl(nexthop.v4.s_addr);
if (IN_MULTICAST(tmp32) || IN_BADCLASS(tmp32)) {
rde_update_err(peer, ERR_UPDATE, ERR_UPD_NETWORK,
- op, attr_len);
+ op, len);
return (-1);
}
a->nexthop = nexthop_get(&nexthop);
@@ -1348,8 +1348,8 @@ bad_flags:
goto bad_flags;
if (aspath_verify(p, attr_len, 1) != 0) {
/* XXX draft does not specify how to handle errors */
- rde_update_err(peer, ERR_UPDATE, ERR_UPD_ASPATH,
- NULL, 0);
+ rde_update_err(peer, ERR_UPDATE, ERR_UPD_OPTATTR,
+ op, len);
return (-1);
}
a->flags |= F_ATTR_AS4BYTE_NEW;