+ /* If OVS_CB(skb)->tun_key is NULL, point it at the local tun_key here,
+ * and zero it out.
+ */
+ if (!OVS_CB(skb)->tun_key) {
+ memset(&tun_key, 0, sizeof(tun_key));
+ OVS_CB(skb)->tun_key = &tun_key;
+ }
+
+ tunnel_hlen = tnl_vport->tnl_ops->hdr_len(mutable, OVS_CB(skb)->tun_key);
+ if (unlikely(tunnel_hlen < 0)) {
+ err = VPORT_E_TX_DROPPED;
+ goto error_free;
+ }
+ tunnel_hlen += sizeof(struct iphdr);
+
+ if (OVS_CB(skb)->tun_key->ipv4_dst) {
+ daddr = OVS_CB(skb)->tun_key->ipv4_dst;
+ saddr = OVS_CB(skb)->tun_key->ipv4_src;
+ tos = OVS_CB(skb)->tun_key->ipv4_tos;
+ ttl = OVS_CB(skb)->tun_key->ipv4_ttl;
+ } else {
+ u8 inner_tos;
+ daddr = mutable->key.daddr;
+ saddr = mutable->key.saddr;
+
+ if (unlikely(!daddr)) {
+ /* Trying to sent packet from Null-port without
+ * tunnel info? Drop this packet. */
+ err = VPORT_E_TX_DROPPED;
+ goto error_free;
+ }
+
+ /* ToS */
+ if (skb->protocol == htons(ETH_P_IP))
+ inner_tos = ip_hdr(skb)->tos;