Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
86c3eea0
Commit
86c3eea0
authored
Feb 21, 2015
by
Ondřej Zajíček
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use AF_UNSPEC for RTM_GETLINK
This value is specified in documentation.
parent
2bbc3083
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
sysdep/linux/netlink.c
sysdep/linux/netlink.c
+5
-7
No files found.
sysdep/linux/netlink.c
View file @
86c3eea0
...
...
@@ -95,7 +95,7 @@ nl_send(struct nl_sock *nl, struct nlmsghdr *nh)
}
static
void
nl_request_dump
(
int
cmd
)
nl_request_dump
(
int
af
,
int
cmd
)
{
struct
{
struct
nlmsghdr
nh
;
...
...
@@ -104,9 +104,7 @@ nl_request_dump(int cmd)
req
.
nh
.
nlmsg_type
=
cmd
;
req
.
nh
.
nlmsg_len
=
sizeof
(
req
);
req
.
nh
.
nlmsg_flags
=
NLM_F_REQUEST
|
NLM_F_DUMP
;
/* Is it important which AF_* is used for link-level interface scan?
It seems that some information is available only when AF_INET is used. */
req
.
g
.
rtgen_family
=
(
cmd
==
RTM_GETLINK
)
?
AF_INET
:
BIRD_AF
;
req
.
g
.
rtgen_family
=
af
;
nl_send
(
&
nl_scan
,
&
req
.
nh
);
}
...
...
@@ -563,14 +561,14 @@ kif_do_scan(struct kif_proto *p UNUSED)
if_start_update
();
nl_request_dump
(
RTM_GETLINK
);
nl_request_dump
(
AF_UNSPEC
,
RTM_GETLINK
);
while
(
h
=
nl_get_scan
())
if
(
h
->
nlmsg_type
==
RTM_NEWLINK
||
h
->
nlmsg_type
==
RTM_DELLINK
)
nl_parse_link
(
h
,
1
);
else
log
(
L_DEBUG
"nl_scan_ifaces: Unknown packet received (type=%d)"
,
h
->
nlmsg_type
);
nl_request_dump
(
RTM_GETADDR
);
nl_request_dump
(
BIRD_AF
,
RTM_GETADDR
);
while
(
h
=
nl_get_scan
())
if
(
h
->
nlmsg_type
==
RTM_NEWADDR
||
h
->
nlmsg_type
==
RTM_DELADDR
)
nl_parse_addr
(
h
,
1
);
...
...
@@ -942,7 +940,7 @@ krt_do_scan(struct krt_proto *p UNUSED) /* CONFIG_ALL_TABLES_AT_ONCE => p is NUL
{
struct
nlmsghdr
*
h
;
nl_request_dump
(
RTM_GETROUTE
);
nl_request_dump
(
BIRD_AF
,
RTM_GETROUTE
);
while
(
h
=
nl_get_scan
())
if
(
h
->
nlmsg_type
==
RTM_NEWROUTE
||
h
->
nlmsg_type
==
RTM_DELROUTE
)
nl_parse_route
(
h
,
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