[qca-nss-clients] Fix GRE exception handler
Added ethernet protocol type translation to be compatible
with 3.14.
Change-Id: I4fba9c309929fa644ad4ccd58c9071cd14fd5087
Signed-off-by: Subhash Kumar Katnpally <skatnapa@codeaurora.org>
diff --git a/gre/nss_connmgr_gre.c b/gre/nss_connmgr_gre.c
index 9b39dae..adaf7c3 100644
--- a/gre/nss_connmgr_gre.c
+++ b/gre/nss_connmgr_gre.c
@@ -372,7 +372,7 @@
return;
}
eth_hdr = (struct ethhdr *)skb->data;
- if (likely(eth_proto_is_802_3(eth_hdr->h_proto))) {
+ if (likely(ntohs(eth_hdr->h_proto) >= ETH_P_802_3_MIN)) {
switch (ntohs(eth_hdr->h_proto)) {
case ETH_P_IP:
if (unlikely(!pskb_may_pull(skb, sizeof(struct iphdr)))) {
diff --git a/gre/nss_connmgr_gre_v4.c b/gre/nss_connmgr_gre_v4.c
index 6275738..111720f 100644
--- a/gre/nss_connmgr_gre_v4.c
+++ b/gre/nss_connmgr_gre_v4.c
@@ -192,7 +192,7 @@
iphdr->tos = cfg->tos << 2;
if (cfg->tos_inherit) {
- iphdr->tos |= 0x1 ;
+ iphdr->tos |= 0x1;
}
iphdr->ttl = cfg->ttl;
@@ -256,7 +256,7 @@
return;
}
skb->dev = dev;
- if (likely(eth_proto_is_802_3(eth_hdr->h_proto))) {
+ if (likely(ntohs(eth_hdr->h_proto) >= ETH_P_802_3_MIN)) {
skb->protocol = eth_hdr->h_proto;
} else {
skb->protocol = htons(ETH_P_802_2);
diff --git a/gre/nss_connmgr_gre_v6.c b/gre/nss_connmgr_gre_v6.c
index 01fcc47..f3c3ef8 100644
--- a/gre/nss_connmgr_gre_v6.c
+++ b/gre/nss_connmgr_gre_v6.c
@@ -158,12 +158,9 @@
return;
}
skb->dev = dev;
- if (likely(eth_proto_is_802_3(eth->h_proto))) {
+ if (likely(ntohs(eth->h_proto) >= ETH_P_802_3_MIN)) {
skb->protocol = eth->h_proto;
} else {
- /*
- * Real 802.2 LLC
- */
skb->protocol = htons(ETH_P_802_2);
}
skb_reset_mac_header(skb);