Skip to content

Commit 296b601

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
Jesse Gross says: ==================== A few different bug fixes, including several for issues with userspace communication that have gone unnoticed up until now. These are intended for net/3.9. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 3f104c3 + d176ca2 commit 296b601

5 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎net/openvswitch/actions.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci)
5858

5959
if (skb->ip_summed == CHECKSUM_COMPLETE)
6060
skb->csum = csum_sub(skb->csum, csum_partial(skb->data
61-
+ ETH_HLEN, VLAN_HLEN, 0));
61+
+ (2 * ETH_ALEN), VLAN_HLEN, 0));
6262

6363
vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN);
6464
*current_tci = vhdr->h_vlan_TCI;
@@ -115,7 +115,7 @@ static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vla
115115

116116
if (skb->ip_summed == CHECKSUM_COMPLETE)
117117
skb->csum = csum_add(skb->csum, csum_partial(skb->data
118-
+ ETH_HLEN, VLAN_HLEN, 0));
118+
+ (2 * ETH_ALEN), VLAN_HLEN, 0));
119119

120120
}
121121
__vlan_hwaccel_put_tag(skb, ntohs(vlan->vlan_tci) & ~VLAN_TAG_PRESENT);

‎net/openvswitch/datapath.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
394394

395395
skb_copy_and_csum_dev(skb, nla_data(nla));
396396

397+
genlmsg_end(user_skb, upcall);
397398
err = genlmsg_unicast(net, user_skb, upcall_info->portid);
398399

399400
out:
@@ -1690,6 +1691,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info)
16901691
if (IS_ERR(vport))
16911692
goto exit_unlock;
16921693

1694+
err = 0;
16931695
reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,
16941696
OVS_VPORT_CMD_NEW);
16951697
if (IS_ERR(reply)) {
@@ -1771,6 +1773,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info)
17711773
if (IS_ERR(reply))
17721774
goto exit_unlock;
17731775

1776+
err = 0;
17741777
ovs_dp_detach_port(vport);
17751778

17761779
genl_notify(reply, genl_info_net(info), info->snd_portid,

‎net/openvswitch/flow.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,11 @@ static __be16 parse_ethertype(struct sk_buff *skb)
482482
return htons(ETH_P_802_2);
483483

484484
__skb_pull(skb, sizeof(struct llc_snap_hdr));
485-
return llc->ethertype;
485+
486+
if (ntohs(llc->ethertype) >= 1536)
487+
return llc->ethertype;
488+
489+
return htons(ETH_P_802_2);
486490
}
487491

488492
static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key,

‎net/openvswitch/vport-netdev.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ static void netdev_port_receive(struct vport *vport, struct sk_buff *skb)
4343

4444
/* Make our own copy of the packet. Otherwise we will mangle the
4545
* packet for anyone who came before us (e.g. tcpdump via AF_PACKET).
46-
* (No one comes after us, since we tell handle_bridge() that we took
47-
* the packet.) */
46+
*/
4847
skb = skb_share_check(skb, GFP_ATOMIC);
4948
if (unlikely(!skb))
5049
return;

‎net/openvswitch/vport.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb)
325325
* @skb: skb that was received
326326
*
327327
* Must be called with rcu_read_lock. The packet cannot be shared and
328-
* skb->data should point to the Ethernet header. The caller must have already
329-
* called compute_ip_summed() to initialize the checksumming fields.
328+
* skb->data should point to the Ethernet header.
330329
*/
331330
void ovs_vport_receive(struct vport *vport, struct sk_buff *skb)
332331
{

0 commit comments

Comments
 (0)