~ubuntu-branches/ubuntu/jaunty/freeradius/jaunty-updates

« back to all changes in this revision

Viewing changes to src/main/acct.c

  • Committer: Bazaar Package Importer
  • Author(s): Paul Hampson
  • Date: 2005-10-16 21:26:30 UTC
  • mto: (3.1.2 dapper)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051016212630-73v9gjr6u0w4q4v1
Tags: upstream-1.0.5
ImportĀ upstreamĀ versionĀ 1.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * acct.c       Accounting routines.
3
3
 *
4
 
 * Version:     $Id: acct.c,v 1.30 2004/04/14 19:53:58 aland Exp $
 
4
 * Version:     $Id: acct.c,v 1.30.2.2 2005/07/11 13:47:45 nbk Exp $
5
5
 *
6
6
 *   This program is free software; you can redistribute it and/or modify
7
7
 *   it under the terms of the GNU General Public License as published by
23
23
 * Copyright 2000  Alan Curry <pacman@world.std.com>
24
24
 */
25
25
 
26
 
static const char rcsid[] = "$Id: acct.c,v 1.30 2004/04/14 19:53:58 aland Exp $";
 
26
static const char rcsid[] = "$Id: acct.c,v 1.30.2.2 2005/07/11 13:47:45 nbk Exp $";
27
27
 
28
28
#include "autoconf.h"
29
29
#include "libradius.h"
125
125
 
126
126
                /*
127
127
                 *      Maybe one of the preacct modules has decided
128
 
                 *      that a proxy should be used. If so, get out of
129
 
                 *      here and send the proxied packet, but ONLY if
130
 
                 *      there isn't one already...
 
128
                 *      that a proxy should be used.
131
129
                 */
132
 
                if (pairfind(request->config_items, PW_PROXY_TO_REALM)) {
133
 
                        return reply;
 
130
                if ((vp = pairfind(request->config_items, PW_PROXY_TO_REALM))) {
 
131
                        REALM *realm;
 
132
 
 
133
                        /*
 
134
                         *      Check whether Proxy-To-Realm is
 
135
                         *      a LOCAL realm.
 
136
                         */
 
137
                        realm = realm_find(vp->strvalue, TRUE);
 
138
                        if (realm != NULL &&
 
139
                            realm->acct_ipaddr == htonl(INADDR_NONE)) {
 
140
                                DEBUG("rad_accounting: Cancelling proxy to realm %s, as it is a LOCAL realm.", realm->realm);
 
141
                                pairdelete(&request->config_items, PW_PROXY_TO_REALM);
 
142
                        } else {
 
143
                                /*
 
144
                                 *      Don't reply to the NAS now because
 
145
                                 *      we have to send the proxied packet.
 
146
                                 */
 
147
                                return reply;
 
148
                        }
134
149
                }
135
150
        }
136
151
 
153
168
 
154
169
        return reply;
155
170
}
156