Skip to content

Commit b74d3fe

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
Jesse Gross says: ==================== Open vSwitch Four small fixes for net/3.14. I realize that these are late in the cycle - just got back from vacation. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f518338 + f9b8c4c commit b74d3fe

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

net/openvswitch/datapath.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ static void ovs_dp_reset_user_features(struct sk_buff *skb, struct genl_info *in
11741174
struct datapath *dp;
11751175

11761176
dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs);
1177-
if (!dp)
1177+
if (IS_ERR(dp))
11781178
return;
11791179

11801180
WARN(dp->user_features, "Dropping previously announced user features\n");
@@ -1762,11 +1762,12 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
17621762
int bucket = cb->args[0], skip = cb->args[1];
17631763
int i, j = 0;
17641764

1765+
rcu_read_lock();
17651766
dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
1766-
if (!dp)
1767+
if (!dp) {
1768+
rcu_read_unlock();
17671769
return -ENODEV;
1768-
1769-
rcu_read_lock();
1770+
}
17701771
for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) {
17711772
struct vport *vport;
17721773

net/openvswitch/flow.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb)
7373

7474
if ((flow->key.eth.type == htons(ETH_P_IP) ||
7575
flow->key.eth.type == htons(ETH_P_IPV6)) &&
76+
flow->key.ip.frag != OVS_FRAG_TYPE_LATER &&
7677
flow->key.ip.proto == IPPROTO_TCP &&
7778
likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
7879
tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
@@ -91,7 +92,7 @@ static void stats_read(struct flow_stats *stats,
9192
unsigned long *used, __be16 *tcp_flags)
9293
{
9394
spin_lock(&stats->lock);
94-
if (time_after(stats->used, *used))
95+
if (!*used || time_after(stats->used, *used))
9596
*used = stats->used;
9697
*tcp_flags |= stats->tcp_flags;
9798
ovs_stats->n_packets += stats->packet_count;

0 commit comments

Comments
 (0)