diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-04-25 11:31:51 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-04-25 11:31:51 +0000 |
commit | 687b02bffd46cde3974e52e407655e55d0b8dd91 (patch) | |
tree | 420b889c54622b64f320de28a283848b6f91e0dc /usr.sbin/ospfd/ospfe.c | |
parent | 8a3e37bbfebdb078dce3df9a3f6397b5f95ac75d (diff) |
Call if_init() later and for each interface separately.
Move code from if_act_start() to if_init() that needs to be called only
once per interface. Especially event_set should be called only once as it
initializes struct event and so may cause corruption of the event queue if
called twice.
Diffstat (limited to 'usr.sbin/ospfd/ospfe.c')
-rw-r--r-- | usr.sbin/ospfd/ospfe.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c index 72db7f8d89b..a3b5688417d 100644 --- a/usr.sbin/ospfd/ospfe.c +++ b/usr.sbin/ospfd/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.16 2005/04/25 09:55:18 claudio Exp $ */ +/* $OpenBSD: ospfe.c,v 1.17 2005/04/25 11:31:50 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -104,9 +104,6 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2], if (if_set_tos(xconf->ospf_socket, IPTOS_PREC_INTERNETCONTROL) == -1) fatal("if_set_tos"); - if (if_init(xconf)) - fatalx("error initializing interfaces"); - oeconf = xconf; if ((pw = getpwnam(OSPFD_USER)) == NULL) @@ -173,6 +170,7 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2], /* start interfaces */ LIST_FOREACH(area, &oeconf->area_list, entry) { LIST_FOREACH(iface, &area->iface_list, entry) { + if_init(xconf, iface); if (if_fsm(iface, IF_EVT_UP)) { log_debug("error starting interface %s", iface->name); |