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
1121ea30
Commit
1121ea30
authored
Oct 18, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fall back to other interfaces when we fail to find a MAC address.
parent
338eb19b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
babel.c
babel.c
+17
-1
No files found.
babel.c
View file @
1121ea30
...
@@ -103,7 +103,7 @@ int
...
@@ -103,7 +103,7 @@ int
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
struct
sockaddr_in6
sin6
;
struct
sockaddr_in6
sin6
;
int
rc
,
fd
,
rfd
;
int
rc
,
fd
,
rfd
,
i
;
time_t
expiry_time
,
source_expiry_time
,
kernel_dump_time
;
time_t
expiry_time
,
source_expiry_time
,
kernel_dump_time
;
char
*
config_file
=
NULL
;
char
*
config_file
=
NULL
;
void
*
vrc
;
void
*
vrc
;
...
@@ -378,6 +378,22 @@ main(int argc, char **argv)
...
@@ -378,6 +378,22 @@ main(int argc, char **argv)
}
}
}
}
/* We failed to get a global EUI64 from the interfaces we were given.
Let's hope we find an interface with a MAC address among the first
five. */
for
(
i
=
0
;
i
<
5
;
i
++
)
{
char
buf
[
IF_NAMESIZE
],
*
ifname
;
unsigned
char
eui
[
8
];
ifname
=
if_indextoname
(
i
,
buf
);
if
(
ifname
==
NULL
)
continue
;
rc
=
if_eui64
(
ifname
,
i
,
eui
);
if
(
rc
<
0
)
continue
;
memcpy
(
myid
,
eui
,
8
);
goto
have_id
;
}
fprintf
(
stderr
,
fprintf
(
stderr
,
"Warning: couldn't find router id -- using random value.
\n
"
);
"Warning: couldn't find router id -- using random value.
\n
"
);
if
(
rfd
>=
0
)
{
if
(
rfd
>=
0
)
{
...
...
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