datapath: Add ref counting for flows.
[openvswitch] / datapath / vport-gre.c
index 31d2d4f621efb317131dd5c355d8d79ac71dd0f8..0a7092f96646c885a4920acaeb2a570b8c60d857 100644 (file)
@@ -6,6 +6,8 @@
  * kernel, by Linus Torvalds and others.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/if.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
@@ -48,9 +50,10 @@ static int gre_hdr_len(const struct tnl_port_config *port_config)
        return len;
 }
 
-static void gre_build_header(struct sk_buff *skb,
-                            const struct vport *vport,
-                            const struct tnl_mutable_config *mutable)
+static struct sk_buff *gre_build_header(struct sk_buff *skb,
+                                       const struct vport *vport,
+                                       const struct tnl_mutable_config *mutable,
+                                       struct dst_entry *dst)
 {
        struct gre_base_hdr *greh = (struct gre_base_hdr *)skb_transport_header(skb);
        __be32 *options = (__be32 *)(skb_network_header(skb) + mutable->tunnel_hlen
@@ -81,6 +84,14 @@ static void gre_build_header(struct sk_buff *skb,
                                                skb->len - sizeof(struct iphdr),
                                                0));
        }
+
+       /*
+        * Allow our local IP stack to fragment the outer packet even if the
+        * DF bit is set as a last resort.
+        */
+       skb->local_df = 1;
+
+       return skb;
 }
 
 static int parse_header(struct iphdr *iph, __be16 *flags, __be32 *key)
@@ -336,7 +347,7 @@ static int gre_init(void)
 
        err = inet_add_protocol(&gre_protocol_handlers, IPPROTO_GRE);
        if (err) {
-               printk(KERN_WARNING "openvswitch: cannot register gre protocol handler\n");
+               pr_warn("cannot register gre protocol handler\n");
                goto out;
        }