]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
clients can be proto UDP, TCP, or *
authorAlan T. DeKok <aland@freeradius.org>
Wed, 2 Oct 2019 02:19:55 +0000 (22:19 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 2 Oct 2019 02:19:55 +0000 (22:19 -0400)
src/bin/radmin.c

index b823c950a6360922b6d0fc20746159894b613c16..945c393f3cf4d58182f7ae84420ddba92c26e6c4 100644 (file)
@@ -735,10 +735,7 @@ static int cmd_show_client(FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info
                fprintf(fp_err, "No such client.\n");
                return -1;
        } else {
-               client = client_find(NULL, &info->box[0]->vb_ip, IPPROTO_UDP);
-               if (client) goto found;
-
-               client = client_find(NULL, &info->box[0]->vb_ip, IPPROTO_TCP);
+               client = client_find(NULL, &info->box[0]->vb_ip, IPPROTO_IP); /* hack */
                if (!client) goto not_found;
        }
 
@@ -746,6 +743,15 @@ found:
        fprintf(fp, "shortname\t%s\n", client->shortname);
        fprintf(fp, "secret\t\t%s\n", client->secret);
 
+       if (client->proto == IPPROTO_UDP) {
+               fprintf(fp, "proto\t\tudp\n");
+
+       } else if (client->proto == IPPROTO_TCP) {
+               fprintf(fp, "proto\t\ttcp\n");
+       } else {
+               fprintf(fp, "proto\t\t*\n");
+       }
+
        return 0;
 }