From owner-svn-ports-head@FreeBSD.ORG Mon Oct 21 17:18:39 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3702B7EE; Mon, 21 Oct 2013 17:18:39 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 225792740; Mon, 21 Oct 2013 17:18:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LHIduT029952; Mon, 21 Oct 2013 17:18:39 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9LHIadR029940; Mon, 21 Oct 2013 17:18:36 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201310211718.r9LHIadR029940@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 Oct 2013 17:18:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r331159 - in head/net: bird bird/files bird6 bird6/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 17:18:39 -0000 Author: melifaro (src committer) Date: Mon Oct 21 17:18:36 2013 New Revision: 331159 URL: http://svnweb.freebsd.org/changeset/ports/331159 Log: Add some patches from net/bird git repo: * merge PID support (4+6) * merge correct limit checking (4+6) * merge some OSPF fixes (4+6) * merge BSD P2P masks fix (4) Approved by: az Added: head/net/bird/files/patch-netst-proto.c (contents, props changed) head/net/bird/files/patch-proto-ospf-hello.c (contents, props changed) head/net/bird/files/patch-proto-ospf-lsupd.c (contents, props changed) head/net/bird/files/patch-sysdep-bsd-krt-sock.c (contents, props changed) head/net/bird/files/patch-sysdep-unix-main.c (contents, props changed) head/net/bird6/files/patch-netst-proto.c (contents, props changed) head/net/bird6/files/patch-proto-ospf-lsupd.c (contents, props changed) head/net/bird6/files/patch-sysdep-unix-main.c (contents, props changed) Modified: head/net/bird/Makefile head/net/bird/files/agg_support.patch head/net/bird6/Makefile Modified: head/net/bird/Makefile ============================================================================== --- head/net/bird/Makefile Mon Oct 21 17:15:40 2013 (r331158) +++ head/net/bird/Makefile Mon Oct 21 17:18:36 2013 (r331159) @@ -3,7 +3,7 @@ PORTNAME= bird PORTVERSION= 1.3.11 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= ftp://bird.network.cz/pub/bird/ \ http://bird.mpls.in/distfiles/bird/ @@ -13,8 +13,7 @@ COMMENT= Dynamic IP routing daemon (IPv4 LICENSE= GPLv2 -USES= bison -USE_GMAKE= yes +USES= bison gmake GNU_CONFIGURE= yes CONFIGURE_ARGS= --localstatedir=/var USE_CSTD= gnu89 Modified: head/net/bird/files/agg_support.patch ============================================================================== --- head/net/bird/files/agg_support.patch Mon Oct 21 17:15:40 2013 (r331158) +++ head/net/bird/files/agg_support.patch Mon Oct 21 17:18:36 2013 (r331159) @@ -2793,3 +2793,19 @@ index ac6f7a8..4d4dba5 100644 -- 1.7.3.2 +--- configure.orig 2012-08-07 13:28:04.000000000 +0400 ++++ configure 2012-08-15 15:54:05.000000000 +0400 +@@ -2355,11 +2355,11 @@ + if test "$enable_ipv6" = yes ; then + ip=ipv6 + SUFFIX=6 +- all_protocols=bgp,ospf,pipe,radv,rip,static ++ all_protocols=bgp,ospf,pipe,radv,rip,static,agg + else + ip=ipv4 + SUFFIX="" +- all_protocols=bgp,ospf,pipe,rip,static ++ all_protocols=bgp,ospf,pipe,rip,static,agg + fi + + if test "$given_suffix" = yes ; then Added: head/net/bird/files/patch-netst-proto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird/files/patch-netst-proto.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,51 @@ +diff --git a/nest/proto.c b/nest/proto.c +index 60495aa..140ec94 100644 +--- nest/proto.c ++++ nest/proto.c +@@ -376,6 +376,7 @@ int proto_reconfig_type; /* Hack to propagate type info to pipe reconfigure hoo + static int + proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config *nc, int type) + { ++ struct announce_hook *ah = p->main_ahook; + /* If the protocol is DOWN, we just restart it */ + if (p->proto_state == PS_DOWN) + return 0; +@@ -407,14 +408,31 @@ proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config + + /* Update filters and limits in the main announce hook + Note that this also resets limit state */ +- if (p->main_ahook) ++ if (ah) + { +- p->main_ahook->in_filter = nc->in_filter; +- p->main_ahook->out_filter = nc->out_filter; +- p->main_ahook->rx_limit = nc->rx_limit; +- p->main_ahook->in_limit = nc->in_limit; +- p->main_ahook->out_limit = nc->out_limit; +- p->main_ahook->in_keep_filtered = nc->in_keep_filtered; ++ ah->in_filter = nc->in_filter; ++ ah->out_filter = nc->out_filter; ++ ah->rx_limit = nc->rx_limit; ++ ah->in_limit = nc->in_limit; ++ ah->out_limit = nc->out_limit; ++ ah->in_keep_filtered = nc->in_keep_filtered; ++ ++ if (p->proto_state == PS_UP) /* Recheck export/import/receive limit */ ++ { ++ struct proto_stats *stats = ah->stats; ++ struct proto_limit *l = ah->in_limit; ++ u32 all_routes = stats->imp_routes + stats->filt_routes; ++ ++ if (l && (stats->imp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_IN, stats->imp_routes); ++ ++ l = ah->rx_limit; ++ ++ if (l && ( all_routes >= l->limit)) proto_notify_limit(ah, l, PLD_RX, all_routes ); ++ ++ l = ah->out_limit; ++ ++ if (l && ( stats->exp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_OUT, stats->exp_routes); ++ } + } + + /* Update routes when filters changed. If the protocol in not UP, Added: head/net/bird/files/patch-proto-ospf-hello.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird/files/patch-proto-ospf-hello.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,31 @@ +diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c +index d5aa1b9..58e87bb 100644 +--- proto/ospf/hello.c ++++ proto/ospf/hello.c +@@ -101,6 +101,17 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa, + return; + } + ++#ifdef OSPFv2 ++ if (n && (n->rid != ntohl(ps_i->routerid))) ++ { ++ OSPF_TRACE(D_EVENTS, ++ "Neighbor %I has changed router id from %R to %R.", ++ n->ip, n->rid, ntohl(ps_i->routerid)); ++ ospf_neigh_remove(n); ++ n = NULL; ++ } ++#endif ++ + if (!n) + { + if ((ifa->type == OSPF_IT_NBMA) || (ifa->type == OSPF_IT_PTMP)) +@@ -132,7 +143,7 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa, + + n = ospf_neighbor_new(ifa); + +- n->rid = ntohl(((struct ospf_packet *) ps)->routerid); ++ n->rid = ntohl(ps_i->routerid); + n->ip = faddr; + n->dr = ntohl(ps->dr); + n->bdr = ntohl(ps->bdr); Added: head/net/bird/files/patch-proto-ospf-lsupd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird/files/patch-proto-ospf-lsupd.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,22 @@ +diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c +index a5da425..b19f261 100644 +--- proto/ospf/lsupd.c ++++ proto/ospf/lsupd.c +@@ -205,7 +205,7 @@ ospf_lsupd_flood(struct proto_ospf *po, + en->lsa_body = NULL; + DBG("Removing from lsreq list for neigh %R\n", nn->rid); + ospf_hash_delete(nn->lsrqh, en); +- if (EMPTY_SLIST(nn->lsrql)) ++ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING)) + ospf_neigh_sm(nn, INM_LOADDONE); + continue; + break; +@@ -216,7 +216,7 @@ ospf_lsupd_flood(struct proto_ospf *po, + en->lsa_body = NULL; + DBG("Removing from lsreq list for neigh %R\n", nn->rid); + ospf_hash_delete(nn->lsrqh, en); +- if (EMPTY_SLIST(nn->lsrql)) ++ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING)) + ospf_neigh_sm(nn, INM_LOADDONE); + break; + default: Added: head/net/bird/files/patch-sysdep-bsd-krt-sock.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird/files/patch-sysdep-bsd-krt-sock.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,54 @@ +diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c +index 08dfccc..3d30036 100644 +--- sysdep/bsd/krt-sock.c ++++ sysdep/bsd/krt-sock.c +@@ -676,22 +676,18 @@ krt_read_addr(struct ks_msg *msg) + + #ifdef IPV6 + /* Clean up embedded interface ID returned in link-local address */ ++ + if (ipa_has_link_scope(ifa.ip)) + _I0(ifa.ip) = 0xfe800000; +-#endif + +-#ifdef IPV6 +- /* Why not the same check also for IPv4? */ +- if ((iface->flags & IF_MULTIACCESS) || (masklen != BITS_PER_IP_ADDRESS)) +-#else +- if (iface->flags & IF_MULTIACCESS) ++ if (ipa_has_link_scope(ifa.brd)) ++ _I0(ifa.brd) = 0xfe800000; + #endif ++ ++ if (masklen < BITS_PER_IP_ADDRESS) + { + ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen)); + +- if (masklen == BITS_PER_IP_ADDRESS) +- ifa.flags |= IA_HOST; +- + if (masklen == (BITS_PER_IP_ADDRESS - 1)) + ifa.opposite = ipa_opposite_m1(ifa.ip); + +@@ -699,11 +695,19 @@ krt_read_addr(struct ks_msg *msg) + if (masklen == (BITS_PER_IP_ADDRESS - 2)) + ifa.opposite = ipa_opposite_m2(ifa.ip); + #endif ++ ++ if (!(iface->flags & IF_MULTIACCESS)) ++ ifa.opposite = ifa.brd; + } +- else /* PtP iface */ ++ else if (!(iface->flags & IF_MULTIACCESS) && ipa_nonzero(ifa.brd)) + { +- ifa.flags |= IA_PEER; + ifa.prefix = ifa.opposite = ifa.brd; ++ ifa.flags |= IA_PEER; ++ } ++ else ++ { ++ ifa.prefix = ifa.ip; ++ ifa.flags |= IA_HOST; + } + + if (new) Added: head/net/bird/files/patch-sysdep-unix-main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird/files/patch-sysdep-unix-main.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,118 @@ +diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c +index bd80ba2..c7db7c8 100644 +--- sysdep/unix/main.c ++++ sysdep/unix/main.c +@@ -473,6 +473,58 @@ cli_init_unix(uid_t use_uid, gid_t use_gid) + } + + /* ++ * PID file ++ */ ++ ++static char *pid_file; ++static int pid_fd; ++ ++static inline void ++open_pid_file(void) ++{ ++ if (!pid_file) ++ return; ++ ++ pid_fd = open(pid_file, O_WRONLY|O_CREAT, 0664); ++ if (pid_fd < 0) ++ die("Cannot create PID file %s: %m", pid_file); ++} ++ ++static inline void ++write_pid_file(void) ++{ ++ int pl, rv; ++ char ps[24]; ++ ++ if (!pid_file) ++ return; ++ ++ /* We don't use PID file for uniqueness, so no need for locking */ ++ ++ pl = bsnprintf(ps, sizeof(ps), "%ld\n", (long) getpid()); ++ if (pl < 0) ++ bug("PID buffer too small"); ++ ++ rv = ftruncate(pid_fd, 0); ++ if (rv < 0) ++ die("fruncate: %m"); ++ ++ rv = write(pid_fd, ps, pl); ++ if(rv < 0) ++ die("write: %m"); ++ ++ close(pid_fd); ++} ++ ++static inline void ++unlink_pid_file(void) ++{ ++ if (pid_file) ++ unlink(pid_file); ++} ++ ++ ++/* + * Shutdown + */ + +@@ -496,6 +548,7 @@ async_shutdown(void) + void + sysdep_shutdown_done(void) + { ++ unlink_pid_file(); + unlink(path_control_socket); + log_msg(L_FATAL "Shutdown completed"); + exit(0); +@@ -548,7 +601,7 @@ signal_init(void) + * Parsing of command-line arguments + */ + +-static char *opt_list = "c:dD:ps:u:g:"; ++static char *opt_list = "c:dD:ps:P:u:g:"; + static int parse_and_exit; + char *bird_name; + static char *use_user; +@@ -557,7 +610,7 @@ static char *use_group; + static void + usage(void) + { +- fprintf(stderr, "Usage: %s [-c ] [-d] [-D ] [-p] [-s ] [-u ] [-g ]\n", bird_name); ++ fprintf(stderr, "Usage: %s [-c ] [-d] [-D ] [-p] [-s ] [-P ] [-u ] [-g ]\n", bird_name); + exit(1); + } + +@@ -656,6 +709,9 @@ parse_args(int argc, char **argv) + case 's': + path_control_socket = optarg; + break; ++ case 'P': ++ pid_file = optarg; ++ break; + case 'u': + use_user = optarg; + break; +@@ -709,6 +765,9 @@ main(int argc, char **argv) + if (use_uid) + drop_uid(use_uid); + ++ if (!parse_and_exit) ++ open_pid_file(); ++ + protos_build(); + proto_build(&proto_unix_kernel); + proto_build(&proto_unix_iface); +@@ -733,6 +792,8 @@ main(int argc, char **argv) + dup2(0, 2); + } + ++ write_pid_file(); ++ + signal_init(); + + #ifdef LOCAL_DEBUG Modified: head/net/bird6/Makefile ============================================================================== --- head/net/bird6/Makefile Mon Oct 21 17:15:40 2013 (r331158) +++ head/net/bird6/Makefile Mon Oct 21 17:18:36 2013 (r331159) @@ -3,6 +3,7 @@ PORTNAME= bird6 PORTVERSION= 1.3.11 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= ftp://bird.network.cz/pub/bird/ \ http://bird.mpls.in/distfiles/bird/ @@ -13,8 +14,7 @@ COMMENT= Dynamic IP routing daemon (IPv6 LICENSE= GPLv2 -USES= bison -USE_GMAKE= yes +USES= bison gmake GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-ipv6 --localstatedir=/var USE_CSTD= gnu89 Added: head/net/bird6/files/patch-netst-proto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird6/files/patch-netst-proto.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,51 @@ +diff --git a/nest/proto.c b/nest/proto.c +index 60495aa..140ec94 100644 +--- nest/proto.c ++++ nest/proto.c +@@ -376,6 +376,7 @@ int proto_reconfig_type; /* Hack to propagate type info to pipe reconfigure hoo + static int + proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config *nc, int type) + { ++ struct announce_hook *ah = p->main_ahook; + /* If the protocol is DOWN, we just restart it */ + if (p->proto_state == PS_DOWN) + return 0; +@@ -407,14 +408,31 @@ proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config + + /* Update filters and limits in the main announce hook + Note that this also resets limit state */ +- if (p->main_ahook) ++ if (ah) + { +- p->main_ahook->in_filter = nc->in_filter; +- p->main_ahook->out_filter = nc->out_filter; +- p->main_ahook->rx_limit = nc->rx_limit; +- p->main_ahook->in_limit = nc->in_limit; +- p->main_ahook->out_limit = nc->out_limit; +- p->main_ahook->in_keep_filtered = nc->in_keep_filtered; ++ ah->in_filter = nc->in_filter; ++ ah->out_filter = nc->out_filter; ++ ah->rx_limit = nc->rx_limit; ++ ah->in_limit = nc->in_limit; ++ ah->out_limit = nc->out_limit; ++ ah->in_keep_filtered = nc->in_keep_filtered; ++ ++ if (p->proto_state == PS_UP) /* Recheck export/import/receive limit */ ++ { ++ struct proto_stats *stats = ah->stats; ++ struct proto_limit *l = ah->in_limit; ++ u32 all_routes = stats->imp_routes + stats->filt_routes; ++ ++ if (l && (stats->imp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_IN, stats->imp_routes); ++ ++ l = ah->rx_limit; ++ ++ if (l && ( all_routes >= l->limit)) proto_notify_limit(ah, l, PLD_RX, all_routes ); ++ ++ l = ah->out_limit; ++ ++ if (l && ( stats->exp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_OUT, stats->exp_routes); ++ } + } + + /* Update routes when filters changed. If the protocol in not UP, Added: head/net/bird6/files/patch-proto-ospf-lsupd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird6/files/patch-proto-ospf-lsupd.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,22 @@ +diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c +index a5da425..b19f261 100644 +--- proto/ospf/lsupd.c ++++ proto/ospf/lsupd.c +@@ -205,7 +205,7 @@ ospf_lsupd_flood(struct proto_ospf *po, + en->lsa_body = NULL; + DBG("Removing from lsreq list for neigh %R\n", nn->rid); + ospf_hash_delete(nn->lsrqh, en); +- if (EMPTY_SLIST(nn->lsrql)) ++ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING)) + ospf_neigh_sm(nn, INM_LOADDONE); + continue; + break; +@@ -216,7 +216,7 @@ ospf_lsupd_flood(struct proto_ospf *po, + en->lsa_body = NULL; + DBG("Removing from lsreq list for neigh %R\n", nn->rid); + ospf_hash_delete(nn->lsrqh, en); +- if (EMPTY_SLIST(nn->lsrql)) ++ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING)) + ospf_neigh_sm(nn, INM_LOADDONE); + break; + default: Added: head/net/bird6/files/patch-sysdep-unix-main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird6/files/patch-sysdep-unix-main.c Mon Oct 21 17:18:36 2013 (r331159) @@ -0,0 +1,118 @@ +diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c +index bd80ba2..c7db7c8 100644 +--- sysdep/unix/main.c ++++ sysdep/unix/main.c +@@ -473,6 +473,58 @@ cli_init_unix(uid_t use_uid, gid_t use_gid) + } + + /* ++ * PID file ++ */ ++ ++static char *pid_file; ++static int pid_fd; ++ ++static inline void ++open_pid_file(void) ++{ ++ if (!pid_file) ++ return; ++ ++ pid_fd = open(pid_file, O_WRONLY|O_CREAT, 0664); ++ if (pid_fd < 0) ++ die("Cannot create PID file %s: %m", pid_file); ++} ++ ++static inline void ++write_pid_file(void) ++{ ++ int pl, rv; ++ char ps[24]; ++ ++ if (!pid_file) ++ return; ++ ++ /* We don't use PID file for uniqueness, so no need for locking */ ++ ++ pl = bsnprintf(ps, sizeof(ps), "%ld\n", (long) getpid()); ++ if (pl < 0) ++ bug("PID buffer too small"); ++ ++ rv = ftruncate(pid_fd, 0); ++ if (rv < 0) ++ die("fruncate: %m"); ++ ++ rv = write(pid_fd, ps, pl); ++ if(rv < 0) ++ die("write: %m"); ++ ++ close(pid_fd); ++} ++ ++static inline void ++unlink_pid_file(void) ++{ ++ if (pid_file) ++ unlink(pid_file); ++} ++ ++ ++/* + * Shutdown + */ + +@@ -496,6 +548,7 @@ async_shutdown(void) + void + sysdep_shutdown_done(void) + { ++ unlink_pid_file(); + unlink(path_control_socket); + log_msg(L_FATAL "Shutdown completed"); + exit(0); +@@ -548,7 +601,7 @@ signal_init(void) + * Parsing of command-line arguments + */ + +-static char *opt_list = "c:dD:ps:u:g:"; ++static char *opt_list = "c:dD:ps:P:u:g:"; + static int parse_and_exit; + char *bird_name; + static char *use_user; +@@ -557,7 +610,7 @@ static char *use_group; + static void + usage(void) + { +- fprintf(stderr, "Usage: %s [-c ] [-d] [-D ] [-p] [-s ] [-u ] [-g ]\n", bird_name); ++ fprintf(stderr, "Usage: %s [-c ] [-d] [-D ] [-p] [-s ] [-P ] [-u ] [-g ]\n", bird_name); + exit(1); + } + +@@ -656,6 +709,9 @@ parse_args(int argc, char **argv) + case 's': + path_control_socket = optarg; + break; ++ case 'P': ++ pid_file = optarg; ++ break; + case 'u': + use_user = optarg; + break; +@@ -709,6 +765,9 @@ main(int argc, char **argv) + if (use_uid) + drop_uid(use_uid); + ++ if (!parse_and_exit) ++ open_pid_file(); ++ + protos_build(); + proto_build(&proto_unix_kernel); + proto_build(&proto_unix_iface); +@@ -733,6 +792,8 @@ main(int argc, char **argv) + dup2(0, 2); + } + ++ write_pid_file(); ++ + signal_init(); + + #ifdef LOCAL_DEBUG