summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/bgpd.h3
-rw-r--r--usr.sbin/bgpd/log.c4
-rw-r--r--usr.sbin/bgpd/parse.y12
3 files changed, 9 insertions, 10 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index b213e871951..9f469cb798d 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.281 2013/11/13 09:14:48 florian Exp $ */
+/* $OpenBSD: bgpd.h,v 1.282 2014/11/03 16:55:59 bluhm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -957,6 +957,7 @@ struct in6_addr *prefixlen2mask6(u_int8_t prefixlen);
/* log.c */
void log_init(int);
void log_verbose(int);
+void logit(int, const char *, ...);
void vlog(int, const char *, va_list);
void log_peer_warn(const struct peer_config *, const char *, ...);
void log_peer_warnx(const struct peer_config *, const char *, ...);
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c
index 0273113e778..3ce9df6615b 100644
--- a/usr.sbin/bgpd/log.c
+++ b/usr.sbin/bgpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.57 2013/01/10 09:56:57 sthen Exp $ */
+/* $OpenBSD: log.c,v 1.58 2014/11/03 16:55:59 bluhm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -34,8 +34,6 @@
int debug;
int verbose;
-void logit(int, const char *, ...);
-
char *
log_fmt_peer(const struct peer_config *peer)
{
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index ad1a0bcbc22..e0b06f8d6a1 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.273 2014/11/02 00:30:41 doug Exp $ */
+/* $OpenBSD: parse.y,v 1.274 2014/11/03 16:55:59 bluhm Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2099,15 +2099,15 @@ int
yyerror(const char *fmt, ...)
{
va_list ap;
- char *nfmt;
+ char *msg;
file->errors++;
va_start(ap, fmt);
- if (asprintf(&nfmt, "%s:%d: %s", file->name, yylval.lineno, fmt) == -1)
- fatalx("yyerror asprintf");
- vlog(LOG_CRIT, nfmt, ap);
+ if (vasprintf(&msg, fmt, ap) == -1)
+ fatalx("yyerror vasprintf");
va_end(ap);
- free(nfmt);
+ logit(LOG_CRIT, "%s:%d: %s", file->name, yylval.lineno, msg);
+ free(msg);
return (0);
}