-/* $OpenBSD: bgpctl.c,v 1.281 2022/07/28 10:40:25 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.282 2022/08/17 15:16:12 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
if (pledge("stdio", NULL) == -1)
err(1, "pledge");
- bzero(&ribreq, sizeof(ribreq));
+ memset(&ribreq, 0, sizeof(ribreq));
if (res->as.type != AS_UNDEF)
ribreq.as = res->as;
if (res->addr.aid) {
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
err(1, "control_init: socket");
- bzero(&sa_un, sizeof(sa_un));
+ memset(&sa_un, 0, sizeof(sa_un));
sa_un.sun_family = AF_UNIX;
if (strlcpy(sa_un.sun_path, sockname, sizeof(sa_un.sun_path)) >=
sizeof(sa_un.sun_path))
NULL, 0);
break;
case SHOW_RIB:
- bzero(&ribreq, sizeof(ribreq));
+ memset(&ribreq, 0, sizeof(ribreq));
type = IMSG_CTL_SHOW_RIB;
if (res->addr.aid) {
ribreq.prefix = res->addr;
break;
case NETWORK_ADD:
case NETWORK_REMOVE:
- bzero(&net, sizeof(net));
+ memset(&net, 0, sizeof(net));
net.prefix = res->addr;
net.prefixlen = res->prefixlen;
net.rd = res->rd;
done = 1;
break;
case NETWORK_SHOW:
- bzero(&ribreq, sizeof(ribreq));
+ memset(&ribreq, 0, sizeof(ribreq));
ribreq.aid = res->aid;
strlcpy(ribreq.rib, res->rib, sizeof(ribreq.rib));
imsg_compose(ibuf, IMSG_CTL_SHOW_NETWORK, 0, 0, -1,
&ribreq, sizeof(ribreq));
break;
case NETWORK_MRT:
- bzero(&ribreq, sizeof(ribreq));
+ memset(&ribreq, 0, sizeof(ribreq));
if (res->as.type != AS_UNDEF)
ribreq.as = res->as;
if (res->addr.aid) {
/* Stop processing after a comment */
if (*b == '#')
break;
- bzero(&net, sizeof(net));
+ memset(&net, 0, sizeof(net));
if (parse_prefix(b, strlen(b), &h, &len) != 1)
errx(1, "bad prefix: %s", b);
net.prefix = h;
for (i = 0; i < mr->nentries; i++) {
mre = &mr->entries[i];
- bzero(&ctl, sizeof(ctl));
+ memset(&ctl, 0, sizeof(ctl));
ctl.prefix = mr->prefix;
ctl.prefixlen = mr->prefixlen;
if (mre->originated <= now)
now = time(NULL);
for (i = 0; i < mr->nentries; i++) {
mre = &mr->entries[i];
- bzero(&ctl, sizeof(ctl));
+ memset(&ctl, 0, sizeof(ctl));
ctl.prefix = mr->prefix;
ctl.prefixlen = mr->prefixlen;
if (mre->originated <= now)
!match_aspath(mre->aspath, mre->aspath_len, &req->as))
continue;
- bzero(&net, sizeof(net));
+ memset(&net, 0, sizeof(net));
net.prefix = ctl.prefix;
net.prefixlen = ctl.prefixlen;
net.type = NETWORK_MRTCLONE;
-/* $OpenBSD: parser.c,v 1.113 2022/06/22 12:27:46 claudio Exp $ */
+/* $OpenBSD: parser.c,v 1.114 2022/08/17 15:16:12 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
const struct token *table = t_main;
const struct token *match;
- bzero(&res, sizeof(res));
+ memset(&res, 0, sizeof(res));
res.rtableid = getrtable();
TAILQ_INIT(&res.set);
if (word == NULL)
return (0);
- bzero(addr, sizeof(struct bgpd_addr));
- bzero(&ina, sizeof(ina));
+ memset(addr, 0, sizeof(struct bgpd_addr));
+ memset(&ina, 0, sizeof(ina));
if (inet_net_pton(AF_INET, word, &ina, sizeof(ina)) != -1) {
addr->aid = AID_INET;
return (1);
}
- bzero(&hints, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = AI_NUMERICHOST;
if (word == NULL)
return (0);
- bzero(addr, sizeof(struct bgpd_addr));
+ memset(addr, 0, sizeof(struct bgpd_addr));
if ((p = strrchr(word, '/')) != NULL) {
size_t plen = strlen(p);