From 6fd2bc3164673b9e6b8975316f2c08c9a01472d5 Mon Sep 17 00:00:00 2001
From: Ben Cartwright-Cox <Ben@Benjojo.co.uk>
Date: Sat, 24 Oct 2015 22:16:09 +0100
Subject: [PATCH] [IPv4] RFC3514 - Set the evil bit on IPv4 packets as defined
 by RFC3514

---
 net/ipv4/ip_output.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 6c8875c..d7a2aae 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -144,6 +144,9 @@ int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
 		iph->frag_off = htons(IP_DF);
 	else
 		iph->frag_off = 0;
+
+	iph->frag_off |= htons(IP_DF)<< 1; // Set the "evil" bit
+
 	iph->ttl      = ip_select_ttl(inet, &rt->dst);
 	iph->daddr    = (opt && opt->opt.srr ? opt->opt.faddr : daddr);
 	iph->saddr    = saddr;
@@ -375,6 +378,9 @@ packet_routed:
 		iph->frag_off = htons(IP_DF);
 	else
 		iph->frag_off = 0;
+
+	iph->frag_off |= htons(IP_DF)<< 1; // Set the "evil" bit
+
 	iph->ttl      = ip_select_ttl(inet, &rt->dst);
 	iph->protocol = sk->sk_protocol;
 	ip_copy_addrs(iph, fl4);
-- 
1.9.1

