diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2018-11-09 00:18:03 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-08 20:45:04 -0800 |
commit | 5978f8a9fb492a74765822a545f16eb879fab937 (patch) | |
tree | f9925556bf4571f5e85b3d489a4a466d40c44532 /net/bridge/br_netfilter_hooks.c | |
parent | 418a976d6c68d0835ffebf755cdbd53e9b9c6e7f (diff) | |
download | linux-stable-5978f8a9fb492a74765822a545f16eb879fab937.tar.gz linux-stable-5978f8a9fb492a74765822a545f16eb879fab937.tar.bz2 linux-stable-5978f8a9fb492a74765822a545f16eb879fab937.zip |
bridge: use __vlan_hwaccel helpers
This removes assumption than vlan_tci != 0 when tag is present.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_netfilter_hooks.c')
-rw-r--r-- | net/bridge/br_netfilter_hooks.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index b1b5e8516724..c9383c470a83 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c @@ -671,10 +671,8 @@ static int br_nf_push_frag_xmit(struct net *net, struct sock *sk, struct sk_buff return 0; } - if (data->vlan_tci) { - skb->vlan_tci = data->vlan_tci; - skb->vlan_proto = data->vlan_proto; - } + if (data->vlan_proto) + __vlan_hwaccel_put_tag(skb, data->vlan_proto, data->vlan_tci); skb_copy_to_linear_data_offset(skb, -data->size, data->mac, data->size); __skb_push(skb, data->encap_size); @@ -740,8 +738,13 @@ static int br_nf_dev_queue_xmit(struct net *net, struct sock *sk, struct sk_buff data = this_cpu_ptr(&brnf_frag_data_storage); - data->vlan_tci = skb->vlan_tci; - data->vlan_proto = skb->vlan_proto; + if (skb_vlan_tag_present(skb)) { + data->vlan_tci = skb->vlan_tci; + data->vlan_proto = skb->vlan_proto; + } else { + data->vlan_proto = 0; + } + data->encap_size = nf_bridge_encap_header_len(skb); data->size = ETH_HLEN + data->encap_size; |