From 9f6d6b12ac3604bc819a8ecb4c4f3775008053cf Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 25 May 2016 19:43:00 -0400 Subject: [PATCH] pimd: Clean up some more compile warnings Turns out we were missing $(WERROR) for compiling pimd so we were not catching compile warning issues. Signed-off-by: Donald Sharp --- pimd/Makefile.am | 2 +- pimd/pim_mroute.c | 2 +- pimd/pim_register.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pimd/Makefile.am b/pimd/Makefile.am index 954ffd9160..4477f024e3 100644 --- a/pimd/Makefile.am +++ b/pimd/Makefile.am @@ -39,7 +39,7 @@ DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" $(PIM_DEFS) INSTALL_SDATA=@INSTALL@ -m 600 LIBS = @LIBS@ -AM_CFLAGS = $(PICFLAGS) +AM_CFLAGS = $(PICFLAGS) $(WERROR) AM_LDFLAGS = $(PILDFLAGS) noinst_LIBRARIES = libpim.a diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index eefa392799..5e1ab94b7c 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -308,7 +308,7 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size) break; case IGMPMSG_WHOLEPKT: zlog_hexdump(buf, buf_size); - return pim_mroute_msg_wholepkt(fd, ifp, msg, src_str, grp_str); + return pim_mroute_msg_wholepkt(fd, ifp, (const char *)msg, src_str, grp_str); break; default: break; diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 3fc4a61ae4..11717acf0c 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -86,7 +86,7 @@ pim_register_send (const struct ip *ip_hdr, struct pim_rpf *rpg) b1 = buffer + PIM_MSG_REGISTER_LEN; plen = ntohs(ip_hdr->ip_len); - memcpy(b1, (unsigned char *)ip_hdr, plen); + memcpy(b1, (const unsigned char *)ip_hdr, plen); pim_msg_build_header(buffer, plen + PIM_MSG_HEADER_LEN, PIM_MSG_TYPE_REGISTER); @@ -155,10 +155,10 @@ pim_register_recv (struct interface *ifp, { int sentRegisterStop = 0; struct ip *ip_hdr; - size_t hlen; + //size_t hlen; struct in_addr group = { .s_addr = 0 }; struct in_addr source = { .s_addr = 0 }; - uint8_t *msg; + //uint8_t *msg; uint32_t *bits; if (!pim_check_is_my_ip_address (dest_addr)) { @@ -194,8 +194,8 @@ pim_register_recv (struct interface *ifp, */ bits = (uint32_t *)tlv_buf; ip_hdr = (struct ip *)(tlv_buf + PIM_MSG_REGISTER_LEN); - hlen = (ip_hdr->ip_hl << 2) | PIM_MSG_REGISTER_LEN; - msg = (uint8_t *)tlv_buf + hlen; + //hlen = (ip_hdr->ip_hl << 2) | PIM_MSG_REGISTER_LEN; + //msg = (uint8_t *)tlv_buf + hlen; source = ip_hdr->ip_src; group = ip_hdr->ip_dst; -- 2.39.5