summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-10-05 11:47:42 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-10-05 11:47:42 +0000
commitb493d438815f29d6cf656b969f5efdf00f7ae8d9 (patch)
tree1aa9f0d36308ef700d1ae3683dc3e9dbea3878f1
parent1ba2fc776609851cbade609a580b57f03fcea59d (diff)
reject an all zero bgpid, following a similar suggestion from
pascal.gloor@spale.com
-rw-r--r--usr.sbin/bgpd/session.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 1c383e21ef9..d0f2184e976 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.193 2004/09/22 08:46:28 henning Exp $ */
+/* $OpenBSD: session.c,v 1.194 2004/10/05 11:47:41 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1697,15 +1697,15 @@ parse_open(struct peer *peer)
memcpy(&bgpid, p, sizeof(bgpid));
p += sizeof(bgpid);
- /* check bgpid for validity, must be a valid ip address - HOW? */
- /* if ( bgpid invalid ) {
+ /* check bgpid for validity - just disallow 0 */
+ if (ntohl(bgpid) == 0) {
log_peer_warnx(&peer->conf, "peer BGPID %lu unacceptable",
ntohl(bgpid));
session_notification(peer, ERR_OPEN, ERR_OPEN_BGPID,
NULL, 0);
change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN);
return (-1);
- } */
+ }
peer->remote_bgpid = bgpid;
memcpy(&optparamlen, p, sizeof(optparamlen));