Skip to content

Commit

Permalink
Respect fr_hostname_lookups in libfreeradius
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jun 13, 2014
1 parent 7174e64 commit cc494a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/valuepair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ int pairparsevalue(VALUE_PAIR *vp, char const *value, size_t inlen)
{
fr_ipaddr_t addr;

if (fr_pton4(&addr, value, inlen, false, false) < 0) return -1;
if (fr_pton4(&addr, value, inlen, fr_hostname_lookups, false) < 0) return -1;

/*
* We allow v4 addresses to have a /32 suffix as some databases (PostgreSQL)
Expand All @@ -1416,7 +1416,7 @@ int pairparsevalue(VALUE_PAIR *vp, char const *value, size_t inlen)
{
fr_ipaddr_t addr;

if (fr_pton4(&addr, value, inlen, false, false) < 0) return -1;
if (fr_pton4(&addr, value, inlen, fr_hostname_lookups, false) < 0) return -1;

vp->vp_ipv4prefix[1] = addr.prefix;
memcpy(vp->vp_ipv4prefix + 2, &addr.ipaddr.ip4addr.s_addr, sizeof(vp->vp_ipv4prefix) - 2);
Expand All @@ -1428,7 +1428,7 @@ int pairparsevalue(VALUE_PAIR *vp, char const *value, size_t inlen)
{
fr_ipaddr_t addr;

if (fr_pton6(&addr, value, inlen, false, false) < 0) return -1;
if (fr_pton6(&addr, value, inlen, fr_hostname_lookups, false) < 0) return -1;

/*
* We allow v6 addresses to have a /128 suffix as some databases (PostgreSQL)
Expand All @@ -1449,7 +1449,7 @@ int pairparsevalue(VALUE_PAIR *vp, char const *value, size_t inlen)
{
fr_ipaddr_t addr;

if (fr_pton6(&addr, value, inlen, false, false) < 0) return -1;
if (fr_pton6(&addr, value, inlen, fr_hostname_lookups, false) < 0) return -1;

vp->vp_ipv6prefix[1] = addr.prefix;
memcpy(vp->vp_ipv6prefix + 2, &addr.ipaddr.ip6addr.s6_addr, sizeof(vp->vp_ipv6prefix) - 2);
Expand Down

0 comments on commit cc494a5

Please sign in to comment.