Serguey Parkhomovsky wrote:
> Fixes implicit memcpy declarations by using string.h instead of
> strings.h, and removes strings.h from files that don't need it. Also,
> change bzero(3) to memset(3).

Thanks for this.

I just took care of the existing implicit declarations. Below is a diff
for the rest. I think you might have missed a couple bzero's.

I'll look into the include removals soon. In a rush at the moment.

ok?


Index: control.c
===================================================================
RCS file: /cvs/src/usr.sbin/dvmrpd/control.c,v
retrieving revision 1.21
diff -u -p -r1.21 control.c
--- control.c   5 Dec 2015 13:11:00 -0000       1.21
+++ control.c   7 Dec 2015 19:03:15 -0000
@@ -52,7 +52,7 @@ control_init(void)
                return (-1);
        }
 
-       bzero(&sun, sizeof(sun));
+       memset(&sun, 0, sizeof(sun));
        sun.sun_family = AF_UNIX;
        strlcpy(sun.sun_path, DVMRPD_SOCKET, sizeof(sun.sun_path));
 
Index: igmp.c
===================================================================
RCS file: /cvs/src/usr.sbin/dvmrpd/igmp.c,v
retrieving revision 1.3
diff -u -p -r1.3 igmp.c
--- igmp.c      18 Nov 2014 20:54:28 -0000      1.3
+++ igmp.c      7 Dec 2015 19:03:15 -0000
@@ -51,7 +51,7 @@ send_igmp_query(struct iface *iface, str
                fatal("send_igmp_query");
 
        /* IGMP header */
-       bzero(&igmp_hdr, sizeof(igmp_hdr));
+       memset(&igmp_hdr, 0, sizeof(igmp_hdr));
        igmp_hdr.type = PKT_TYPE_MEMBER_QUERY;
 
        if (group == NULL) {
Index: kroute.c
===================================================================
RCS file: /cvs/src/usr.sbin/dvmrpd/kroute.c,v
retrieving revision 1.12
diff -u -p -r1.12 kroute.c
--- kroute.c    27 Sep 2015 17:29:46 -0000      1.12
+++ kroute.c    7 Dec 2015 19:03:15 -0000
@@ -136,7 +136,7 @@ kif_find(int ifindex)
 {
        struct kif_node s;
 
-       bzero(&s, sizeof(s));
+       memset(&s, 0, sizeof(s));
        s.k.ifindex = ifindex;
 
        return (RB_FIND(kif_tree, &kit, &s));
Index: packet.c
===================================================================
RCS file: /cvs/src/usr.sbin/dvmrpd/packet.c,v
retrieving revision 1.4
diff -u -p -r1.4 packet.c
--- packet.c    7 Dec 2015 18:59:31 -0000       1.4
+++ packet.c    7 Dec 2015 19:03:15 -0000
@@ -48,7 +48,7 @@ gen_dvmrp_hdr(struct ibuf *buf, struct i
 {
        struct dvmrp_hdr        dvmrp_hdr;
 
-       bzero(&dvmrp_hdr, sizeof(dvmrp_hdr));
+       memset(&dvmrp_hdr, 0, sizeof(dvmrp_hdr));
        dvmrp_hdr.type = PKT_TYPE_DVMRP;
        dvmrp_hdr.code = code;
        dvmrp_hdr.chksum = 0;                           /* updated later */
Index: prune.c
===================================================================
RCS file: /cvs/src/usr.sbin/dvmrpd/prune.c,v
retrieving revision 1.5
diff -u -p -r1.5 prune.c
--- prune.c     5 May 2015 01:26:37 -0000       1.5
+++ prune.c     7 Dec 2015 19:03:15 -0000
@@ -23,7 +23,7 @@
 #include <arpa/inet.h>
 
 #include <stdlib.h>
-#include <strings.h>
+#include <string.h>
 
 #include "igmp.h"
 #include "dvmrpd.h"
@@ -47,7 +47,7 @@ send_prune(struct nbr *nbr, struct prune
        if (nbr->iface->passive)
                return (0);
 
-       bzero(&prune, sizeof(prune));
+       memset(&prune, 0, sizeof(prune));
 
        dst.sin_family = AF_INET;
        dst.sin_len = sizeof(struct sockaddr_in);
@@ -97,7 +97,7 @@ recv_prune(struct nbr *nbr, char *buf, u
                return;
        }
 
-       bzero(&p, sizeof(p));
+       memset(&p, 0, sizeof(p));
 
        prune = (struct prune_hdr *)buf;
 
Index: rde_mfc.c
===================================================================
RCS file: /cvs/src/usr.sbin/dvmrpd/rde_mfc.c,v
retrieving revision 1.9
diff -u -p -r1.9 rde_mfc.c
--- rde_mfc.c   6 Apr 2011 11:36:26 -0000       1.9
+++ rde_mfc.c   7 Dec 2015 19:03:15 -0000
@@ -251,7 +251,7 @@ mfc_send_prune(struct rt_node *rn, struc
 {
        struct prune    p;
 
-       bzero(&p, sizeof(p));
+       memset(&p, 0, sizeof(p));
 
        p.origin.s_addr = (mn->origin.s_addr &
            htonl(prefixlen2mask(rn->prefixlen)));

Reply via email to