git: 8e8f8d86e305 - main - rpcbind: remove extraneous check for nconf not being unix(4)

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Thu, 09 Jan 2025 04:04:59 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=8e8f8d86e305fe1e90fcfc64c1958e61b359f4f4

commit 8e8f8d86e305fe1e90fcfc64c1958e61b359f4f4
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-01-09 04:00:12 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-01-09 04:00:12 +0000

    rpcbind: remove extraneous check for nconf not being unix(4)
    
    We are already inside an if block with exactly same predicate.
---
 usr.sbin/rpcbind/rpcbind.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c
index 44adae366bed..a836afd24009 100644
--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -416,18 +416,14 @@ init_transport(struct netconfig *nconf)
 		 */
 		if (strcmp("*", hosts[nhostsbak]) == 0)
 		    hosts[nhostsbak] = NULL;
-		if ((strcmp(nconf->nc_netid, "local") != 0) &&
-		    (strcmp(nconf->nc_netid, "unix") != 0)) {
-		    if ((aicode = getaddrinfo(hosts[nhostsbak],
-			servname, &hints, &res)) != 0) {
-			syslog(LOG_ERR,
-			    "cannot get local address for %s: %s",
+		if ((aicode = getaddrinfo(hosts[nhostsbak], servname, &hints,
+		    &res)) != 0) {
+			syslog(LOG_ERR, "cannot get local address for %s: %s",
 			    nconf->nc_netid, gai_strerror(aicode));
 			continue;
-		    }
-		    addrlen = res->ai_addrlen;
-		    sa = (struct sockaddr *)res->ai_addr;
 		}
+		addrlen = res->ai_addrlen;
+		sa = (struct sockaddr *)res->ai_addr;
 		oldmask = umask(S_IXUSR|S_IXGRP|S_IXOTH);
 		if (bind(fd, sa, addrlen) != 0) {
 		    syslog(LOG_ERR, "cannot bind %s on %s: %m",