diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-25 18:21:19 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-25 18:21:19 +0000 |
commit | 2e474eb74ee16139713346307d0b9f750bb16512 (patch) | |
tree | d786f7350b830cf1382549b30d3f44cc7becd3e1 /usr.sbin/bgpd | |
parent | 45d571d0ff10364e91baf98a590a3a961a5c27ff (diff) |
reserve upper half of the (internal) ID space for cloned neighbors, claudio ok
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/parse.y | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.c | 4 |
2 files changed, 4 insertions, 4 deletions
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 <henning@openbsd.org> @@ -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 <henning@openbsd.org> @@ -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 */ |