int low;
if (!hash) {
- struct sw_flow_key *pkt_key = OVS_CB(skb)->pkt_key;
-
- if (skb->protocol == htons(ETH_P_IP))
- hash = jhash2((const u32 *)&pkt_key->ipv4.addr,
- sizeof(pkt_key->ipv4.addr) / sizeof(u32), 0);
- else if (skb->protocol == htons(ETH_P_IPV6))
- hash = jhash2((const u32 *)&pkt_key->ipv6.addr,
- sizeof(pkt_key->ipv6.addr) / sizeof(u32), 0);
- else
+ if (skb->protocol == htons(ETH_P_IP)) {
+ struct iphdr *iph;
+ int size = (sizeof(iph->saddr) * 2) / sizeof(u32);
+
+ iph = (struct iphdr *) skb_inner_network_header(skb);
+ hash = jhash2((const u32 *)&iph->saddr, size, 0);
+ } else if (skb->protocol == htons(ETH_P_IPV6)) {
+ struct ipv6hdr *ipv6hdr;
+
+ ipv6hdr = (struct ipv6hdr *) skb_inner_network_header(skb);
+ hash = jhash2((const u32 *)&ipv6hdr->saddr,
+ (sizeof(struct in6_addr) * 2) / sizeof(u32), 0);
+ } else {
pr_warn_once("LISP inner protocol is not IP when "
"calculating hash.\n");
+ }
}
inet_get_local_port_range(net, &low, &high);
if (err)
goto err_free_rt;
- skb->local_df = 1;
+ skb->ignore_df = 1;
df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
- sent_len = iptunnel_xmit(rt, skb,
+ sent_len = iptunnel_xmit(skb->sk, rt, skb,
saddr, tun_key->ipv4_dst,
IPPROTO_UDP, tun_key->ipv4_tos,
tun_key->ipv4_ttl, df, false);