332c332 < --- > string untrusted_ip; /** untrusted_ip for ipv6 support **/ 358c358,361 < throw Exception( "RADIUS-PLUGIN: FOREGROUND: untrusted_ip is not defined\n"); --- > if(get_env ("untrusted_ip6", envp)==NULL) > { > throw Exception( "RADIUS-PLUGIN: FOREGROUND: untrusted_ip and untrusted_ip6 is not defined\n"); > } 376c379,396 < newuser->setCallingStationId(get_env ("untrusted_ip", envp)); --- > > // ipv6 > if ((get_env ("untrusted_ip6", envp)!=NULL)||(get_env ("untrusted_ip", envp)!=NULL)) > { > if(get_env ("untrusted_ip", envp)==NULL) > { > untrusted_ip = get_env ("untrusted_ip6", envp); > } > else > { > untrusted_ip = get_env ("untrusted_ip", envp); > } > } > else > { > untrusted_ip = "UNDEF"; > } > newuser->setCallingStationId(untrusted_ip); 393,394c413,415 < newuser->setUntrustedPort(get_env("untrusted_port", envp)); < newuser->setKey(newuser->getCommonname() +string(",") + get_env ("untrusted_ip", envp) + string(":") + get_env ("untrusted_port", envp)); --- > newuser->setUntrustedPort(get_env("untrusted_port", envp)); > newuser->setKey(newuser->getCommonname() +string(",") + untrusted_ip + string(":") + get_env ("untrusted_port", envp)); > 568c589 < if (get_env ("untrusted_ip", envp)==NULL) --- > if (get_env ("untrusted_ip", envp)==NULL ) 570c591,593 < throw Exception( "RADIUS-PLUGIN: FOREGROUND: untrusted_ip is not defined\n"); --- > if (get_env("untrusted_ip6", envp)==NULL){ > throw Exception( "RADIUS-PLUGIN: FOREGROUND: untrusted_ip or untrusted_ip6 is not defined\n"); > } 587,588d609 < < 591c612,630 < if (get_env ("common_name", envp)!=NULL) --- > > if ((get_env ("untrusted_ip6", envp)!=NULL)||(get_env ("untrusted_ip", envp)!=NULL)) > { > if(get_env ("untrusted_ip", envp)==NULL) > { > untrusted_ip = get_env ("untrusted_ip6", envp); > } > else > { > untrusted_ip = get_env ("untrusted_ip", envp); > } > } > else > { > untrusted_ip = "UNDEF"; > } > > > if (get_env ("common_name", envp)!=NULL) 608c647 < string key=common_name + string(",") + string(get_env ("untrusted_ip", envp)) + string(":") + string(get_env ("untrusted_port", envp)); --- > string key=common_name + string(",") +untrusted_ip+string(":") + string(get_env ("untrusted_port", envp)); 615,617d653 < < < 701c737,739 < throw Exception( "RADIUS-PLUGIN: FOREGROUND: untrusted_ip is not defined\n"); --- > if (get_env ("untrusted_ip6", envp)==NULL) { > throw Exception( "RADIUS-PLUGIN: FOREGROUND: untrusted_ip and untrusted_ip6 is not defined\n"); > } 714c752,768 < --- > > if ((get_env ("untrusted_ip6", envp)!=NULL)||(get_env ("untrusted_ip", envp)!=NULL)) > { > if(get_env ("untrusted_ip", envp)==NULL) > { > untrusted_ip = get_env ("untrusted_ip6", envp); > } > else > { > untrusted_ip = get_env ("untrusted_ip", envp); > } > } > else > { > untrusted_ip = "UNDEF"; > } > 717c771 < //for OpenVPN option client cert not required, common_name is "UNDEF", see status.log --- > //for OpenVPN option client cert not required, common_name is "UNDEF", see status.log 733c787 < newuser=context->findUser(common_name + string(",") + string(get_env ("untrusted_ip", envp)) + string(":") + string(get_env ("untrusted_port", envp))); --- > newuser=context->findUser(common_name + string(",") + untrusted_ip + string(":") + string(get_env ("untrusted_port", envp)));