ocserv: added support for per-user split-dns directive

Resolves: #229

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2019-11-17 10:56:46 +01:00
parent 6739529e05
commit 4bcf29643d
9 changed files with 51 additions and 6 deletions

View File

@@ -153,6 +153,10 @@ ipv4-dns = 192.168.5.1
# The NBNS server (if any)
#ipv4-nbns = 192.168.2.3
# The domains over which the provided DNS should be used. Use
# multiple lines for multiple domains.
split-dns = example.com
#ipv6-address =
#ipv6-mask =
#ipv6-dns =

View File

@@ -83,7 +83,7 @@ echo -n "Checking if proper dns was sent... "
CONTENTS=`cat ${TMPFILE1}|grep "X-CSTP-DNS: 8.8.8.8"`
if test -z "$CONTENTS";then
cat ${TMPFILE1}
cat ${TMPFILE1}|grep X-CSTP-DNS
fail $PID "Expected DNS was not sent"
fi
@@ -99,6 +99,26 @@ fi
echo ok
echo -n "Checking if split-dns has been sent... "
CONTENTS=`cat ${TMPFILE1}|grep X-CSTP-Split-DNS|grep example6.com`
if test -z "$CONTENTS";then
cat ${TMPFILE1}|grep X-CSTP-Split-DNS
fail $PID "Temporary file contents are not correct; X-CSTP-Split-DNS was not found"
fi
echo ok
echo -n "Checking if split-dns has not been sent... "
cat ${TMPFILE1}|grep X-CSTP-Split-DNS|grep example.com >/dev/null
if test $? = 0;then
cat ${TMPFILE1}|grep X-CSTP-Split-DNS
fail $PID "Temporary file contents are not correct; X-CSTP-Split-DNS contained main config value"
fi
echo ok
echo -n "Checking if user-specific DPD has been sent... "
CONTENTS=`cat ${TMPFILE1}|grep X-DTLS-DPD|grep 880`
@@ -150,6 +170,16 @@ if test -z "$CONTENTS";then
fail $PID "Temporary file contents are not correct; address was not the expected (10.9.)"
fi
echo -n "Checking if main config split-dns has been sent... "
cat ${TMPFILE1}|grep X-CSTP-Split-DNS|grep example.com >/dev/null
if test $? != 0;then
cat ${TMPFILE1}|grep X-CSTP-Split-DNS
fail $PID "Temporary file contents are not correct; X-CSTP-Split-DNS did not contain main config value"
fi
echo ok
kill $kpid3
rm -f ${TMPFILE1}

View File

@@ -4,3 +4,5 @@ keepalive = 14400
max-same-clients = 1
dns = 8.8.8.8
hostname = xxxx
split-dns = example5.com
split-dns = example6.com