diff options
author | Kozlov Dmitry <dima@server> | 2010-10-15 10:51:22 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-10-15 10:51:22 +0400 |
commit | f6a7b48c298535dbb130f99d7e4fca5c22e0f18b (patch) | |
tree | c8487369c084a76b36730f63400eb88c597dc9ca | |
parent | 60d7dcf3dab5395b3e6551ce7308beac99c0959f (diff) | |
download | accel-ppp-f6a7b48c298535dbb130f99d7e4fca5c22e0f18b.tar.gz accel-ppp-f6a7b48c298535dbb130f99d7e4fca5c22e0f18b.zip |
radius: fixed incorrect handling when socket read failed with error other than EAGAIN (thanks to GlooM)
-rw-r--r-- | accel-pptpd/radius/packet.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/accel-pptpd/radius/packet.c b/accel-pptpd/radius/packet.c index 0277e5f3..543e7849 100644 --- a/accel-pptpd/radius/packet.c +++ b/accel-pptpd/radius/packet.c @@ -125,10 +125,12 @@ int rad_packet_recv(int fd, struct rad_packet_t **p, struct sockaddr_in *addr) else n = read(fd, pack->buf, REQ_LENGTH_MAX); if (n < 0) { - rad_packet_free(pack); - if (errno == EAGAIN) + if (errno == EAGAIN) { + rad_packet_free(pack); return -1; - log_ppp_error("radius:packet:read: %s\n", strerror(errno)); + } + if (errno != ECONNREFUSED) + log_ppp_error("radius:packet:read: %s\n", strerror(errno)); goto out_err; } break; |