]> git.puffer.fish Git - mirror/frr.git/commitdiff
ldpd: Cleanup set but unused variables
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 24 Feb 2020 13:34:53 +0000 (08:34 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 27 Feb 2020 14:41:58 +0000 (09:41 -0500)
There existed some variables set but never used.  Clean this up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ldpd/address.c
ldpd/ldpd.c
ldpd/socket.c

index 9c1564a31f88d66f8a033f9ce771e9e956924286..74a3f5a309953f75b0ad837b3d22c357d5810c0b 100644 (file)
@@ -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.
index dcbcf8ce5007ee39064fc938595ae8e4479b9d03..c862de1954301acfe54b479130b0af6d3306a5d6 100644 (file)
@@ -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);
                }
index 8706d03c6f95dd4999b5662e6a747d9fdf6e903d..997434620ac539a5efc1c0207be63a0b5439717f 100644 (file)
@@ -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");
 }