Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
4a1dd432
Commit
4a1dd432
authored
Feb 11, 2016
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kill NO_LOCAL_INTERFACE.
It's been broken for ages, nobody noticed.
parent
5bc4f122
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
36 deletions
+5
-36
babeld.c
babeld.c
+5
-14
configuration.c
configuration.c
+0
-4
local.c
local.c
+0
-8
local.h
local.h
+0
-10
No files found.
babeld.c
View file @
4a1dd432
...
...
@@ -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
);
...
...
configuration.c
View file @
4a1dd432
...
...
@@ -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
)
...
...
local.c
View file @
4a1dd432
...
...
@@ -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
local.h
View file @
4a1dd432
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment