Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fdcbd313
Commit
fdcbd313
authored
Jan 02, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Added support for direct routes when using NET_RT_DUMP.
parent
988ff087
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
ipstats.c
dlls/iphlpapi/ipstats.c
+25
-17
No files found.
dlls/iphlpapi/ipstats.c
View file @
fdcbd313
...
...
@@ -1497,15 +1497,13 @@ DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForw
continue
;
}
/* Ignore all entries except for gateway routes which aren't
multicast */
if
(
!
(
rtm
->
rtm_flags
&
RTF_GATEWAY
)
||
(
rtm
->
rtm_flags
&
RTF_MULTICAST
))
/* Ignore gateway routes which are multicast */
if
((
rtm
->
rtm_flags
&
RTF_GATEWAY
)
&&
(
rtm
->
rtm_flags
&
RTF_MULTICAST
))
continue
;
memset
(
&
row
,
0
,
sizeof
(
row
)
);
row
.
dwForwardIfIndex
=
rtm
->
rtm_index
;
row
.
u1
.
ForwardType
=
MIB_IPROUTE_TYPE_IN
DIRECT
;
row
.
u1
.
ForwardType
=
(
rtm
->
rtm_flags
&
RTF_GATEWAY
)
?
MIB_IPROUTE_TYPE_INDIRECT
:
MIB_IPROUTE_TYPE_
DIRECT
;
row
.
dwForwardMetric1
=
rtm
->
rtm_rmx
.
rmx_hopcount
;
row
.
u2
.
ForwardProto
=
MIB_IPPROTO_LOCAL
;
...
...
@@ -1523,19 +1521,29 @@ DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForw
ADVANCE
(
addrPtr
,
sa
);
/* default routes are encoded by length-zero sockaddr */
if
(
sa
->
sa_len
==
0
)
if
(
sa
->
sa_len
==
0
)
{
addr
=
0
;
else
if
(
sa
->
sa_family
!=
AF_INET
)
{
WARN
(
"Received unsupported sockaddr family 0x%x
\n
"
,
sa
->
sa_family
);
addr
=
0
;
}
else
{
struct
sockaddr_in
*
sin
=
(
struct
sockaddr_in
*
)
sa
;
addr
=
sin
->
sin_addr
.
s_addr
;
}
else
{
switch
(
sa
->
sa_family
)
{
case
AF_INET
:
{
struct
sockaddr_in
*
sin
=
(
struct
sockaddr_in
*
)
sa
;
addr
=
sin
->
sin_addr
.
s_addr
;
break
;
}
#ifdef AF_LINK
case
AF_LINK
:
if
(
i
==
RTA_GATEWAY
&&
row
.
u1
.
ForwardType
==
MIB_IPROUTE_TYPE_DIRECT
)
{
/* For direct route we may simply use dest addr as next hop */
C_ASSERT
(
RTA_DST
<
RTA_GATEWAY
);
addr
=
row
.
dwForwardDest
;
break
;
}
/* fallthrough */
#endif
default:
WARN
(
"Received unsupported sockaddr family 0x%x
\n
"
,
sa
->
sa_family
);
addr
=
0
;
}
}
switch
(
i
)
...
...
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