]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
create / use better names for the socket
authorAlan T. DeKok <aland@freeradius.org>
Sat, 12 Aug 2017 16:12:27 +0000 (18:12 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 12 Aug 2017 16:17:14 +0000 (18:17 +0200)
* / :: for wildcard
use "radius"
and print out virtual server name

src/modules/proto_radius/proto_radius_udp.c

index a22dfc6b3070b50980890959fde95c860712fb67..968524373a52f8e98e9c4c40abea7a79bc68b045 100644 (file)
@@ -404,14 +404,25 @@ static int mod_open(void *instance)
                goto error;
        }
 
-
-       fr_value_box_snprint(src_buf, sizeof(src_buf), fr_box_ipaddr(inst->ipaddr), 0);
+       if (fr_ipaddr_is_inaddr_any(&inst->ipaddr)) {
+               if (inst->ipaddr.af == AF_INET) {
+                       strlcpy(src_buf, "*", sizeof(src_buf));
+               } else {
+                       rad_assert(inst->ipaddr.af == AF_INET6);
+                       strlcpy(src_buf, "::", sizeof(src_buf));
+               }
+       } else {
+               fr_value_box_snprint(src_buf, sizeof(src_buf), fr_box_ipaddr(inst->ipaddr), 0);
+       }
 
        rad_assert(inst->name == NULL);
        inst->name = talloc_asprintf(inst, "proto udp address %s port %u",
                                     src_buf, port);
        inst->sockfd = sockfd;
-       DEBUG("Listening on %s", inst->name);
+
+       // @todo - also print out auth / acct / coa, etc.
+       DEBUG("Listening on radius address %s bound to virtual server %s",
+             inst->name, cf_section_name2(inst->parent->server_cs));
 
        return 0;
 }