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
d13175e1
Commit
d13175e1
authored
May 16, 2010
by
dermiste
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portability fixes
parent
c0008e70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
+14
-6
babeld.c
babeld.c
+1
-1
babeld.h
babeld.h
+8
-0
config.c
config.c
+2
-2
kernel.c
kernel.c
+3
-3
No files found.
babeld.c
View file @
d13175e1
...
@@ -111,7 +111,7 @@ main(int argc, char **argv)
...
@@ -111,7 +111,7 @@ main(int argc, char **argv)
gettime
(
&
now
);
gettime
(
&
now
);
rfd
=
open
(
"/dev/urandom"
,
O_RDONLY
);
rfd
=
open
(
RND_DEV
,
O_RDONLY
);
if
(
rfd
<
0
)
{
if
(
rfd
<
0
)
{
perror
(
"open(random)"
);
perror
(
"open(random)"
);
}
else
{
}
else
{
...
...
babeld.h
View file @
d13175e1
...
@@ -80,6 +80,14 @@ THE SOFTWARE.
...
@@ -80,6 +80,14 @@ THE SOFTWARE.
#endif
#endif
#endif
#endif
#if defined(__linux)
#define RND_DEV "/dev/urandom"
#elif defined(__OpenBSD__)
#define RND_DEV "/dev/arandom"
#else
#error "don't know which random device to use"
#endif
extern
struct
timeval
now
;
extern
struct
timeval
now
;
extern
int
debug
;
extern
int
debug
;
extern
time_t
reboot_time
;
extern
time_t
reboot_time
;
...
...
config.c
View file @
d13175e1
...
@@ -24,7 +24,7 @@ THE SOFTWARE.
...
@@ -24,7 +24,7 @@ THE SOFTWARE.
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
#if
ndef __APPLE__
#if
def __linux
/* Defining it rather than including <linux/rtnetlink.h> because this
/* Defining it rather than including <linux/rtnetlink.h> because this
* implies <asm/types.h> on Linux 2.4 */
* implies <asm/types.h> on Linux 2.4 */
#define RTPROT_BOOT 3
/* Route installed during boot */
#define RTPROT_BOOT 3
/* Route installed during boot */
...
@@ -646,7 +646,7 @@ filter_match(struct filter *f, const unsigned char *id,
...
@@ -646,7 +646,7 @@ filter_match(struct filter *f, const unsigned char *id,
return
0
;
return
0
;
}
else
if
(
proto
==
RTPROT_BABEL_LOCAL
)
{
}
else
if
(
proto
==
RTPROT_BABEL_LOCAL
)
{
return
0
;
return
0
;
#if
ndef __APPLE__
#if
def __linux
}
else
if
(
proto
==
RTPROT_BOOT
)
{
}
else
if
(
proto
==
RTPROT_BOOT
)
{
return
0
;
return
0
;
#endif
#endif
...
...
kernel.c
View file @
d13175e1
...
@@ -26,10 +26,10 @@ THE SOFTWARE.
...
@@ -26,10 +26,10 @@ THE SOFTWARE.
#include "babeld.h"
#include "babeld.h"
#ifdef __APPLE__
#ifdef __linux
#include "kernel_socket.c"
#else
#include "kernel_netlink.c"
#include "kernel_netlink.c"
#else
#include "kernel_socket.c"
#endif
#endif
/* Like gettimeofday, but returns monotonic time. If POSIX clocks are not
/* Like gettimeofday, but returns monotonic time. If POSIX clocks are not
...
...
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