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 8eb2bfbc99809295bc3aba08d24d9961b84cced0)