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
205c61d6
Commit
205c61d6
authored
May 23, 2014
by
Matthieu Boutier
Committed by
Juliusz Chroboczek
Jun 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use modern netlink constants (replace RTM* by RTNL*).
parent
bd039703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
kernel_netlink.c
kernel_netlink.c
+12
-3
No files found.
kernel_netlink.c
View file @
205c61d6
...
@@ -596,6 +596,12 @@ kernel_setup(int setup)
...
@@ -596,6 +596,12 @@ kernel_setup(int setup)
}
}
}
}
static
inline
unsigned
int
rtnlgrp_to_mask
(
unsigned
int
grp
)
{
return
grp
?
1
<<
(
grp
-
1
)
:
0
;
}
int
int
kernel_setup_socket
(
int
setup
)
kernel_setup_socket
(
int
setup
)
{
{
...
@@ -603,10 +609,13 @@ kernel_setup_socket(int setup)
...
@@ -603,10 +609,13 @@ kernel_setup_socket(int setup)
if
(
setup
)
{
if
(
setup
)
{
rc
=
netlink_socket
(
&
nl_listen
,
rc
=
netlink_socket
(
&
nl_listen
,
RTMGRP_IPV6_ROUTE
|
RTMGRP_IPV4_ROUTE
rtnlgrp_to_mask
(
RTNLGRP_IPV6_ROUTE
)
|
RTMGRP_LINK
|
RTMGRP_IPV4_IFADDR
|
RTMGRP_IPV6_IFADDR
);
|
rtnlgrp_to_mask
(
RTNLGRP_IPV4_ROUTE
)
|
rtnlgrp_to_mask
(
RTNLGRP_LINK
)
|
rtnlgrp_to_mask
(
RTNLGRP_IPV4_IFADDR
)
|
rtnlgrp_to_mask
(
RTNLGRP_IPV6_IFADDR
));
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
perror
(
"netlink_socket(
RTMGRP_ROUTE | RTMGRP_LINK | RTMGRP
_IFADDR)"
);
perror
(
"netlink_socket(
_ROUTE | _LINK |
_IFADDR)"
);
kernel_socket
=
-
1
;
kernel_socket
=
-
1
;
return
-
1
;
return
-
1
;
}
}
...
...
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