From 2e474eb74ee16139713346307d0b9f750bb16512 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sun, 25 Apr 2004 18:21:19 +0000 Subject: reserve upper half of the (internal) ID space for cloned neighbors, claudio ok --- usr.sbin/bgpd/parse.y | 4 ++-- usr.sbin/bgpd/session.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.sbin/bgpd') diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 1dbae73d6e8..7857dd21434 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.81 2004/04/25 17:51:46 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.82 2004/04/25 18:21:18 henning Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -1361,7 +1361,7 @@ get_id(struct peer *newpeer) } /* new one */ - for (; id < UINT_MAX; id++) { + for (; id < UINT_MAX / 2; id++) { for (p = peer_l_old; p != NULL && p->conf.id != id; p = p->next) ; /* nothing */ if (p == NULL) { /* we found a free id */ diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 657bc0ebf5b..ab40ffe6e28 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.146 2004/04/25 08:06:00 henning Exp $ */ +/* $OpenBSD: session.c,v 1.147 2004/04/25 18:21:18 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -1912,7 +1912,7 @@ getpeerbyip(struct sockaddr *ip) if ((newpeer = malloc(sizeof(struct peer))) == NULL) fatal(NULL); memcpy(newpeer, loose, sizeof(struct peer)); - for (id = 1; id < UINT_MAX; id++) { + for (id = UINT_MAX; id > UINT_MAX / 2; id--) { for (p = peers; p != NULL && p->conf.id != id; p = p->next) ; /* nothing */ -- cgit v1.2.3