Skip to content
Snippets Groups Projects
Commit 103229a3 authored by Aastha Mehta's avatar Aastha Mehta
Browse files

disable IP ID in real packets

parent 276227e6
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,9 @@
#include <linux/netfilter_bridge.h>
#include <linux/netlink.h>
#include <linux/tcp.h>
#if defined(CONFIG_PACER_TCP)
#include "../../../drivers/net/ethernet/broadcom/bnx2x/sme/ptcp_hooks.h"
#endif
static int
ip_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
......@@ -146,6 +149,9 @@ int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk,
struct rtable *rt = skb_rtable(skb);
struct net *net = sock_net(sk);
struct iphdr *iph;
#if defined(CONFIG_XEN_SME) && defined(CONFIG_PACER_TCP)
int paced_ret = ptcp_is_paced_flow((struct sock *) sk);
#endif
/* Build the IP header. */
skb_push(skb, sizeof(struct iphdr) + (opt ? opt->opt.optlen : 0));
......@@ -166,6 +172,12 @@ int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk,
__ip_select_ident(net, iph, 1);
}
#if defined(CONFIG_XEN_SME) && defined(CONFIG_PACER_TCP)
if (paced_ret == 0) {
iph->id = 0;
}
#endif
if (opt && opt->opt.optlen) {
iph->ihl += opt->opt.optlen>>2;
ip_options_build(skb, &opt->opt, daddr, rt, 0);
......@@ -406,6 +418,9 @@ int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl)
struct rtable *rt;
struct iphdr *iph;
int res;
#if defined(CONFIG_XEN_SME) && defined(CONFIG_PACER_TCP)
int paced_ret = ptcp_is_paced_flow(sk);
#endif
/* Skip all of this if the packet is already routed,
* f.e. by something like SCTP.
......@@ -471,6 +486,12 @@ packet_routed:
ip_select_ident_segs(net, skb, sk,
skb_shinfo(skb)->gso_segs ?: 1);
#if defined(CONFIG_XEN_SME) && defined(CONFIG_PACER_TCP)
if (paced_ret == 0) {
iph->id = 0;
}
#endif
/* TODO : should we use skb->sk here instead of sk ? */
skb->priority = sk->sk_priority;
skb->mark = sk->sk_mark;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment