Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
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
linux
Commits
c5baa80a
Commit
c5baa80a
authored
May 08, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
parents
1c430a72
072ae631
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
net/openvswitch/datapath.c
net/openvswitch/datapath.c
+17
-10
net/openvswitch/flow.c
net/openvswitch/flow.c
+2
-1
No files found.
net/openvswitch/datapath.c
View file @
c5baa80a
...
...
@@ -421,6 +421,19 @@ static int validate_sample(const struct nlattr *attr,
return
validate_actions
(
actions
,
key
,
depth
+
1
);
}
static
int
validate_tp_port
(
const
struct
sw_flow_key
*
flow_key
)
{
if
(
flow_key
->
eth
.
type
==
htons
(
ETH_P_IP
))
{
if
(
flow_key
->
ipv4
.
tp
.
src
&&
flow_key
->
ipv4
.
tp
.
dst
)
return
0
;
}
else
if
(
flow_key
->
eth
.
type
==
htons
(
ETH_P_IPV6
))
{
if
(
flow_key
->
ipv6
.
tp
.
src
&&
flow_key
->
ipv6
.
tp
.
dst
)
return
0
;
}
return
-
EINVAL
;
}
static
int
validate_set
(
const
struct
nlattr
*
a
,
const
struct
sw_flow_key
*
flow_key
)
{
...
...
@@ -462,18 +475,13 @@ static int validate_set(const struct nlattr *a,
if
(
flow_key
->
ip
.
proto
!=
IPPROTO_TCP
)
return
-
EINVAL
;
if
(
!
flow_key
->
ipv4
.
tp
.
src
||
!
flow_key
->
ipv4
.
tp
.
dst
)
return
-
EINVAL
;
break
;
return
validate_tp_port
(
flow_key
);
case
OVS_KEY_ATTR_UDP
:
if
(
flow_key
->
ip
.
proto
!=
IPPROTO_UDP
)
return
-
EINVAL
;
if
(
!
flow_key
->
ipv4
.
tp
.
src
||
!
flow_key
->
ipv4
.
tp
.
dst
)
return
-
EINVAL
;
break
;
return
validate_tp_port
(
flow_key
);
default:
return
-
EINVAL
;
...
...
@@ -1641,10 +1649,9 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
reply
=
ovs_vport_cmd_build_info
(
vport
,
info
->
snd_pid
,
info
->
snd_seq
,
OVS_VPORT_CMD_NEW
);
if
(
IS_ERR
(
reply
))
{
err
=
PTR_ERR
(
reply
);
netlink_set_err
(
init_net
.
genl_sock
,
0
,
ovs_dp_vport_multicast_group
.
id
,
err
);
return
0
;
ovs_dp_vport_multicast_group
.
id
,
PTR_ERR
(
reply
)
);
goto
exit_unlock
;
}
genl_notify
(
reply
,
genl_info_net
(
info
),
info
->
snd_pid
,
...
...
net/openvswitch/flow.c
View file @
c5baa80a
...
...
@@ -183,7 +183,8 @@ void ovs_flow_used(struct sw_flow *flow, struct sk_buff *skb)
u8
tcp_flags
=
0
;
if
(
flow
->
key
.
eth
.
type
==
htons
(
ETH_P_IP
)
&&
flow
->
key
.
ip
.
proto
==
IPPROTO_TCP
)
{
flow
->
key
.
ip
.
proto
==
IPPROTO_TCP
&&
likely
(
skb
->
len
>=
skb_transport_offset
(
skb
)
+
sizeof
(
struct
tcphdr
)))
{
u8
*
tcp
=
(
u8
*
)
tcp_hdr
(
skb
);
tcp_flags
=
*
(
tcp
+
TCP_FLAGS_OFFSET
)
&
TCP_FLAG_MASK
;
}
...
...
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