summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2009-05-05 20:09:20 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2009-05-05 20:09:20 +0000
commit4d6e74f4e0087e452992b3a457ad26d21ea3e740 (patch)
tree0ba91ecb443da6a42a3383e3d8696da0e5da7110 /usr.sbin/bgpd
parent82bccc14aa8f8a29c79d4d11eb5858aab0edddfd (diff)
check that an IMSG_CTL_SHOW_RIB_PREFIX request has a valid
address family before passing it to the RDE. ok henning@ claudio@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/control.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 41e6b29586c..e8097dda77f 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.60 2008/05/11 01:08:05 henning Exp $ */
+/* $OpenBSD: control.c,v 1.61 2009/05/05 20:09:19 sthen Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -396,6 +396,13 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt)
control_result(c, CTL_RES_NOCAP);
break;
}
+ if ((imsg.hdr.type == IMSG_CTL_SHOW_RIB_PREFIX)
+ && (ribreq->prefix.af != AF_INET)
+ && (ribreq->prefix.af != AF_INET6)) {
+ /* malformed request, must specify af */
+ control_result(c, CTL_RES_PARSE_ERROR);
+ break;
+ }
c->ibuf.pid = imsg.hdr.pid;
imsg_compose_rde(imsg.hdr.type, imsg.hdr.pid,
imsg.data, imsg.hdr.len - IMSG_HEADER_SIZE);