summaryrefslogtreecommitdiff
path: root/usr.sbin/mrouted
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-21 02:07:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-21 02:07:33 +0000
commitb6541c8fb2bf7a1d6480b19e3db8264680805b17 (patch)
treeb0a496dfa7335b609f85fa1ae5ec0d4a7ea3a678 /usr.sbin/mrouted
parentcacb390022ee8379c88381aa734bb8bcf1466b28 (diff)
since stdlib.h is in scope, don't cast.... you know the drill.
no sneakiness detected by krw
Diffstat (limited to 'usr.sbin/mrouted')
-rw-r--r--usr.sbin/mrouted/callout.c2
-rw-r--r--usr.sbin/mrouted/cfparse.y4
-rw-r--r--usr.sbin/mrouted/prune.c6
-rw-r--r--usr.sbin/mrouted/route.c6
-rw-r--r--usr.sbin/mrouted/rsrr.c4
-rw-r--r--usr.sbin/mrouted/vif.c8
6 files changed, 15 insertions, 15 deletions
diff --git a/usr.sbin/mrouted/callout.c b/usr.sbin/mrouted/callout.c
index d3c24357675..283f01bdc6f 100644
--- a/usr.sbin/mrouted/callout.c
+++ b/usr.sbin/mrouted/callout.c
@@ -95,7 +95,7 @@ timer_setTimer(int delay, cfunc_t action, char *data)
in_callout = 1;
/* create a node */
- node = (struct timeout_q *)malloc(sizeof(struct timeout_q));
+ node = malloc(sizeof(struct timeout_q));
if (node == 0) {
logit(LOG_WARNING, 0, "Malloc Failed in timer_settimer\n");
in_callout = 0;
diff --git a/usr.sbin/mrouted/cfparse.y b/usr.sbin/mrouted/cfparse.y
index fe259b1c3e2..9269812d323 100644
--- a/usr.sbin/mrouted/cfparse.y
+++ b/usr.sbin/mrouted/cfparse.y
@@ -246,7 +246,7 @@ ifmod : mod
struct phaddr *ph;
- ph = (struct phaddr *)malloc(sizeof(struct phaddr));
+ ph = malloc(sizeof(struct phaddr));
if (ph == NULL)
fatal("out of memory");
if ($2.mask) {
@@ -300,7 +300,7 @@ mod : THRESHOLD NUMBER { if ($2 < 1 || $2 > 255)
struct vif_acl *v_acl;
- v_acl = (struct vif_acl *)malloc(sizeof(struct vif_acl));
+ v_acl = malloc(sizeof(struct vif_acl));
if (v_acl == NULL)
fatal("out of memory");
VAL_TO_MASK(v_acl->acl_mask, $2.mask);
diff --git a/usr.sbin/mrouted/prune.c b/usr.sbin/mrouted/prune.c
index 2e4573bc615..3f0594ddce7 100644
--- a/usr.sbin/mrouted/prune.c
+++ b/usr.sbin/mrouted/prune.c
@@ -417,7 +417,7 @@ add_table_entry(u_int32_t origin, u_int32_t mcastgrp)
}
if (gt == NULL || gt->gt_mcastgrp != mcastgrp) {
- gt = (struct gtable *)malloc(sizeof(struct gtable));
+ gt = malloc(sizeof(struct gtable));
if (gt == NULL)
logit(LOG_ERR, 0, "ran out of memory");
@@ -498,7 +498,7 @@ add_table_entry(u_int32_t origin, u_int32_t mcastgrp)
}
if (st == NULL || st->st_origin != origin) {
- st = (struct stable *)malloc(sizeof(struct stable));
+ st = malloc(sizeof(struct stable));
if (st == NULL)
logit(LOG_ERR, 0, "ran out of memory");
@@ -988,7 +988,7 @@ accept_prune(u_int32_t src, u_int32_t dst, char *p, int datalen)
pt->pt_timer = prun_tmr;
} else {
/* allocate space for the prune structure */
- pt = (struct ptable *)(malloc(sizeof(struct ptable)));
+ pt = malloc(sizeof(struct ptable));
if (pt == NULL)
logit(LOG_ERR, 0, "pt: ran out of memory");
diff --git a/usr.sbin/mrouted/route.c b/usr.sbin/mrouted/route.c
index c13fecb32ca..9271eb2d122 100644
--- a/usr.sbin/mrouted/route.c
+++ b/usr.sbin/mrouted/route.c
@@ -283,9 +283,9 @@ create_route(u_int32_t origin, u_int32_t mask)
{
struct rtentry *r;
- if ((r = (struct rtentry *) malloc(sizeof(struct rtentry) +
- (2 * numvifs * sizeof(u_int32_t)) +
- (numvifs * sizeof(u_int)))) == NULL) {
+ if ((r = malloc(sizeof(struct rtentry) +
+ (2 * numvifs * sizeof(u_int32_t)) +
+ (numvifs * sizeof(u_int)))) == NULL) {
logit(LOG_ERR, 0, "ran out of memory"); /* fatal */
}
r->rt_origin = origin;
diff --git a/usr.sbin/mrouted/rsrr.c b/usr.sbin/mrouted/rsrr.c
index 252cdea2fea..b038a851003 100644
--- a/usr.sbin/mrouted/rsrr.c
+++ b/usr.sbin/mrouted/rsrr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsrr.c,v 1.13 2015/01/16 06:40:18 deraadt Exp $ */
+/* $OpenBSD: rsrr.c,v 1.14 2015/08/21 02:07:32 deraadt Exp $ */
/* $NetBSD: rsrr.c,v 1.3 1995/12/10 10:07:14 mycroft Exp $ */
/*
@@ -423,7 +423,7 @@ rsrr_cache(struct gtable *gt, struct rsrr_rq *route_query)
/* Cache entry doesn't already exist. Create one and insert at
* front of list.
*/
- rc = (struct rsrr_cache *) malloc(sizeof(struct rsrr_cache));
+ rc = malloc(sizeof(struct rsrr_cache));
if (rc == NULL)
logit(LOG_ERR, 0, "ran out of memory");
rc->route_query.source_addr.s_addr = route_query->source_addr.s_addr;
diff --git a/usr.sbin/mrouted/vif.c b/usr.sbin/mrouted/vif.c
index a427f427d56..be1baf52299 100644
--- a/usr.sbin/mrouted/vif.c
+++ b/usr.sbin/mrouted/vif.c
@@ -572,7 +572,7 @@ accept_group_report(u_int32_t src, u_int32_t dst, u_int32_t group,
* If not found, add it to the list and update kernel cache.
*/
if (g == NULL) {
- g = (struct listaddr *)malloc(sizeof(struct listaddr));
+ g = malloc(sizeof(struct listaddr));
if (g == NULL)
logit(LOG_ERR, 0, "ran out of memory"); /* fatal */
@@ -1049,7 +1049,7 @@ update_neighbor(vifi_t vifi, u_int32_t addr, int msgtype, char *p,
inet_fmt(addr, s1), vifi, level & 0xff, (level >> 8) & 0xff,
(level >> 16) & 0xff);
- n = (struct listaddr *)malloc(sizeof(struct listaddr));
+ n = malloc(sizeof(struct listaddr));
if (n == NULL)
logit(LOG_ERR, 0, "ran out of memory"); /* fatal */
@@ -1388,7 +1388,7 @@ SetTimer(int vifi, struct listaddr *g)
{
cbk_t *cbk;
- cbk = (cbk_t *) malloc(sizeof(cbk_t));
+ cbk = malloc(sizeof(cbk_t));
cbk->g = g;
cbk->vifi = vifi;
return timer_setTimer(g->al_timer, (cfunc_t)DelVif, (void *)cbk);
@@ -1428,7 +1428,7 @@ SetQueryTimer(struct listaddr *g, vifi_t vifi, int to_expire, int q_time)
{
cbk_t *cbk;
- cbk = (cbk_t *) malloc(sizeof(cbk_t));
+ cbk = malloc(sizeof(cbk_t));
cbk->g = g;
cbk->q_time = q_time;
cbk->vifi = vifi;