Commit 4a1dd432 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Kill NO_LOCAL_INTERFACE.

It's been broken for ages, nobody noticed.
parent 5bc4f122
......@@ -95,7 +95,7 @@ struct timeval check_neighbours_timeout, check_interfaces_timeout;
static volatile sig_atomic_t exiting = 0, dumping = 0, reopening = 0;
static int accept_local_connections(fd_set *readfds);
static int accept_local_connections(void);
static void init_signals(void);
static void dump_tables(FILE *out);
static int reopen_logfile(void);
......@@ -238,13 +238,9 @@ main(int argc, char **argv)
goto usage;
break;
case 'g':
#ifdef NO_LOCAL_INTERFACE
fprintf(stderr, "Warning: no local interface in this version.\n");
#else
local_server_port = parse_nat(optarg);
if(local_server_port <= 0 || local_server_port > 0xFFFF)
goto usage;
#endif
break;
case 'l':
link_detect = 1;
......@@ -517,7 +513,6 @@ main(int argc, char **argv)
goto fail;
}
#ifndef NO_LOCAL_INTERFACE
if(local_server_port >= 0) {
local_server_socket = tcp_server_socket(local_server_port, 1);
if(local_server_socket < 0) {
......@@ -525,7 +520,6 @@ main(int argc, char **argv)
goto fail;
}
}
#endif
init_signals();
rc = resize_receive_buffer(1500);
......@@ -612,7 +606,6 @@ main(int argc, char **argv)
FD_SET(kernel_socket, &readfds);
maxfd = MAX(maxfd, kernel_socket);
}
#ifndef NO_LOCAL_INTERFACE
if(local_server_socket >= 0 &&
num_local_sockets < MAX_LOCAL_SOCKETS) {
FD_SET(local_server_socket, &readfds);
......@@ -622,7 +615,6 @@ main(int argc, char **argv)
FD_SET(local_sockets[i].fd, &readfds);
maxfd = MAX(maxfd, local_sockets[i].fd);
}
#endif
rc = select(maxfd + 1, &readfds, NULL, NULL, &tv);
if(rc < 0) {
if(errno != EINTR) {
......@@ -672,8 +664,8 @@ main(int argc, char **argv)
}
}
#ifndef NO_LOCAL_INTERFACE
accept_local_connections(&readfds);
if(local_server_socket >= 0 && FD_ISSET(local_server_socket, &readfds))
accept_local_connections();
i = 0;
while(i < num_local_sockets) {
......@@ -690,7 +682,6 @@ main(int argc, char **argv)
}
i++;
}
#endif
if(reopening) {
kernel_dump_time = now.tv_sec;
......@@ -876,12 +867,12 @@ main(int argc, char **argv)
}
static int
accept_local_connections(fd_set *readfds)
accept_local_connections()
{
int rc, s;
struct local_socket *ls;
if(local_server_socket < 0 || !FD_ISSET(local_server_socket, readfds))
if(local_server_socket < 0)
return 0;
s = accept(local_server_socket, NULL, NULL);
......
......@@ -708,9 +708,7 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
if(strcmp(token, "protocol-port") == 0 ||
strcmp(token, "kernel-priority") == 0 ||
strcmp(token, "allow-duplicates") == 0 ||
#ifndef NO_LOCAL_INTERFACE
strcmp(token, "local-port") == 0 ||
#endif
strcmp(token, "export-table") == 0 ||
strcmp(token, "import-table") == 0) {
int v;
......@@ -724,10 +722,8 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
kernel_metric = v;
else if(strcmp(token, "allow_duplicates") == 0)
allow_duplicates = v;
#ifndef NO_LOCAL_INTERFACE
else if(strcmp(token, "local-port") == 0)
local_server_port = v;
#endif
else if(strcmp(token, "export-table") == 0)
export_table = v;
else if(strcmp(token, "import-table") == 0)
......
......@@ -39,12 +39,6 @@ THE SOFTWARE.
#include "local.h"
#include "version.h"
#ifdef NO_LOCAL_INTERFACE
int dummy;
#else
int local_server_socket = -1;
struct local_socket local_sockets[MAX_LOCAL_SOCKETS];
int num_local_sockets = 0;
......@@ -421,5 +415,3 @@ local_socket_destroy(int i)
close(local_sockets[i].fd);
local_sockets[i] = local_sockets[--num_local_sockets];
}
#endif
......@@ -28,8 +28,6 @@ struct xroute;
#define LOCAL_ADD 1
#define LOCAL_CHANGE 2
#ifndef NO_LOCAL_INTERFACE
#ifndef MAX_LOCAL_SOCKETS
#define MAX_LOCAL_SOCKETS 4
#endif
......@@ -56,11 +54,3 @@ int local_read(struct local_socket *s);
int local_header(struct local_socket *s);
struct local_socket *local_socket_create(int fd);
void local_socket_destroy(int i);
#else
#define local_notify_neighbour(n, k) do {} while(0)
#define local_notify_xroute(x, k) do {} while(0)
#define local_notify_route(r, k) do {} while(0)
#define local_dump() do {} while 0
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment