From: Arran Cudbard-Bell Date: Fri, 11 Sep 2015 12:10:12 +0000 (+0100) Subject: Add support for "old" style clients back. This shouldn't be removed until v3.1.x. X-Git-Tag: release_3_0_10~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eea789740c887a4fdcabf3e3f2d833de7caafb31;p=thirdparty%2Ffreeradius-server.git Add support for "old" style clients back. This shouldn't be removed until v3.1.x. --- diff --git a/src/main/client.c b/src/main/client.c index 9c9449b6512..832f12a2da1 100644 --- a/src/main/client.c +++ b/src/main/client.c @@ -940,9 +940,24 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, bool in_server, bo * No "ipaddr" or "ipv6addr", use old-style "client {" syntax. */ } else { - cf_log_err_cs(cs, "No 'ipaddr' or 'ipv4addr' or 'ipv6addr' configuration " - "directive found in client %s", name2); - goto error; + WARN("No 'ipaddr' or 'ipv4addr' or 'ipv6addr' field found in client %s. " + "Please fix your configuration", name2); + WARN("Support for old-style clients will be removed in a future release"); + +#ifdef WITH_TCP + if (cf_pair_find(cs, "proto") != NULL) { + cf_log_err_cs(cs, "Cannot use 'proto' inside of old-style client definition"); + goto error; + } +#endif + if (fr_pton(&c->ipaddr, name2, 0, true, true) < 0) { + cf_log_err_cs(cs, "Failed parsing client name \"%s\" as ip address or hostname: %s", name2, + fr_strerror()); + goto error; + } + + c->longname = talloc_typed_strdup(c, name2); + if (!c->shortname) c->shortname = talloc_typed_strdup(c, c->longname); } c->proto = IPPROTO_UDP;