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
1f7d3dd5
Commit
1f7d3dd5
authored
Jan 03, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use kdebugf in kernel_netlink.
parent
6b10a54f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
kernel_netlink.c
kernel_netlink.c
+15
-15
No files found.
kernel_netlink.c
View file @
1f7d3dd5
...
...
@@ -220,35 +220,35 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer,
msg
.
msg_namelen
);
goto
socket_error
;
}
else
if
(
nladdr
.
nl_pid
!=
0
)
{
debugf
(
"netlink_read: message not sent by kernel.
\n
"
);
k
debugf
(
"netlink_read: message not sent by kernel.
\n
"
);
return
2
;
}
debugf
(
"Netlink message: "
);
k
debugf
(
"Netlink message: "
);
for
(
nh
=
(
struct
nlmsghdr
*
)
buf
;
NLMSG_OK
(
nh
,
len
);
nh
=
NLMSG_NEXT
(
nh
,
len
))
{
debugf
(
"%s"
,
(
nh
->
nlmsg_flags
&
NLM_F_MULTI
)
?
"[multi] "
:
""
);
k
debugf
(
"%s"
,
(
nh
->
nlmsg_flags
&
NLM_F_MULTI
)
?
"[multi] "
:
""
);
if
(
!
answer
)
done
=
1
;
if
(
nl_ignore
&&
nh
->
nlmsg_pid
==
nl_ignore
->
sockaddr
.
nl_pid
)
{
debugf
(
"(ignore), "
);
k
debugf
(
"(ignore), "
);
continue
;
}
else
if
(
answer
&&
(
nh
->
nlmsg_pid
!=
nl
->
sockaddr
.
nl_pid
||
nh
->
nlmsg_seq
!=
nl
->
seqno
))
{
debugf
(
"(wrong seqno %d %d /pid %d %d), "
,
k
debugf
(
"(wrong seqno %d %d /pid %d %d), "
,
nh
->
nlmsg_seq
,
nl
->
seqno
,
nh
->
nlmsg_pid
,
nl
->
sockaddr
.
nl_pid
);
continue
;
}
else
if
(
nh
->
nlmsg_type
==
NLMSG_DONE
)
{
debugf
(
"(done)
\n
"
);
k
debugf
(
"(done)
\n
"
);
done
=
1
;
break
;
}
else
if
(
nh
->
nlmsg_type
==
NLMSG_ERROR
)
{
struct
nlmsgerr
*
err
=
(
struct
nlmsgerr
*
)
NLMSG_DATA
(
nh
);
if
(
err
->
error
==
0
)
{
debugf
(
"(ACK)
\n
"
);
k
debugf
(
"(ACK)
\n
"
);
return
0
;
}
else
{
errno
=
-
err
->
error
;
...
...
@@ -257,16 +257,16 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer,
return
-
1
;
}
}
else
if
(
fn
)
{
debugf
(
"(msg ->
\"
"
);
k
debugf
(
"(msg ->
\"
"
);
err
=
fn
(
nh
,
data
);
debugf
(
"
\"
%d), "
,
err
);
k
debugf
(
"
\"
%d), "
,
err
);
if
(
err
<
0
)
return
err
;
interesting
=
interesting
||
err
;
continue
;
}
debugf
(
", "
);
k
debugf
(
", "
);
}
debugf
(
"
\n
"
);
k
debugf
(
"
\n
"
);
if
(
msg
.
msg_flags
&
MSG_TRUNC
)
fprintf
(
stderr
,
"netlink_read: message truncated
\n
"
);
...
...
@@ -666,7 +666,7 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
return
rc
;
}
debugf
(
"kernel_route: %s %s/%d metric %d dev %d nexthop %s
\n
"
,
k
debugf
(
"kernel_route: %s %s/%d metric %d dev %d nexthop %s
\n
"
,
operation
==
ROUTE_ADD
?
"add"
:
operation
==
ROUTE_FLUSH
?
"flush"
:
"???"
,
format_address
(
dest
),
plen
,
metric
,
ifindex
,
...
...
@@ -810,11 +810,11 @@ print_kernel_route(int add, int protocol, int type,
addr_prefix
,
sizeof
(
addr_prefix
))
||
!
inet_ntop
(
AF_INET6
,
route
->
gw
,
addr_gw
,
sizeof
(
addr_gw
))
||
!
if_indextoname
(
route
->
ifindex
,
ifname
))
{
debugf
(
"Couldn't format kernel route for printing."
);
k
debugf
(
"Couldn't format kernel route for printing."
);
return
;
}
debugf
(
"%s kernel route: dest: %s/%d gw: %s metric: %d if: %s "
k
debugf
(
"%s kernel route: dest: %s/%d gw: %s metric: %d if: %s "
"(proto: %d, type: %d)"
,
add
==
RTM_NEWROUTE
?
"Add"
:
"Delete"
,
addr_prefix
,
route
->
plen
,
addr_gw
,
route
->
metric
,
ifname
,
...
...
@@ -943,7 +943,7 @@ kernel_callback(int (*fn)(void*), void *closure)
{
int
rc
;
debugf
(
"
\n
Received changes in kernel tables.
\n
"
);
k
debugf
(
"
\n
Received changes in kernel tables.
\n
"
);
if
(
nl_listen
.
sock
<
0
)
{
rc
=
kernel_setup_socket
(
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