Synopsis: Remove unused ret variable in RADIUS DAE LISTEN rule in parse.y.
Description:
        The ret variable is declared but only used once to store the return 
value
        from config_setraddae() before immediately checking it in an if 
condition.
        Remove the variable and check the return value directly.
Fix:

Index: parse.y
===================================================================
RCS file: /cvs/src/sbin/iked/parse.y,v
diff -u -p -u -r1.147 parse.y
--- parse.y     13 Jul 2024 12:22:46 -0000      1.147
+++ parse.y     3 Jan 2025 19:08:39 -0000
@@ -1272,7 +1272,7 @@ string            : string STRING
 
 radius         : RADIUS accounting SERVER STRING port SECRET STRING
                {
-                       int              ret, gai_err;
+                       int              gai_err;
                        struct addrinfo  hints, *ai;
                        u_short          port;
 
@@ -1294,8 +1294,8 @@ radius            : RADIUS accounting SERVER STRIN
                                port = htons((!$2)? RADIUS_DEFAULT_PORT :
                                    RADIUS_ACCT_DEFAULT_PORT);
                        socket_af(ai->ai_addr, port);
-                       if ((ret = config_setradserver(env, ai->ai_addr,
-                           ai->ai_addrlen, $7, $2)) != 0) {
+                       if (config_setradserver(env, ai->ai_addr,
+                           ai->ai_addrlen, $7, $2) != 0) {
                                yyerror("could not set radius server");
                                free($4);
                                explicit_bzero($7, strlen($7));
@@ -1352,7 +1352,7 @@ radius            : RADIUS accounting SERVER STRIN
                            $5.attrtype);
                }
                | RADIUS DAE LISTEN ON STRING port {
-                       int              ret, gai_err;
+                       int              gai_err;
                        struct addrinfo  hints, *ai;
                        u_short          port;
 
@@ -1371,8 +1371,8 @@ radius            : RADIUS accounting SERVER STRIN
                        if (port == 0)
                                port = htons(RADIUS_DAE_DEFAULT_PORT);
                        socket_af(ai->ai_addr, port);
-                       if ((ret = config_setraddae(env, ai->ai_addr,
-                           ai->ai_addrlen)) != 0) {
+                       if (config_setraddae(env, ai->ai_addr,
+                           ai->ai_addrlen) != 0) {
                                yyerror("could not set radius server");
                                free($5);
                                YYERROR;

Reply via email to