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
9b372b9a
Commit
9b372b9a
authored
Oct 18, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle native EUI-64 devices when generating router-ids.
parent
63d1a36f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
kernel_netlink.c
kernel_netlink.c
+22
-10
No files found.
kernel_netlink.c
View file @
9b372b9a
...
...
@@ -82,6 +82,8 @@ if_eui64(char *ifname, int ifindex, unsigned char *eui)
switch
(
ifr
.
ifr_hwaddr
.
sa_family
)
{
case
ARPHRD_ETHER
:
case
ARPHRD_FDDI
:
case
ARPHRD_IEEE802_TR
:
case
ARPHRD_IEEE802
:
{
unsigned
char
*
mac
;
mac
=
(
unsigned
char
*
)
ifr
.
ifr_hwaddr
.
sa_data
;
...
...
@@ -91,21 +93,31 @@ if_eui64(char *ifname, int ifindex, unsigned char *eui)
errno
=
ENOENT
;
return
-
1
;
}
eui
[
0
]
=
mac
[
0
]
^
2
;
eui
[
1
]
=
mac
[
1
];
eui
[
2
]
=
mac
[
2
];
memcpy
(
eui
,
mac
,
3
);
eui
[
3
]
=
0xFF
;
eui
[
4
]
=
0xFE
;
eui
[
5
]
=
mac
[
3
];
eui
[
6
]
=
mac
[
4
];
eui
[
7
]
=
mac
[
5
];
memcpy
(
eui
+
5
,
mac
+
3
,
3
);
eui
[
0
]
^=
2
;
return
1
;
}
case
ARPHRD_EUI64
:
case
ARPHRD_IEEE1394
:
case
ARPHRD_INFINIBAND
:
{
unsigned
char
*
mac
;
mac
=
(
unsigned
char
*
)
ifr
.
ifr_hwaddr
.
sa_data
;
if
(
memcmp
(
mac
,
zeroes
,
8
)
==
0
||
(
mac
[
0
]
&
1
)
!=
0
||
(
mac
[
0
]
&
2
)
!=
0
)
{
errno
=
ENOENT
;
return
-
1
;
}
memcpy
(
eui
,
mac
,
64
);
eui
[
0
]
^=
2
;
return
1
;
}
default:
errno
=
ENOENT
;
return
-
1
;
}
errno
=
ENOENT
;
return
-
1
;
}
static
int
...
...
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