A.R Karthick
Committed by Gerrit Code Review

Enable SO_REUSEADDR option for radius server Datagram Sockets.

This helps in fixing "address in use" exceptions while creating the datagram sockets.
This was hit while triggering repeated radius server reconfigurations.

Change-Id: I084c1d83499c010036fcfbca0ad86d40f4e4db88
......@@ -19,6 +19,7 @@ import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
......@@ -165,7 +166,9 @@ public class AaaManager {
private void initializeLocalState() {
try {
radiusSocket = new DatagramSocket(radiusServerPort);
radiusSocket = new DatagramSocket(null);
radiusSocket.setReuseAddress(true);
radiusSocket.bind(new InetSocketAddress(radiusServerPort));
} catch (Exception ex) {
log.error("Can't open RADIUS socket", ex);
}
......