summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-08-05 09:23:33 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:05 +0100
commita878ba45729e28709f5916b0ff04bd1620751d60 (patch)
tree9727a4d198b010b9b336d2f305ff0abc11d259b8
parentpimd: Send hello immediately with receive of new genid (diff)
downloadfrr-a878ba45729e28709f5916b0ff04bd1620751d60.tar.xz
frr-a878ba45729e28709f5916b0ff04bd1620751d60.zip
pimd: Some SA analysis fixes.
This commit addresses some SA issues found: 1) double set variables 2) value set but never used. 3) wrong return path used. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_igmpv3.c3
-rw-r--r--pimd/pim_register.c2
-rw-r--r--pimd/pim_sock.c2
3 files changed, 2 insertions, 5 deletions
diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c
index 79932edb3..149d18df5 100644
--- a/pimd/pim_igmpv3.c
+++ b/pimd/pim_igmpv3.c
@@ -1134,9 +1134,6 @@ static int group_retransmit_sources(struct igmp_group *group,
struct igmp_source *src;
int num_retransmit_sources_left = 0;
- query_buf1_max_sources = (sizeof(query_buf1) - IGMP_V3_SOURCES_OFFSET) >> 2;
- query_buf2_max_sources = (sizeof(query_buf2) - IGMP_V3_SOURCES_OFFSET) >> 2;
-
source_addr1 = (struct in_addr *)(query_buf1 + IGMP_V3_SOURCES_OFFSET);
source_addr2 = (struct in_addr *)(query_buf2 + IGMP_V3_SOURCES_OFFSET);
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index 2854b3d59..d0fe89b01 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -107,7 +107,7 @@ pim_register_stop_recv (uint8_t *buf, int buf_size)
l = pim_parse_addr_group (&group, buf, buf_size);
buf += l;
buf_size -= l;
- l = pim_parse_addr_ucast (&source, buf, buf_size);
+ pim_parse_addr_ucast (&source, buf, buf_size);
memset (&sg, 0, sizeof (struct prefix_sg));
sg.src = source.u.prefix4;
sg.grp = group.u.prefix4;
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c
index a4155549c..8f8f4f191 100644
--- a/pimd/pim_sock.c
+++ b/pimd/pim_sock.c
@@ -334,7 +334,7 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
((struct sockaddr_in *) to)->sin_family = AF_INET;
- if (pim_socket_getsockname(fd, (struct sockaddr *) &si, &si_len)) {
+ if (pim_socket_getsockname(fd, (struct sockaddr *) &si, &si_len) != PIM_SOCK_ERR_NONE) {
((struct sockaddr_in *) to)->sin_port = ntohs(0);
((struct sockaddr_in *) to)->sin_addr.s_addr = ntohl(0);
}