X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=blobdiff_plain;f=src%2Fmod_helsinki.cpp;h=bf96b67554317a8980a25ec75753ed48d6f0af6c;hp=a627945a9699ed69c63820be3f31f15f284ea93f;hb=dfdff5f2d2825a500d3d27200d2ec32ee063a975;hpb=88510217a59150b1c3812213099ddef2a3d2846e diff --git a/src/mod_helsinki.cpp b/src/mod_helsinki.cpp index a627945..bf96b67 100644 --- a/src/mod_helsinki.cpp +++ b/src/mod_helsinki.cpp @@ -1,7 +1,5 @@ -/* $Id: mod_helsinki.cpp,v 1.3 2006-07-06 11:50:26 adam Exp $ - Copyright (c) 1998-2005, Index Data. - -This file is part of the yaz-proxy. +/* This file is part of YAZ proxy + Copyright (C) 1998-2009 Index Data YAZ proxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -14,10 +12,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with YAZ proxy; see the file LICENSE. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. - */ +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #include #include @@ -154,13 +151,15 @@ int my_authenticate(void *user_handle, // 192.168.0.100 // 192.168.0.1-192.168.0.200 int status = YAZPROXY_RET_PERM; - if (ip_file && peer_IP) + if (*ip_file && peer_IP) { yaz_log(YLOG_DEBUG, "Authentication: checking ip address"); const char *pIP = peer_IP; if (strncmp(pIP, "tcp:", 4) == 0) pIP += 4; + if (strncmp(pIP, "::ffff:", 7) == 0) + pIP += 7; IP_ADDRESS peer_address; if (str_to_address(pIP, &peer_address) != 4) yaz_log(YLOG_WARN, "Authentication: could not decode peer IP address %s properly", pIP); @@ -260,7 +259,9 @@ Yaz_ProxyModule_entry yazproxy_module = { /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +