Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
iproute2
Commits
52a4474d
Commit
52a4474d
authored
Mar 21, 2016
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netconf: replace macro with a function
The number of casts in macro was excessive.
parent
b7e0091a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
ip/ipnetconf.c
ip/ipnetconf.c
+7
-4
No files found.
ip/ipnetconf.c
View file @
52a4474d
...
...
@@ -24,8 +24,7 @@
#include "utils.h"
#include "ip_common.h"
static
struct
{
static
struct
{
int
family
;
int
ifindex
;
}
filter
;
...
...
@@ -38,7 +37,11 @@ static void usage(void)
exit
(
-
1
);
}
#define NETCONF_RTA(r) ((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct netconfmsg))))
static
struct
rtattr
*
netconf_rta
(
struct
netconfmsg
*
ncm
)
{
return
(
struct
rtattr
*
)((
char
*
)
ncm
+
NLMSG_ALIGN
(
sizeof
(
struct
netconfmsg
)));
}
int
print_netconf
(
const
struct
sockaddr_nl
*
who
,
struct
rtnl_ctrl_data
*
ctrl
,
struct
nlmsghdr
*
n
,
void
*
arg
)
...
...
@@ -65,7 +68,7 @@ int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
if
(
filter
.
family
&&
filter
.
family
!=
ncm
->
ncm_family
)
return
0
;
parse_rtattr
(
tb
,
NETCONFA_MAX
,
NETCONF_RTA
(
ncm
),
parse_rtattr
(
tb
,
NETCONFA_MAX
,
netconf_rta
(
ncm
),
NLMSG_PAYLOAD
(
n
,
sizeof
(
*
ncm
)));
switch
(
ncm
->
ncm_family
)
{
...
...
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