summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-02-24 08:34:53 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-02-27 09:41:58 -0500
commitf67de3ee72622061160fde4fa794e2bf0e95d3af (patch)
treece6bc86ccb784c420d7e981ef41a1d33f4f87f8c
parent5037cc3eb4aeab3bfe1182df1ec69f554c764fa9 (diff)
ldpd: Cleanup set but unused variables
There existed some variables set but never used. Clean this up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--ldpd/address.c2
-rw-r--r--ldpd/ldpd.c17
-rw-r--r--ldpd/socket.c4
3 files changed, 11 insertions, 12 deletions
diff --git a/ldpd/address.c b/ldpd/address.c
index 9c1564a31f..74a3f5a309 100644
--- a/ldpd/address.c
+++ b/ldpd/address.c
@@ -67,7 +67,7 @@ send_address(struct nbr *nbr, int af, struct if_addr_head *addr_list,
fatalx("send_address: unknown af");
}
- while ((if_addr = LIST_FIRST(addr_list)) != NULL) {
+ while (LIST_FIRST(addr_list) != NULL) {
/*
* Send as many addresses as possible - respect the session's
* negotiated maximum pdu length.
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index dcbcf8ce50..c862de1954 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -858,7 +858,6 @@ ldp_acl_request(struct imsgev *iev, char *acl_name, int af,
union ldpd_addr *addr, uint8_t prefixlen)
{
struct imsg imsg;
- ssize_t n;
struct acl_check acl_check;
if (acl_name[0] == '\0')
@@ -876,9 +875,9 @@ ldp_acl_request(struct imsgev *iev, char *acl_name, int af,
imsg_flush(&iev->ibuf);
/* receive (blocking) and parse result */
- if ((n = imsg_read(&iev->ibuf)) == -1)
+ if (imsg_read(&iev->ibuf) == -1)
fatal("imsg_read error");
- if ((n = imsg_get(&iev->ibuf, &imsg)) == -1)
+ if (imsg_get(&iev->ibuf, &imsg) == -1)
fatal("imsg_get");
if (imsg.hdr.type != IMSG_ACL_CHECK ||
imsg.hdr.len != IMSG_HEADER_SIZE + sizeof(int))
@@ -1408,7 +1407,7 @@ merge_ifaces(struct ldpd_conf *conf, struct ldpd_conf *xconf)
RB_FOREACH_SAFE(iface, iface_head, &conf->iface_tree, itmp) {
/* find deleted interfaces */
- if ((xi = if_lookup_name(xconf, iface->name)) == NULL) {
+ if (if_lookup_name(xconf, iface->name) == NULL) {
switch (ldpd_process) {
case PROC_LDP_ENGINE:
ldpe_if_exit(iface);
@@ -1469,7 +1468,7 @@ merge_tnbrs(struct ldpd_conf *conf, struct ldpd_conf *xconf)
continue;
/* find deleted tnbrs */
- if ((xt = tnbr_find(xconf, tnbr->af, &tnbr->addr)) == NULL) {
+ if (tnbr_find(xconf, tnbr->af, &tnbr->addr) == NULL) {
switch (ldpd_process) {
case PROC_LDP_ENGINE:
tnbr->flags &= ~F_TNBR_CONFIGURED;
@@ -1624,7 +1623,7 @@ merge_l2vpns(struct ldpd_conf *conf, struct ldpd_conf *xconf)
RB_FOREACH_SAFE(l2vpn, l2vpn_head, &conf->l2vpn_tree, ltmp) {
/* find deleted l2vpns */
- if ((xl = l2vpn_find(xconf, l2vpn->name)) == NULL) {
+ if (l2vpn_find(xconf, l2vpn->name) == NULL) {
switch (ldpd_process) {
case PROC_LDE_ENGINE:
l2vpn_exit(l2vpn);
@@ -1680,7 +1679,7 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
/* merge intefaces */
RB_FOREACH_SAFE(lif, l2vpn_if_head, &l2vpn->if_tree, ftmp) {
/* find deleted interfaces */
- if ((xf = l2vpn_if_find(xl, lif->ifname)) == NULL) {
+ if (l2vpn_if_find(xl, lif->ifname) == NULL) {
RB_REMOVE(l2vpn_if_head, &l2vpn->if_tree, lif);
free(lif);
}
@@ -1706,7 +1705,7 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
/* merge active pseudowires */
RB_FOREACH_SAFE(pw, l2vpn_pw_head, &l2vpn->pw_tree, ptmp) {
/* find deleted active pseudowires */
- if ((xp = l2vpn_pw_find_active(xl, pw->ifname)) == NULL) {
+ if (l2vpn_pw_find_active(xl, pw->ifname) == NULL) {
switch (ldpd_process) {
case PROC_LDE_ENGINE:
l2vpn_pw_exit(pw);
@@ -1807,7 +1806,7 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
/* merge inactive pseudowires */
RB_FOREACH_SAFE(pw, l2vpn_pw_head, &l2vpn->pw_inactive_tree, ptmp) {
/* find deleted inactive pseudowires */
- if ((xp = l2vpn_pw_find_inactive(xl, pw->ifname)) == NULL) {
+ if (l2vpn_pw_find_inactive(xl, pw->ifname) == NULL) {
RB_REMOVE(l2vpn_pw_head, &l2vpn->pw_inactive_tree, pw);
free(pw);
}
diff --git a/ldpd/socket.c b/ldpd/socket.c
index 8706d03c6f..997434620a 100644
--- a/ldpd/socket.c
+++ b/ldpd/socket.c
@@ -209,7 +209,7 @@ sock_set_nonblock(int fd)
flags |= O_NONBLOCK;
- if ((flags = fcntl(fd, F_SETFL, flags)) == -1)
+ if (fcntl(fd, F_SETFL, flags) == -1)
fatal("fcntl F_SETFL");
}
@@ -223,7 +223,7 @@ sock_set_cloexec(int fd)
flags |= FD_CLOEXEC;
- if ((flags = fcntl(fd, F_SETFD, flags)) == -1)
+ if (fcntl(fd, F_SETFD, flags) == -1)
fatal("fcntl F_SETFD");
}