diff options
author | 2005-12-09 16:17:28 +0000 | |
---|---|---|
committer | 2005-12-09 16:17:28 +0000 | |
commit | bdd3e74200435c51241bd82eb7e9cb21a5f464bc (patch) | |
tree | c922887faf01cf28674732e7d5d0cffd7c54e648 | |
parent | license clean (diff) | |
download | wireguard-openbsd-bdd3e74200435c51241bd82eb7e9cb21a5f464bc.tar.xz wireguard-openbsd-bdd3e74200435c51241bd82eb7e9cb21a5f464bc.zip |
Unkown attributes need to be optional, if not issue a "unknown wellknown
attribute" error. While this check is already present in the error handling
function it is not done while parsing. Found via regress, OK henning@
-rw-r--r-- | usr.sbin/bgpd/rde.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 365b2de26bc..ae6c85440be 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.182 2005/12/08 16:02:56 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.183 2005/12/09 16:17:28 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1116,6 +1116,8 @@ rde_attr_parse(u_char *p, u_int16_t len, struct rde_aspath *a, int ebgp, plen += attr_len; break; default: + if ((flags & ATTR_OPTIONAL) == 0) + return (-1); optattr: if (attr_optadd(a, flags, type, p, attr_len) == -1) return (-1); |