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
69be46c5
Commit
69be46c5
authored
Jun 26, 2015
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into net-next
parents
a1b99717
bbd303d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
33 deletions
+31
-33
ip/ipmroute.c
ip/ipmroute.c
+18
-8
ip/iptunnel.c
ip/iptunnel.c
+4
-0
misc/ss.c
misc/ss.c
+1
-1
tc/m_pedit.c
tc/m_pedit.c
+8
-24
No files found.
ip/ipmroute.c
View file @
69be46c5
...
...
@@ -97,15 +97,25 @@ int print_mroute(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if
(
filter
.
af
&&
filter
.
af
!=
r
->
rtm_family
)
return
0
;
if
(
tb
[
RTA_DST
]
&&
filter
.
mdst
.
bitlen
>
0
&&
inet_addr_match
(
RTA_DATA
(
tb
[
RTA_DST
]),
&
filter
.
mdst
,
filter
.
mdst
.
bitlen
))
return
0
;
if
(
tb
[
RTA_DST
]
&&
filter
.
mdst
.
bitlen
>
0
)
{
inet_prefix
dst
;
memset
(
&
dst
,
0
,
sizeof
(
dst
));
dst
.
family
=
r
->
rtm_family
;
memcpy
(
&
dst
.
data
,
RTA_DATA
(
tb
[
RTA_DST
]),
RTA_PAYLOAD
(
tb
[
RTA_DST
]));
if
(
inet_addr_match
(
&
dst
,
&
filter
.
mdst
,
filter
.
mdst
.
bitlen
))
return
0
;
}
if
(
tb
[
RTA_SRC
]
&&
filter
.
msrc
.
bitlen
>
0
&&
inet_addr_match
(
RTA_DATA
(
tb
[
RTA_SRC
]),
&
filter
.
msrc
,
filter
.
msrc
.
bitlen
))
return
0
;
if
(
tb
[
RTA_SRC
]
&&
filter
.
msrc
.
bitlen
>
0
)
{
inet_prefix
src
;
memset
(
&
src
,
0
,
sizeof
(
src
));
src
.
family
=
r
->
rtm_family
;
memcpy
(
&
src
.
data
,
RTA_DATA
(
tb
[
RTA_SRC
]),
RTA_PAYLOAD
(
tb
[
RTA_SRC
]));
if
(
inet_addr_match
(
&
src
,
&
filter
.
msrc
,
filter
.
msrc
.
bitlen
))
return
0
;
}
family
=
r
->
rtm_family
==
RTNL_FAMILY_IPMR
?
AF_INET
:
AF_INET6
;
...
...
ip/iptunnel.c
View file @
69be46c5
...
...
@@ -167,10 +167,14 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
NEXT_ARG
();
if
(
strcmp
(
*
argv
,
"any"
))
p
->
iph
.
daddr
=
get_addr32
(
*
argv
);
else
p
->
iph
.
daddr
=
htonl
(
INADDR_ANY
);
}
else
if
(
strcmp
(
*
argv
,
"local"
)
==
0
)
{
NEXT_ARG
();
if
(
strcmp
(
*
argv
,
"any"
))
p
->
iph
.
saddr
=
get_addr32
(
*
argv
);
else
p
->
iph
.
saddr
=
htonl
(
INADDR_ANY
);
}
else
if
(
strcmp
(
*
argv
,
"dev"
)
==
0
)
{
NEXT_ARG
();
strncpy
(
medium
,
*
argv
,
IFNAMSIZ
-
1
);
...
...
misc/ss.c
View file @
69be46c5
...
...
@@ -1085,7 +1085,7 @@ static int run_ssfilter(struct ssfilter *f, struct sockstat *s)
strspn
(
p
+
1
,
"0123456789abcdef"
)
==
5
);
}
if
(
s
->
local
.
family
==
AF_PACKET
)
return
s
->
lport
==
0
&&
s
->
local
.
data
==
0
;
return
s
->
lport
==
0
&&
s
->
local
.
data
[
0
]
==
0
;
if
(
s
->
local
.
family
==
AF_NETLINK
)
return
s
->
lport
<
0
;
...
...
tc/m_pedit.c
View file @
69be46c5
...
...
@@ -160,17 +160,9 @@ pack_key32(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
int
pack_key16
(
__u32
retain
,
struct
tc_pedit_sel
*
sel
,
struct
tc_pedit_key
*
tkey
)
{
int
ind
=
0
,
stride
=
0
;
int
ind
,
stride
;
__u32
m
[
4
]
=
{
0xFFFF0000
,
0xFF0000FF
,
0x0000FFFF
};
if
(
0
>
tkey
->
off
)
{
ind
=
tkey
->
off
+
1
;
if
(
0
>
ind
)
ind
=
-
1
*
ind
;
}
else
{
ind
=
tkey
->
off
;
}
if
(
tkey
->
val
>
0xFFFF
||
tkey
->
mask
>
0xFFFF
)
{
fprintf
(
stderr
,
"pack_key16 bad value
\n
"
);
return
-
1
;
...
...
@@ -178,18 +170,16 @@ pack_key16(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
ind
=
tkey
->
off
&
3
;
if
(
0
>
ind
||
2
<
ind
)
{
if
(
ind
==
3
)
{
fprintf
(
stderr
,
"pack_key16 bad index value %d
\n
"
,
ind
);
return
-
1
;
}
stride
=
8
*
ind
;
tkey
->
val
=
htons
(
tkey
->
val
);
if
(
stride
>
0
)
{
tkey
->
val
<<=
stride
;
tkey
->
mask
<<=
stride
;
retain
<<=
stride
;
}
tkey
->
val
<<=
stride
;
tkey
->
mask
<<=
stride
;
retain
<<=
stride
;
tkey
->
mask
=
retain
|
m
[
ind
];
tkey
->
off
&=
~
3
;
...
...
@@ -203,28 +193,22 @@ pack_key16(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
int
pack_key8
(
__u32
retain
,
struct
tc_pedit_sel
*
sel
,
struct
tc_pedit_key
*
tkey
)
{
int
ind
=
0
,
stride
=
0
;
int
ind
,
stride
;
__u32
m
[
4
]
=
{
0xFFFFFF00
,
0xFFFF00FF
,
0xFF00FFFF
,
0x00FFFFFF
};
if
(
0
>
tkey
->
off
)
{
ind
=
tkey
->
off
+
1
;
if
(
0
>
ind
)
ind
=
-
1
*
ind
;
}
else
{
ind
=
tkey
->
off
;
}
if
(
tkey
->
val
>
0xFF
||
tkey
->
mask
>
0xFF
)
{
fprintf
(
stderr
,
"pack_key8 bad value (val %x mask %x
\n
"
,
tkey
->
val
,
tkey
->
mask
);
return
-
1
;
}
ind
=
tkey
->
off
&
3
;
stride
=
8
*
ind
;
tkey
->
val
<<=
stride
;
tkey
->
mask
<<=
stride
;
retain
<<=
stride
;
tkey
->
mask
=
retain
|
m
[
ind
];
tkey
->
off
&=
~
3
;
if
(
pedit_debug
)
...
...
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