Bug#544898: rc_send_server() unconditionally adds PW_NAS_IP_ADDRESS value

John Morrissey jwm at horde.net
Thu Sep 3 15:55:11 UTC 2009


Package: libradiusclient-ng2
Version: 0.5.5-1
Severity: normal
Tags: patch

rc_send_server() unconditionally adds a PW_NAS_IP_ADDRESS value to the
outgoing request:

--
    /*
     * Fill in NAS-IP-Address
     */
    if (sinlocal.sin_addr.s_addr == htonl(INADDR_ANY)) {
        if (rc_get_srcaddr(SA(&sinlocal), SA(&sinremote)) != 0) {
            close (sockfd);
            memset (secret, '\0', sizeof (secret));
            return ERROR_RC;
        }
    }
    nas_ipaddr = ntohl(sinlocal.sin_addr.s_addr); 
    rc_avpair_add(rh, &(data->send_pairs), PW_NAS_IP_ADDRESS,
        &nas_ipaddr, 0, 0);
--

This causes problems for callers (such as nagios-plugins-standard's
check_radius) that specify their own PW_NAS_IP_ADDRESS to override
rc_send_server()'s autoselected value. Multiple NAS-IP-Address values
are added to the Auth-Request:

AVP: l=6 t=NAS-IP-Address(4): 1.2.3.4
AVP: l=6 t=NAS-IP-Address(4): 1.2.3.5

The attached patch sets PW_NAS_IP_ADDRESS only if not already present
in the request.

-- System Information:
Debian Release: 5.0.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686-bigmem (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libradiusclient-ng2 depends on:
ii  libc6                         2.7-18     GNU C Library: Shared libraries

libradiusclient-ng2 recommends no packages.

libradiusclient-ng2 suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libradiusclient-ng2-sendserver-conditional-nasipaddress.patch
Type: text/x-diff
Size: 497 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-voip-maintainers/attachments/20090903/0e9afc44/attachment.patch>


More information about the Pkg-voip-maintainers mailing list