X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fplugins%2Fradius%2Fip_util.c;h=1f6a76e480f935a8410188d079e8424bb45b5ea3;hp=cd59e7b5213cbe2ef9c71c9511741c335cf69999;hb=d883b2dbafeed3ebd9d7a56ab1469373bd001a3b;hpb=d16a3985eade5280b8e171f5dd0670a91cba0d39;ds=sidebyside diff --git a/pppd/plugins/radius/ip_util.c b/pppd/plugins/radius/ip_util.c index cd59e7b..1f6a76e 100644 --- a/pppd/plugins/radius/ip_util.c +++ b/pppd/plugins/radius/ip_util.c @@ -135,3 +135,31 @@ UINT4 rc_own_ipaddress(void) return this_host_ipaddr; } + +/* + * Function: rc_own_bind_ipaddress + * + * Purpose: get the IP address to be used as a source address + * for sending requests in host order + * + * Returns: IP address + * + */ + +UINT4 rc_own_bind_ipaddress(void) +{ + char *bindaddr; + UINT4 rval = 0; + + if ((bindaddr = rc_conf_str("bindaddr")) == NULL || + strcmp(rc_conf_str("bindaddr"), "*") == 0) { + rval = INADDR_ANY; + } else { + if ((rval = rc_get_ipaddr(bindaddr)) == 0) { + error("rc_own_bind_ipaddress: couldn't get IP address from bindaddr"); + rval = INADDR_ANY; + } + } + + return rval; +}