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
9259c483
Commit
9259c483
authored
Mar 07, 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
d47775c4
81e5d41d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
12 deletions
+35
-12
net/openvswitch/actions.c
net/openvswitch/actions.c
+32
-12
net/openvswitch/datapath.c
net/openvswitch/datapath.c
+3
-0
No files found.
net/openvswitch/actions.c
View file @
9259c483
/*
* Copyright (c) 2007-201
1
Nicira Networks.
* Copyright (c) 2007-201
2
Nicira Networks.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
...
...
@@ -145,9 +145,16 @@ static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh,
inet_proto_csum_replace4
(
&
tcp_hdr
(
skb
)
->
check
,
skb
,
*
addr
,
new_addr
,
1
);
}
else
if
(
nh
->
protocol
==
IPPROTO_UDP
)
{
if
(
likely
(
transport_len
>=
sizeof
(
struct
udphdr
)))
inet_proto_csum_replace4
(
&
udp_hdr
(
skb
)
->
check
,
skb
,
*
addr
,
new_addr
,
1
);
if
(
likely
(
transport_len
>=
sizeof
(
struct
udphdr
)))
{
struct
udphdr
*
uh
=
udp_hdr
(
skb
);
if
(
uh
->
check
||
skb
->
ip_summed
==
CHECKSUM_PARTIAL
)
{
inet_proto_csum_replace4
(
&
uh
->
check
,
skb
,
*
addr
,
new_addr
,
1
);
if
(
!
uh
->
check
)
uh
->
check
=
CSUM_MANGLED_0
;
}
}
}
csum_replace4
(
&
nh
->
check
,
*
addr
,
new_addr
);
...
...
@@ -197,8 +204,22 @@ static void set_tp_port(struct sk_buff *skb, __be16 *port,
skb
->
rxhash
=
0
;
}
static
int
set_udp_port
(
struct
sk_buff
*
skb
,
const
struct
ovs_key_udp
*
udp_port_key
)
static
void
set_udp_port
(
struct
sk_buff
*
skb
,
__be16
*
port
,
__be16
new_port
)
{
struct
udphdr
*
uh
=
udp_hdr
(
skb
);
if
(
uh
->
check
&&
skb
->
ip_summed
!=
CHECKSUM_PARTIAL
)
{
set_tp_port
(
skb
,
port
,
new_port
,
&
uh
->
check
);
if
(
!
uh
->
check
)
uh
->
check
=
CSUM_MANGLED_0
;
}
else
{
*
port
=
new_port
;
skb
->
rxhash
=
0
;
}
}
static
int
set_udp
(
struct
sk_buff
*
skb
,
const
struct
ovs_key_udp
*
udp_port_key
)
{
struct
udphdr
*
uh
;
int
err
;
...
...
@@ -210,16 +231,15 @@ static int set_udp_port(struct sk_buff *skb,
uh
=
udp_hdr
(
skb
);
if
(
udp_port_key
->
udp_src
!=
uh
->
source
)
set_
tp_port
(
skb
,
&
uh
->
source
,
udp_port_key
->
udp_src
,
&
uh
->
check
);
set_
udp_port
(
skb
,
&
uh
->
source
,
udp_port_key
->
udp_src
);
if
(
udp_port_key
->
udp_dst
!=
uh
->
dest
)
set_
tp_port
(
skb
,
&
uh
->
dest
,
udp_port_key
->
udp_dst
,
&
uh
->
check
);
set_
udp_port
(
skb
,
&
uh
->
dest
,
udp_port_key
->
udp_dst
);
return
0
;
}
static
int
set_tcp_port
(
struct
sk_buff
*
skb
,
const
struct
ovs_key_tcp
*
tcp_port_key
)
static
int
set_tcp
(
struct
sk_buff
*
skb
,
const
struct
ovs_key_tcp
*
tcp_port_key
)
{
struct
tcphdr
*
th
;
int
err
;
...
...
@@ -328,11 +348,11 @@ static int execute_set_action(struct sk_buff *skb,
break
;
case
OVS_KEY_ATTR_TCP
:
err
=
set_tcp
_port
(
skb
,
nla_data
(
nested_attr
));
err
=
set_tcp
(
skb
,
nla_data
(
nested_attr
));
break
;
case
OVS_KEY_ATTR_UDP
:
err
=
set_udp
_port
(
skb
,
nla_data
(
nested_attr
));
err
=
set_udp
(
skb
,
nla_data
(
nested_attr
));
break
;
}
...
...
net/openvswitch/datapath.c
View file @
9259c483
...
...
@@ -1521,6 +1521,9 @@ static struct vport *lookup_vport(struct ovs_header *ovs_header,
vport
=
ovs_vport_locate
(
nla_data
(
a
[
OVS_VPORT_ATTR_NAME
]));
if
(
!
vport
)
return
ERR_PTR
(
-
ENODEV
);
if
(
ovs_header
->
dp_ifindex
&&
ovs_header
->
dp_ifindex
!=
get_dpifindex
(
vport
->
dp
))
return
ERR_PTR
(
-
ENODEV
);
return
vport
;
}
else
if
(
a
[
OVS_VPORT_ATTR_PORT_NO
])
{
u32
port_no
=
nla_get_u32
(
a
[
OVS_VPORT_ATTR_PORT_NO
]);
...
...
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