summaryrefslogtreecommitdiff
path: root/udp.c
diff options
context:
space:
mode:
authorvenaas <venaas>2008-10-13 15:29:36 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-10-13 15:29:36 +0000
commitecc6d5a045d878c2fcc6ef57ae55162ccc375384 (patch)
tree6117e86f8de4e7d29188d5e1b947db71a94e257f /udp.c
parentf07282621239425826542fdcc0668398ffd7482f (diff)
cleaning up code
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@428 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'udp.c')
-rw-r--r--udp.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/udp.c b/udp.c
index 14cc937..571c005 100644
--- a/udp.c
+++ b/udp.c
@@ -169,23 +169,11 @@ unsigned char *radudpget(int s, struct client **client, struct server **server,
int clientradputudp(struct server *server, unsigned char *rad) {
size_t len;
- struct sockaddr_storage sa;
- struct sockaddr *sap;
struct clsrvconf *conf = server->conf;
- uint16_t port;
len = RADLEN(rad);
- port = port_get(conf->addrinfo->ai_addr);
-
- if (*rad == RAD_Accounting_Request) {
- sap = (struct sockaddr *)&sa;
- memcpy(sap, conf->addrinfo->ai_addr, conf->addrinfo->ai_addrlen);
- port_set(sap, ++port);
- } else
- sap = conf->addrinfo->ai_addr;
-
- if (sendto(server->sock, rad, len, 0, sap, conf->addrinfo->ai_addrlen) >= 0) {
- debug(DBG_DBG, "clienradputudp: sent UDP of length %d to %s port %d", len, conf->host, port);
+ if (sendto(server->sock, rad, len, 0, conf->addrinfo->ai_addr, conf->addrinfo->ai_addrlen) >= 0) {
+ debug(DBG_DBG, "clienradputudp: sent UDP of length %d to %s port %d", len, conf->host, port_get(conf->addrinfo->ai_addr));
return 1;
}