summaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6_rtr.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-01 16:39:31 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-01 16:39:31 +0000
commit5a93b7b14326715c9e05692f21723cbd2531f8ee (patch)
tree2679daadf708c6a77ae4f6ff29b583db5965079f /sys/netinet6/nd6_rtr.c
parent1d3a2c7615ad6b5663e200fe3e8a475ef3203245 (diff)
Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.
Diffstat (limited to 'sys/netinet6/nd6_rtr.c')
-rw-r--r--sys/netinet6/nd6_rtr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 447a408258f..3d38253cc2f 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.43 2007/05/28 23:07:13 pyr Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.44 2007/10/01 16:39:30 krw Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -782,12 +782,11 @@ defrtrlist_update(new)
return (NULL);
}
- n = (struct nd_defrouter *)malloc(sizeof(*n), M_IP6NDP, M_NOWAIT);
+ n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO);
if (n == NULL) {
splx(s);
return (NULL);
}
- bzero(n, sizeof(*n));
*n = *new;
insert:
@@ -838,10 +837,9 @@ pfxrtr_add(pr, dr)
{
struct nd_pfxrouter *new;
- new = (struct nd_pfxrouter *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT);
+ new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO);
if (new == NULL)
return;
- bzero(new, sizeof(*new));
new->router = dr;
LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry);
@@ -883,10 +881,9 @@ nd6_prelist_add(pr, dr, newp)
struct nd_prefix *new = NULL;
int i, s;
- new = (struct nd_prefix *)malloc(sizeof(*new), M_IP6NDP, M_NOWAIT);
+ new = malloc(sizeof(*new), M_IP6NDP, M_NOWAIT | M_ZERO);
if (new == NULL)
return ENOMEM;
- bzero(new, sizeof(*new));
*new = *pr;
if (newp != NULL)
*newp = new;