Commit c559cd3a authored by Eric W. Biederman's avatar Eric W. Biederman

openvswitch: Pass net into ovs_fragment

In preparation for the ipv4 and ipv6 fragmentation code taking a net
parameter pass a struct net into ovs_fragment where the v4 and v6
fragmentation code is called.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 188515fb
...@@ -684,8 +684,8 @@ static void prepare_frag(struct vport *vport, struct sk_buff *skb) ...@@ -684,8 +684,8 @@ static void prepare_frag(struct vport *vport, struct sk_buff *skb)
skb_pull(skb, hlen); skb_pull(skb, hlen);
} }
static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru, static void ovs_fragment(struct net *net, struct vport *vport,
__be16 ethertype) struct sk_buff *skb, u16 mru, __be16 ethertype)
{ {
if (skb_network_offset(skb) > MAX_L2_LEN) { if (skb_network_offset(skb) > MAX_L2_LEN) {
OVS_NLERR(1, "L2 header too long to fragment"); OVS_NLERR(1, "L2 header too long to fragment");
...@@ -748,6 +748,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port, ...@@ -748,6 +748,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
if (likely(!mru || (skb->len <= mru + ETH_HLEN))) { if (likely(!mru || (skb->len <= mru + ETH_HLEN))) {
ovs_vport_send(vport, skb); ovs_vport_send(vport, skb);
} else if (mru <= vport->dev->mtu) { } else if (mru <= vport->dev->mtu) {
struct net *net = read_pnet(&dp->net);
__be16 ethertype = key->eth.type; __be16 ethertype = key->eth.type;
if (!is_flow_key_valid(key)) { if (!is_flow_key_valid(key)) {
...@@ -757,7 +758,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port, ...@@ -757,7 +758,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
ethertype = vlan_get_protocol(skb); ethertype = vlan_get_protocol(skb);
} }
ovs_fragment(vport, skb, mru, ethertype); ovs_fragment(net, vport, skb, mru, ethertype);
} else { } else {
kfree_skb(skb); kfree_skb(skb);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment