aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/Kconfig1
-rw-r--r--net/openvswitch/datapath.c4
-rw-r--r--net/openvswitch/datapath.h4
-rw-r--r--net/openvswitch/flow_netlink.c10
4 files changed, 9 insertions, 10 deletions
diff --git a/net/openvswitch/Kconfig b/net/openvswitch/Kconfig
index b7d818c59423..ed6b0f8dd1bb 100644
--- a/net/openvswitch/Kconfig
+++ b/net/openvswitch/Kconfig
@@ -6,6 +6,7 @@ config OPENVSWITCH
6 tristate "Open vSwitch" 6 tristate "Open vSwitch"
7 depends on INET 7 depends on INET
8 select LIBCRC32C 8 select LIBCRC32C
9 select MPLS
9 select NET_MPLS_GSO 10 select NET_MPLS_GSO
10 ---help--- 11 ---help---
11 Open vSwitch is a multilayer Ethernet switch targeted at virtualized 12 Open vSwitch is a multilayer Ethernet switch targeted at virtualized
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 5bae7243c577..096c6276e6b9 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -203,7 +203,6 @@ static void destroy_dp_rcu(struct rcu_head *rcu)
203 203
204 ovs_flow_tbl_destroy(&dp->table); 204 ovs_flow_tbl_destroy(&dp->table);
205 free_percpu(dp->stats_percpu); 205 free_percpu(dp->stats_percpu);
206 release_net(ovs_dp_get_net(dp));
207 kfree(dp->ports); 206 kfree(dp->ports);
208 kfree(dp); 207 kfree(dp);
209} 208}
@@ -1501,7 +1500,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
1501 if (dp == NULL) 1500 if (dp == NULL)
1502 goto err_free_reply; 1501 goto err_free_reply;
1503 1502
1504 ovs_dp_set_net(dp, hold_net(sock_net(skb->sk))); 1503 ovs_dp_set_net(dp, sock_net(skb->sk));
1505 1504
1506 /* Allocate table. */ 1505 /* Allocate table. */
1507 err = ovs_flow_tbl_init(&dp->table); 1506 err = ovs_flow_tbl_init(&dp->table);
@@ -1575,7 +1574,6 @@ err_destroy_percpu:
1575err_destroy_table: 1574err_destroy_table:
1576 ovs_flow_tbl_destroy(&dp->table); 1575 ovs_flow_tbl_destroy(&dp->table);
1577err_free_dp: 1576err_free_dp:
1578 release_net(ovs_dp_get_net(dp));
1579 kfree(dp); 1577 kfree(dp);
1580err_free_reply: 1578err_free_reply:
1581 kfree_skb(reply); 1579 kfree_skb(reply);
diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h
index 3ece94563079..4ec4a480b147 100644
--- a/net/openvswitch/datapath.h
+++ b/net/openvswitch/datapath.h
@@ -84,10 +84,8 @@ struct datapath {
84 /* Stats. */ 84 /* Stats. */
85 struct dp_stats_percpu __percpu *stats_percpu; 85 struct dp_stats_percpu __percpu *stats_percpu;
86 86
87#ifdef CONFIG_NET_NS
88 /* Network namespace ref. */ 87 /* Network namespace ref. */
89 struct net *net; 88 possible_net_t net;
90#endif
91 89
92 u32 user_features; 90 u32 user_features;
93}; 91};
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index 22b18c145c92..c691b1a1eee0 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -535,11 +535,11 @@ static int ipv4_tun_from_nlattr(const struct nlattr *attr,
535 break; 535 break;
536 case OVS_TUNNEL_KEY_ATTR_IPV4_SRC: 536 case OVS_TUNNEL_KEY_ATTR_IPV4_SRC:
537 SW_FLOW_KEY_PUT(match, tun_key.ipv4_src, 537 SW_FLOW_KEY_PUT(match, tun_key.ipv4_src,
538 nla_get_be32(a), is_mask); 538 nla_get_in_addr(a), is_mask);
539 break; 539 break;
540 case OVS_TUNNEL_KEY_ATTR_IPV4_DST: 540 case OVS_TUNNEL_KEY_ATTR_IPV4_DST:
541 SW_FLOW_KEY_PUT(match, tun_key.ipv4_dst, 541 SW_FLOW_KEY_PUT(match, tun_key.ipv4_dst,
542 nla_get_be32(a), is_mask); 542 nla_get_in_addr(a), is_mask);
543 break; 543 break;
544 case OVS_TUNNEL_KEY_ATTR_TOS: 544 case OVS_TUNNEL_KEY_ATTR_TOS:
545 SW_FLOW_KEY_PUT(match, tun_key.ipv4_tos, 545 SW_FLOW_KEY_PUT(match, tun_key.ipv4_tos,
@@ -648,10 +648,12 @@ static int __ipv4_tun_to_nlattr(struct sk_buff *skb,
648 nla_put_be64(skb, OVS_TUNNEL_KEY_ATTR_ID, output->tun_id)) 648 nla_put_be64(skb, OVS_TUNNEL_KEY_ATTR_ID, output->tun_id))
649 return -EMSGSIZE; 649 return -EMSGSIZE;
650 if (output->ipv4_src && 650 if (output->ipv4_src &&
651 nla_put_be32(skb, OVS_TUNNEL_KEY_ATTR_IPV4_SRC, output->ipv4_src)) 651 nla_put_in_addr(skb, OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
652 output->ipv4_src))
652 return -EMSGSIZE; 653 return -EMSGSIZE;
653 if (output->ipv4_dst && 654 if (output->ipv4_dst &&
654 nla_put_be32(skb, OVS_TUNNEL_KEY_ATTR_IPV4_DST, output->ipv4_dst)) 655 nla_put_in_addr(skb, OVS_TUNNEL_KEY_ATTR_IPV4_DST,
656 output->ipv4_dst))
655 return -EMSGSIZE; 657 return -EMSGSIZE;
656 if (output->ipv4_tos && 658 if (output->ipv4_tos &&
657 nla_put_u8(skb, OVS_TUNNEL_KEY_ATTR_TOS, output->ipv4_tos)) 659 nla_put_u8(skb, OVS_TUNNEL_KEY_ATTR_TOS, output->ipv4_tos))