Backport PortRange extensions

Fixes a compilation error.

Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6588/
(cherry picked from commit dfa9c1207ea5a24a1e9b52690e6aceda8fd2d8c2)
(cherry picked from commit 188767898a2930b38d5d746d6547d096e2363047)