summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-07-03 17:20:00 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-07-03 17:20:00 +0000
commit87cfe6e1e9ac329627ea8a97d6f5756ca6acb079 (patch)
tree2f284e8ba9618c7cf05143b38d6876c5aef8e362 /usr.sbin/bgpd/parse.y
parentf67a7215fd9cb58925ec5da43a2f29466f8ac6a0 (diff)
Switch mrt dumping to fd passing. This gives some speed up when extensive
dumping is done. Acctually mrt dumps were broken because of the fd passing. The nice side effect is a much cleaner code, especially in the parent process. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y34
1 files changed, 17 insertions, 17 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index a37537c017f..d970903d46c 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.116 2004/06/23 00:11:27 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.117 2004/07/03 17:19:59 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1573,44 +1573,44 @@ add_mrtconfig(enum mrt_type type, char *name, time_t timeout, struct peer *p)
{
struct mrt *m, *n;
- LIST_FOREACH(m, mrtconf, list) {
+ LIST_FOREACH(m, mrtconf, entry) {
if (p == NULL) {
- if (m->conf.peer_id != 0 || m->conf.group_id != 0)
+ if (m->peer_id != 0 || m->group_id != 0)
continue;
} else {
- if (m->conf.peer_id != p->conf.id ||
- m->conf.group_id != p->conf.groupid)
+ if (m->peer_id != p->conf.id ||
+ m->group_id != p->conf.groupid)
continue;
}
- if (m->conf.type == type) {
+ if (m->type == type) {
yyerror("only one mrtdump per type allowed.");
return (-1);
}
}
- if ((n = calloc(1, sizeof(struct mrt))) == NULL)
+ if ((n = calloc(1, sizeof(struct mrt_config))) == NULL)
fatal("add_mrtconfig");
- n->conf.type = type;
- n->msgbuf.fd = -1;
- if (strlcpy(n->name, name, sizeof(n->name)) >= sizeof(n->name)) {
+ n->type = type;
+ if (strlcpy(MRT2MC(n)->name, name, sizeof(MRT2MC(n)->name)) >=
+ sizeof(MRT2MC(n)->name)) {
yyerror("filename \"%s\" too long: max %u",
- name, sizeof(n->name) - 1);
+ name, sizeof(MRT2MC(n)->name) - 1);
free(n);
return (-1);
}
- n->ReopenTimerInterval = timeout;
+ MRT2MC(n)->ReopenTimerInterval = timeout;
if (p != NULL) {
if (curgroup == p) {
- n->conf.peer_id = 0;
- n->conf.group_id = p->conf.id;
+ n->peer_id = 0;
+ n->group_id = p->conf.id;
} else {
- n->conf.peer_id = p->conf.id;
- n->conf.group_id = 0;
+ n->peer_id = p->conf.id;
+ n->group_id = 0;
}
}
- LIST_INSERT_HEAD(mrtconf, n, list);
+ LIST_INSERT_HEAD(mrtconf, n, entry);
return (0);
}