freebsd-ports/net/freeradius-client/files/patch-lib::sendserver.c
Beech Rintoul 55e7e27424 The FreeRADIUS Client is a framework and library for writing RADIUS
Clients which additionally includes radlogin, a flexible RADIUS aware
login replacement, a command line program to send RADIUS
authentication/authorisation requests and accounting records and a
utility to query the status of a RADIUS server.  All these programs are
based on a library which lets you develop a RADIUS-aware application in
less than 50 lines of C code. It is highly portable and runs on Linux,
many BSD variants and Solaris.

PR:		ports/129250
Submitted by:	netch at netch.kiev.ua
2008-12-22 08:24:42 +00:00

20 lines
551 B
C

--- lib/sendserver.c
+++ lib/sendserver.c
@@ -196,6 +196,7 @@
char send_buffer[BUFFER_LEN];
int retries;
VALUE_PAIR *vp;
+ unsigned long nasaddr;
server_name = data->server;
if (server_name == NULL || server_name[0] == '\0')
@@ -259,6 +262,9 @@
/*
* Fill in NAS-IP-Address
*/
+ nas_ipaddr = rc_nasaddress(rh);
+ if (nas_ipaddr != 0)
+ sinlocal.sin_addr.s_addr = htonl(nas_ipaddr);
if (sinlocal.sin_addr.s_addr == htonl(INADDR_ANY)) {
if (rc_get_srcaddr(SA(&sinlocal), SA(&sinremote)) != 0) {
close (sockfd);