-/* $OpenBSD: parse.y,v 1.20 2014/11/20 05:51:20 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.21 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2006 Bob Beck <beck@openbsd.org>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.74 2018/07/09 12:05:10 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.75 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
len = strlen(s) - strlen(val) + 1;
if ((sym = malloc(len)) == NULL)
- err(1, "cmdline_symset: malloc");
+ err(1, "%s", __func__);
strlcpy(sym, s, len);
if (errno == ERANGE || !q || *q || mask > 128 || q == (p + 1))
errx(1, "host: invalid netmask '%s'", p);
if ((ps = malloc(strlen(s) - strlen(p) + 1)) == NULL)
- err(1, "host: calloc");
+ err(1, "%s", __func__);
strlcpy(ps, s, strlen(s) - strlen(p) + 1);
} else {
if ((ps = strdup(s)) == NULL)
- err(1, "host: strdup");
+ err(1, "%s", __func__);
mask = -1;
}
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_v6: calloc");
+ err(1, "%s", __func__);
ipa->af = res->ai_family;
memcpy(&ipa->address, res->ai_addr, sizeof(struct sockaddr_in6));
if (prefixlen > 128)
if (prefixlen != 128) {
ipa->netaddress = 1;
if (asprintf(&ipa->name, "%s/%d", hbuf, prefixlen) == -1)
- err(1, "host_v6: asprintf");
+ err(1, "%s", __func__);
} else {
if ((ipa->name = strdup(hbuf)) == NULL)
- err(1, "host_v6: strdup");
+ err(1, "%s", __func__);
}
freeaddrinfo(res);
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_v4: calloc");
+ err(1, "%s", __func__);
ina.sin_family = AF_INET;
ina.sin_len = sizeof(ina);
ipa->name = strdup(s);
if (ipa->name == NULL)
- err(1, "host_v4: strdup");
+ err(1, "%s", __func__);
ipa->af = AF_INET;
ipa->next = NULL;
ipa->tail = ipa;
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_dns: calloc");
+ err(1, "%s", __func__);
switch (res->ai_family) {
case AF_INET:
memcpy(&ipa->address, res->ai_addr,
err(1, "host_dns: getnameinfo");
ipa->name = strdup(hbuf);
if (ipa->name == NULL)
- err(1, "host_dns: strdup");
+ err(1, "%s", __func__);
ipa->af = res->ai_family;
ipa->next = NULL;
ipa->tail = ipa;
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_any: calloc");
+ err(1, "%s", __func__);
ipa->af = AF_UNSPEC;
ipa->netaddress = 1;
ipa->tail = ipa;
continue;
n = calloc(1, sizeof(struct ipsec_addr_wrap));
if (n == NULL)
- err(1, "ifa_load: calloc");
+ err(1, "%s", __func__);
n->af = ifa->ifa_addr->sa_family;
if ((n->name = strdup(ifa->ifa_name)) == NULL)
- err(1, "ifa_load: strdup");
+ err(1, "%s", __func__);
if (n->af == AF_INET) {
sa_in = (struct sockaddr_in *)ifa->ifa_addr;
memcpy(&n->address, sa_in, sizeof(*sa_in));
len = ifgr.ifgr_len;
if ((ifgr.ifgr_groups = calloc(1, len)) == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1)
err(1, "ioctl");
continue;
n = calloc(1, sizeof(struct ipsec_addr_wrap));
if (n == NULL)
- err(1, "ifa_lookup: calloc");
+ err(1, "%s", __func__);
memcpy(n, p, sizeof(struct ipsec_addr_wrap));
if ((n->name = strdup(p->name)) == NULL)
- err(1, "ifa_lookup: strdup");
+ err(1, "%s", __func__);
switch (n->af) {
case AF_INET:
set_ipmask(n, 32);
*dst = recallocarray(*dst, *ndst,
*ndst + 1, sizeof(struct iked_transform));
if (*dst == NULL)
- err(1, "copy_transforms: recallocarray");
+ err(1, "%s", __func__);
b = *dst + (*ndst)++;
b->xform_type = type;
*dst = recallocarray(*dst, *ndst,
*ndst + 1, sizeof(struct iked_transform));
if (*dst == NULL)
- err(1, "copy_transforms: recallocarray");
+ err(1, "%s", __func__);
b = *dst + (*ndst)++;
memcpy(b, a, sizeof(*b));
}
if (ike_sa == NULL || ike_sa->nxfs == 0) {
if ((p = calloc(1, sizeof(*p))) == NULL)
- err(1, "create_ike: calloc");
+ err(1, "%s", __func__);
p->prop_id = ikepropid++;
p->prop_protoid = IKEV2_SAPROTO_IKE;
p->prop_nxforms = ikev2_default_nike_transforms;
} else {
for (i = 0; i < ike_sa->nxfs; i++) {
if ((p = calloc(1, sizeof(*p))) == NULL)
- err(1, "create_ike: calloc");
+ err(1, "%s", __func__);
xf = NULL;
xfi = 0;
if (ipsec_sa == NULL || ipsec_sa->nxfs == 0) {
if ((p = calloc(1, sizeof(*p))) == NULL)
- err(1, "create_ike: calloc");
+ err(1, "%s", __func__);
p->prop_id = ipsecpropid++;
p->prop_protoid = saproto;
p->prop_nxforms = ikev2_default_nesp_transforms;
}
if ((p = calloc(1, sizeof(*p))) == NULL)
- err(1, "create_ike: calloc");
+ err(1, "%s", __func__);
xf = NULL;
xfi = 0;
-/* $OpenBSD: parse.y,v 1.172 2018/07/09 12:05:10 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.173 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
len = strlen(s) - strlen(val) + 1;
if ((sym = malloc(len)) == NULL)
- err(1, "cmdline_symset: malloc");
+ err(1, "%s", __func__);
strlcpy(sym, s, len);
key = calloc(1, sizeof(struct ipsec_key));
if (key == NULL)
- err(1, "parsekey: calloc");
+ err(1, "%s", __func__);
key->len = len / 2;
key->data = calloc(key->len, sizeof(u_int8_t));
if (key->data == NULL)
- err(1, "parsekey: calloc");
+ err(1, "%s", __func__);
for (i = 0; i < (int)key->len; i++)
key->data[i] = x2i(hexkey + 2 * i);
errx(1, "%s: key too %s", filename, sb.st_size ? "large" :
"small");
if ((hex = calloc(sb.st_size, sizeof(unsigned char))) == NULL)
- err(1, "parsekeyfile: calloc");
+ err(1, "%s", __func__);
if (read(fd, hex, sb.st_size) < sb.st_size)
err(1, "parsekeyfile: read");
close(fd);
if (errno == ERANGE || !q || *q || mask > 128 || q == (p + 1))
errx(1, "host: invalid netmask '%s'", p);
if ((ps = malloc(strlen(s) - strlen(p) + 1)) == NULL)
- err(1, "host: calloc");
+ err(1, "%s", __func__);
strlcpy(ps, s, strlen(s) - strlen(p) + 1);
} else {
if ((ps = strdup(s)) == NULL)
- err(1, "host: strdup");
+ err(1, "%s", __func__);
mask = -1;
}
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_v6: calloc");
+ err(1, "%s", __func__);
ipa->af = res->ai_family;
memcpy(&ipa->address.v6,
&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr,
if (prefixlen != 128) {
ipa->netaddress = 1;
if (asprintf(&ipa->name, "%s/%d", hbuf, prefixlen) == -1)
- err(1, "host_v6: asprintf");
+ err(1, "%s", __func__);
} else {
if ((ipa->name = strdup(hbuf)) == NULL)
- err(1, "host_v6: strdup");
+ err(1, "%s", __func__);
}
freeaddrinfo(res);
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_v4: calloc");
+ err(1, "%s", __func__);
ipa->address.v4 = ina;
ipa->name = strdup(s);
if (ipa->name == NULL)
- err(1, "host_v4: strdup");
+ err(1, "%s", __func__);
ipa->af = AF_INET;
ipa->next = NULL;
ipa->tail = ipa;
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_dns: calloc");
+ err(1, "%s", __func__);
switch (res->ai_family) {
case AF_INET:
memcpy(&ipa->address.v4,
err(1, "host_dns: getnameinfo");
ipa->name = strdup(hbuf);
if (ipa->name == NULL)
- err(1, "host_dns: strdup");
+ err(1, "%s", __func__);
ipa->af = res->ai_family;
ipa->next = NULL;
ipa->tail = ipa;
ipa = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa == NULL)
- err(1, "host_any: calloc");
+ err(1, "%s", __func__);
ipa->af = AF_UNSPEC;
ipa->netaddress = 1;
ipa->tail = ipa;
continue;
n = calloc(1, sizeof(struct ipsec_addr_wrap));
if (n == NULL)
- err(1, "ifa_load: calloc");
+ err(1, "%s", __func__);
n->af = ifa->ifa_addr->sa_family;
if ((n->name = strdup(ifa->ifa_name)) == NULL)
- err(1, "ifa_load: strdup");
+ err(1, "%s", __func__);
if (n->af == AF_INET) {
n->af = AF_INET;
memcpy(&n->address.v4, &((struct sockaddr_in *)
len = ifgr.ifgr_len;
if ((ifgr.ifgr_groups = calloc(1, len)) == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1)
err(1, "ioctl");
continue;
n = calloc(1, sizeof(struct ipsec_addr_wrap));
if (n == NULL)
- err(1, "ifa_lookup: calloc");
+ err(1, "%s", __func__);
memcpy(n, p, sizeof(struct ipsec_addr_wrap));
if ((n->name = strdup(p->name)) == NULL)
- err(1, "ifa_lookup: strdup");
+ err(1, "%s", __func__);
switch (n->af) {
case AF_INET:
set_ipmask(n, 32);
life = calloc(1, sizeof(struct ipsec_lifetime));
if (life == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
life->lt_seconds = seconds;
life->lt_bytes = -1;
newxfs = calloc(1, sizeof(struct ipsec_transforms));
if (newxfs == NULL)
- err(1, "copytransforms: calloc");
+ err(1, "%s", __func__);
memcpy(newxfs, xfs, sizeof(struct ipsec_transforms));
return (newxfs);
newlife = calloc(1, sizeof(struct ipsec_lifetime));
if (newlife == NULL)
- err(1, "copylife: calloc");
+ err(1, "%s", __func__);
memcpy(newlife, life, sizeof(struct ipsec_lifetime));
return (newlife);
return (NULL);
if ((newauth = calloc(1, sizeof(struct ipsec_auth))) == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
if (auth->srcid &&
asprintf(&newauth->srcid, "%s", auth->srcid) == -1)
- err(1, "asprintf");
+ err(1, "%s", __func__);
if (auth->dstid &&
asprintf(&newauth->dstid, "%s", auth->dstid) == -1)
- err(1, "asprintf");
+ err(1, "%s", __func__);
newauth->srcid_type = auth->srcid_type;
newauth->dstid_type = auth->dstid_type;
return (NULL);
if ((newauth = calloc(1, sizeof(struct ike_auth))) == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
if (auth->string &&
asprintf(&newauth->string, "%s", auth->string) == -1)
- err(1, "asprintf");
+ err(1, "%s", __func__);
newauth->type = auth->type;
return (NULL);
if ((newkey = calloc(1, sizeof(struct ipsec_key))) == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
if ((newkey->data = calloc(key->len, sizeof(u_int8_t))) == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
memcpy(newkey->data, key->data, key->len);
newkey->len = key->len;
dst = calloc(1, sizeof(struct ipsec_addr_wrap));
if (dst == NULL)
- err(1, "copyhost: calloc");
+ err(1, "%s", __func__);
memcpy(dst, src, sizeof(struct ipsec_addr_wrap));
if (src->name != NULL && (dst->name = strdup(src->name)) == NULL)
- err(1, "copyhost: strdup");
+ err(1, "%s", __func__);
return dst;
}
if (src == NULL)
return (NULL);
if ((tag = strdup(src)) == NULL)
- err(1, "copytag: strdup");
+ err(1, "%s", __func__);
return (tag);
}
struct ipsec_rule *r;
if ((r = calloc(1, sizeof(struct ipsec_rule))) == NULL)
- err(1, "calloc");
+ err(1, "%s", __func__);
r->src = copyhost(rule->src);
r->dst = copyhost(rule->dst);
r = calloc(1, sizeof(struct ipsec_rule));
if (r == NULL)
- err(1, "create_sa: calloc");
+ err(1, "%s", __func__);
r->type |= RULE_SA;
r->satype = satype;
reverse = calloc(1, sizeof(struct ipsec_rule));
if (reverse == NULL)
- err(1, "reverse_sa: calloc");
+ err(1, "%s", __func__);
reverse->type |= RULE_SA;
reverse->satype = rule->satype;
r = calloc(1, sizeof(struct ipsec_rule));
if (r == NULL)
- err(1, "create_sabundle: calloc");
+ err(1, "%s", __func__);
r->type |= RULE_BUNDLE;
r = calloc(1, sizeof(struct ipsec_rule));
if (r == NULL)
- err(1, "create_flow: calloc");
+ err(1, "%s", __func__);
r->type |= RULE_FLOW;
r->auth = calloc(1, sizeof(struct ipsec_auth));
if (r->auth == NULL)
- err(1, "create_flow: calloc");
+ err(1, "%s", __func__);
r->auth->srcid = srcid;
r->auth->dstid = dstid;
r->auth->srcid_type = get_id_type(srcid);
ipa->af = AF_INET;
ipa->netaddress = 1;
if ((ipa->name = strdup("0.0.0.0/0")) == NULL)
- err(1, "expand_any: strdup");
+ err(1, "%s", __func__);
ipa->next = calloc(1, sizeof(struct ipsec_addr_wrap));
if (ipa->next == NULL)
- err(1, "expand_any: calloc");
+ err(1, "%s", __func__);
ipa->next->af = AF_INET6;
ipa->next->netaddress = 1;
if ((ipa->next->name = strdup("::/0")) == NULL)
- err(1, "expand_any: strdup");
+ err(1, "%s", __func__);
ipa->next->next = oldnext;
}
reverse = calloc(1, sizeof(struct ipsec_rule));
if (reverse == NULL)
- err(1, "reverse_rule: calloc");
+ err(1, "%s", __func__);
reverse->type |= RULE_FLOW;
if (rule->auth) {
reverse->auth = calloc(1, sizeof(struct ipsec_auth));
if (reverse->auth == NULL)
- err(1, "reverse_rule: calloc");
+ err(1, "%s", __func__);
if (rule->auth->dstid && (reverse->auth->dstid =
strdup(rule->auth->dstid)) == NULL)
- err(1, "reverse_rule: strdup");
+ err(1, "%s", __func__);
if (rule->auth->srcid && (reverse->auth->srcid =
strdup(rule->auth->srcid)) == NULL)
- err(1, "reverse_rule: strdup");
+ err(1, "%s", __func__);
reverse->auth->srcid_type = rule->auth->srcid_type;
reverse->auth->dstid_type = rule->auth->dstid_type;
reverse->auth->type = rule->auth->type;
r = calloc(1, sizeof(struct ipsec_rule));
if (r == NULL)
- err(1, "create_ike: calloc");
+ err(1, "%s", __func__);
r->type = RULE_IKE;
r->auth = calloc(1, sizeof(struct ipsec_auth));
if (r->auth == NULL)
- err(1, "create_ike: calloc");
+ err(1, "%s", __func__);
r->auth->srcid = srcid;
r->auth->dstid = dstid;
r->auth->srcid_type = get_id_type(srcid);
r->auth->dstid_type = get_id_type(dstid);
r->ikeauth = calloc(1, sizeof(struct ike_auth));
if (r->ikeauth == NULL)
- err(1, "create_ike: calloc");
+ err(1, "%s", __func__);
r->ikeauth->type = authtype->type;
r->ikeauth->string = authtype->string;
r->tag = tag;
-/* $OpenBSD: parse.y,v 1.678 2018/07/10 09:30:49 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.679 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
char *p, *q;
if ((tmp = calloc(1, len)) == NULL)
- err(1, "expand_label_str: calloc");
+ err(1, "%s", __func__);
p = q = label;
while ((q = strstr(p, srch)) != NULL) {
*q = '\0';
if (src_host->addr.type == PF_ADDR_DYNIFTL) {
osrch = src_host;
if ((src_host = gen_dynnode(src_host, r->af)) == NULL)
- err(1, "expand_rule: calloc");
+ err(1, "%s", __func__);
}
if (dst_host->addr.type == PF_ADDR_DYNIFTL) {
odsth = dst_host;
if ((dst_host = gen_dynnode(dst_host, r->af)) == NULL)
- err(1, "expand_rule: calloc");
+ err(1, "%s", __func__);
}
error += check_netmask(src_host, r->af);
rb.direction = PF_IN;
if ((srch = calloc(1, sizeof(*srch))) == NULL)
- err(1, "expand_rule: calloc");
+ err(1, "%s", __func__);
bcopy(src_host, srch, sizeof(*srch));
srch->ifname = NULL;
srch->next = NULL;
srch->tail = NULL;
if ((dsth = calloc(1, sizeof(*dsth))) == NULL)
- err(1, "expand_rule: calloc");
+ err(1, "%s", __func__);
bcopy(&rb.nat.addr, &dsth->addr, sizeof(dsth->addr));
dsth->ifname = NULL;
dsth->next = NULL;
bzero(&binat, sizeof(binat));
if ((binat.rdr =
calloc(1, sizeof(*binat.rdr))) == NULL)
- err(1, "expand_rule: calloc");
+ err(1, "%s", __func__);
bcopy(nat->rdr, binat.rdr, sizeof(*binat.rdr));
bcopy(&nat->pool_opts, &binat.pool_opts,
sizeof(binat.pool_opts));
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
case '!':
next = lgetc(0);
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
return (-1);
if ((sym = malloc(strlen(s) - strlen(val) + 1)) == NULL)
- err(1, "pfctl_cmdline_symset: malloc");
+ err(1, "%s", __func__);
strlcpy(sym, s, strlen(s) - strlen(val) + 1);
/* table nonexistent */
return 0;
}
- err(1, "sysctl");
+ err(1, "%s", __func__);
}
if (info.rti_domainid == rdomain) {
found[rdomain] = 1;
-/* $OpenBSD: parse.y,v 1.26 2017/01/02 01:40:20 tedu Exp $ */
+/* $OpenBSD: parse.y,v 1.27 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
}
}
if ((str = strdup(buf)) == NULL)
- err(1, "strdup");
+ err(1, "%s", __func__);
yylval.str = str;
return TSTRING;
-/* $OpenBSD: parse.y,v 1.24 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.25 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(EXIT_FAILURE, "yylex: strdup");
+ err(EXIT_FAILURE, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING) {
if ((yylval.v.string = strdup(buf)) == NULL)
- err(EXIT_FAILURE, "yylex: strdup");
+ err(EXIT_FAILURE, "%s", __func__);
}
return (token);
}
struct sym *sym, *next;
if ((conf = calloc(1, sizeof(struct acme_conf))) == NULL)
- err(EXIT_FAILURE, "parse_config");
+ err(EXIT_FAILURE, "%s", __func__);
conf->opts = opts;
if ((file = pushfile(filename)) == NULL) {
if (a)
return (NULL);
if ((a = calloc(1, sizeof(struct authority_c))) == NULL)
- err(EXIT_FAILURE, "calloc");
+ err(EXIT_FAILURE, "%s", __func__);
TAILQ_INSERT_TAIL(&c->authority_list, a, entry);
a->name = s;
if (d)
return (NULL);
if ((d = calloc(1, sizeof(struct domain_c))) == NULL)
- err(EXIT_FAILURE, "calloc");
+ err(EXIT_FAILURE, "%s", __func__);
TAILQ_INSERT_TAIL(&c->domain_list, d, entry);
d->domain = s;
}
if ((k = calloc(1, sizeof(struct keyfile))) == NULL)
- err(EXIT_FAILURE, "calloc");
+ err(EXIT_FAILURE, "%s", __func__);
LIST_INSERT_HEAD(&c->used_key_list, k, entry);
k->name = s;
-/* $OpenBSD: parse.y,v 1.35 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.36 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.26 2018/07/10 16:42:12 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.27 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.57 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.58 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
-/* $OpenBSD: parse.y,v 1.104 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.105 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.51 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.52 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
struct ifsd_state *state;
if ((conf = calloc(1, sizeof(struct ifsd_config))) == NULL) {
- err(1, NULL);
+ err(1, "%s", __func__);
return (NULL);
}
len = strlen(s) - strlen(val) + 1;
if ((sym = malloc(len)) == NULL)
- err(1, NULL);
+ err(1, "%s", __func__);
strlcpy(sym, s, len);
TAILQ_INIT(&state->external_tests);
if ((state->init = calloc(1, sizeof(*state->init))) == NULL)
- err(1, "init_state: calloc");
+ err(1, "%s", __func__);
state->init->type = IFSD_ACTION_CONDITION;
TAILQ_INIT(&state->init->act.c.actions);
if ((state->body = calloc(1, sizeof(*state->body))) == NULL)
- err(1, "init_state: calloc");
+ err(1, "%s", __func__);
state->body->type = IFSD_ACTION_CONDITION;
TAILQ_INIT(&state->body->act.c.actions);
}
break;
if (ifstate == NULL) {
if ((ifstate = calloc(1, sizeof(*ifstate))) == NULL)
- err(1, NULL);
+ err(1, "%s", __func__);
if (strlcpy(ifstate->ifname, ifname,
sizeof(ifstate->ifname)) >= sizeof(ifstate->ifname))
errx(1, "ifname strlcpy truncation");
break;
if (external == NULL) {
if ((external = calloc(1, sizeof(*external))) == NULL)
- err(1, NULL);
+ err(1, "%s", __func__);
if ((external->command = strdup(command)) == NULL)
- err(1, NULL);
+ err(1, "%s", __func__);
external->frequency = frequency;
TAILQ_INIT(&external->expressions);
TAILQ_INSERT_TAIL(&state->external_tests, external, entries);
-/* $OpenBSD: parse.y,v 1.14 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.15 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.31 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.32 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martinh@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
-/* $OpenBSD: parse.y,v 1.64 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.65 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2013, 2015, 2016 Renato Westphal <renato@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.2 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.3 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
len = strlen(s) - strlen(val) + 1;
if ((sym = malloc(len)) == NULL)
- errx(1, "cmdline_symset: malloc");
+ errx(1, "%s", __func__);
(void)strlcpy(sym, s, len);
-/* $OpenBSD: parse.y,v 1.34 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.35 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
errx(1, "invalid netmask: %s", errstr);
if ((ps = malloc(strlen(s) - strlen(p) + 1)) == NULL)
- err(1, "parse_prefix: malloc");
+ err(1, "%s", __func__);
strlcpy(ps, s, strlen(s) - strlen(p) + 1);
if (host(ps, addr) == 0) {
-/* $OpenBSD: parse.y,v 1.90 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.91 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.225 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.226 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.40 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.41 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.215 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.216 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.50 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.51 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
-/* $OpenBSD: parse.y,v 1.9 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.10 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
-/* $OpenBSD: parse.y,v 1.38 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.39 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
if (file->ungetpos >= file->ungetsize) {
void *p = reallocarray(file->ungetbuf, file->ungetsize, 2);
if (p == NULL)
- err(1, "lungetc");
+ err(1, "%s", __func__);
file->ungetbuf = p;
file->ungetsize *= 2;
}
-/* $OpenBSD: parse.y,v 1.27 2018/07/09 12:05:11 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.28 2018/07/11 07:39:22 krw Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
}
yylval.v.string = strdup(buf);
if (yylval.v.string == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (STRING);
}
*p = '\0';
if ((token = lookup(buf)) == STRING)
if ((yylval.v.string = strdup(buf)) == NULL)
- err(1, "yylex: strdup");
+ err(1, "%s", __func__);
return (token);
}
if (c == '\n') {
len = strlen(s) - strlen(val) + 1;
if ((sym = malloc(len)) == NULL)
- errx(1, "cmdline_symset: malloc");
+ errx(1, "%s", __func__);
(void)strlcpy(sym, s, len);