Commit 60ff7467 authored by WANG Cong's avatar WANG Cong Committed by David S. Miller

net: rename local_df to ignore_df

As suggested by several people, rename local_df to ignore_df,
since it means "ignore df bit if it is set".

Cc: Maciej Żenczykowski <maze@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Acked-by: default avatarMaciej Żenczykowski <maze@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5f013c9b
...@@ -426,7 +426,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1, ...@@ -426,7 +426,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,
* @csum_start: Offset from skb->head where checksumming should start * @csum_start: Offset from skb->head where checksumming should start
* @csum_offset: Offset from csum_start where checksum should be stored * @csum_offset: Offset from csum_start where checksum should be stored
* @priority: Packet queueing priority * @priority: Packet queueing priority
* @local_df: allow local fragmentation * @ignore_df: allow local fragmentation
* @cloned: Head may be cloned (check refcnt to be sure) * @cloned: Head may be cloned (check refcnt to be sure)
* @ip_summed: Driver fed us an IP checksum * @ip_summed: Driver fed us an IP checksum
* @nohdr: Payload reference only, must not modify header * @nohdr: Payload reference only, must not modify header
...@@ -514,7 +514,7 @@ struct sk_buff { ...@@ -514,7 +514,7 @@ struct sk_buff {
}; };
__u32 priority; __u32 priority;
kmemcheck_bitfield_begin(flags1); kmemcheck_bitfield_begin(flags1);
__u8 local_df:1, __u8 ignore_df:1,
cloned:1, cloned:1,
ip_summed:2, ip_summed:2,
nohdr:1, nohdr:1,
......
...@@ -269,7 +269,7 @@ static inline bool ip_sk_use_pmtu(const struct sock *sk) ...@@ -269,7 +269,7 @@ static inline bool ip_sk_use_pmtu(const struct sock *sk)
return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
} }
static inline bool ip_sk_local_df(const struct sock *sk) static inline bool ip_sk_ignore_df(const struct sock *sk)
{ {
return inet_sk(sk)->pmtudisc < IP_PMTUDISC_DO || return inet_sk(sk)->pmtudisc < IP_PMTUDISC_DO ||
inet_sk(sk)->pmtudisc == IP_PMTUDISC_OMIT; inet_sk(sk)->pmtudisc == IP_PMTUDISC_OMIT;
...@@ -304,7 +304,7 @@ static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, s ...@@ -304,7 +304,7 @@ static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, s
{ {
struct iphdr *iph = ip_hdr(skb); struct iphdr *iph = ip_hdr(skb);
if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) {
/* This is only to work around buggy Windows95/2000 /* This is only to work around buggy Windows95/2000
* VJ compression implementations. If the ID field * VJ compression implementations. If the ID field
* does not change, they drop every other packet in * does not change, they drop every other packet in
...@@ -320,7 +320,7 @@ static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *d ...@@ -320,7 +320,7 @@ static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *d
{ {
struct iphdr *iph = ip_hdr(skb); struct iphdr *iph = ip_hdr(skb);
if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) {
if (sk && inet_sk(sk)->inet_daddr) { if (sk && inet_sk(sk)->inet_daddr) {
iph->id = htons(inet_sk(sk)->inet_id); iph->id = htons(inet_sk(sk)->inet_id);
inet_sk(sk)->inet_id += 1 + more; inet_sk(sk)->inet_id += 1 + more;
......
...@@ -185,7 +185,7 @@ static inline bool ip6_sk_accept_pmtu(const struct sock *sk) ...@@ -185,7 +185,7 @@ static inline bool ip6_sk_accept_pmtu(const struct sock *sk)
inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_OMIT; inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_OMIT;
} }
static inline bool ip6_sk_local_df(const struct sock *sk) static inline bool ip6_sk_ignore_df(const struct sock *sk)
{ {
return inet6_sk(sk)->pmtudisc < IPV6_PMTUDISC_DO || return inet6_sk(sk)->pmtudisc < IPV6_PMTUDISC_DO ||
inet6_sk(sk)->pmtudisc == IPV6_PMTUDISC_OMIT; inet6_sk(sk)->pmtudisc == IPV6_PMTUDISC_OMIT;
......
...@@ -694,7 +694,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old) ...@@ -694,7 +694,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
#endif #endif
memcpy(new->cb, old->cb, sizeof(old->cb)); memcpy(new->cb, old->cb, sizeof(old->cb));
new->csum = old->csum; new->csum = old->csum;
new->local_df = old->local_df; new->ignore_df = old->ignore_df;
new->pkt_type = old->pkt_type; new->pkt_type = old->pkt_type;
new->ip_summed = old->ip_summed; new->ip_summed = old->ip_summed;
skb_copy_queue_mapping(new, old); skb_copy_queue_mapping(new, old);
...@@ -3913,7 +3913,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) ...@@ -3913,7 +3913,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
skb->tstamp.tv64 = 0; skb->tstamp.tv64 = 0;
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
skb->skb_iif = 0; skb->skb_iif = 0;
skb->local_df = 0; skb->ignore_df = 0;
skb_dst_drop(skb); skb_dst_drop(skb);
skb->mark = 0; skb->mark = 0;
secpath_reset(skb); secpath_reset(skb);
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
static bool ip_may_fragment(const struct sk_buff *skb) static bool ip_may_fragment(const struct sk_buff *skb)
{ {
return unlikely((ip_hdr(skb)->frag_off & htons(IP_DF)) == 0) || return unlikely((ip_hdr(skb)->frag_off & htons(IP_DF)) == 0) ||
skb->local_df; skb->ignore_df;
} }
static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu) static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
......
...@@ -415,7 +415,7 @@ int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl) ...@@ -415,7 +415,7 @@ int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl)
skb_reset_network_header(skb); skb_reset_network_header(skb);
iph = ip_hdr(skb); iph = ip_hdr(skb);
*((__be16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff)); *((__be16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff));
if (ip_dont_fragment(sk, &rt->dst) && !skb->local_df) if (ip_dont_fragment(sk, &rt->dst) && !skb->ignore_df)
iph->frag_off = htons(IP_DF); iph->frag_off = htons(IP_DF);
else else
iph->frag_off = 0; iph->frag_off = 0;
...@@ -501,7 +501,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) ...@@ -501,7 +501,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
iph = ip_hdr(skb); iph = ip_hdr(skb);
mtu = ip_skb_dst_mtu(skb); mtu = ip_skb_dst_mtu(skb);
if (unlikely(((iph->frag_off & htons(IP_DF)) && !skb->local_df) || if (unlikely(((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) ||
(IPCB(skb)->frag_max_size && (IPCB(skb)->frag_max_size &&
IPCB(skb)->frag_max_size > mtu))) { IPCB(skb)->frag_max_size > mtu))) {
IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS); IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
...@@ -866,7 +866,7 @@ static int __ip_append_data(struct sock *sk, ...@@ -866,7 +866,7 @@ static int __ip_append_data(struct sock *sk,
fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0);
maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen;
maxnonfragsize = ip_sk_local_df(sk) ? 0xFFFF : mtu; maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu;
if (cork->length + length > maxnonfragsize - fragheaderlen) { if (cork->length + length > maxnonfragsize - fragheaderlen) {
ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
...@@ -1189,7 +1189,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, ...@@ -1189,7 +1189,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0);
maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen;
maxnonfragsize = ip_sk_local_df(sk) ? 0xFFFF : mtu; maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu;
if (cork->length + size > maxnonfragsize - fragheaderlen) { if (cork->length + size > maxnonfragsize - fragheaderlen) {
ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
...@@ -1350,10 +1350,10 @@ struct sk_buff *__ip_make_skb(struct sock *sk, ...@@ -1350,10 +1350,10 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
* to fragment the frame generated here. No matter, what transforms * to fragment the frame generated here. No matter, what transforms
* how transforms change size of the packet, it will come out. * how transforms change size of the packet, it will come out.
*/ */
skb->local_df = ip_sk_local_df(sk); skb->ignore_df = ip_sk_ignore_df(sk);
/* DF bit is set when we want to see DF on outgoing frames. /* DF bit is set when we want to see DF on outgoing frames.
* If local_df is set too, we still allow to fragment this frame * If ignore_df is set too, we still allow to fragment this frame
* locally. */ * locally. */
if (inet->pmtudisc == IP_PMTUDISC_DO || if (inet->pmtudisc == IP_PMTUDISC_DO ||
inet->pmtudisc == IP_PMTUDISC_PROBE || inet->pmtudisc == IP_PMTUDISC_PROBE ||
......
...@@ -34,7 +34,7 @@ static int nf_ct_ipv4_gather_frags(struct sk_buff *skb, u_int32_t user) ...@@ -34,7 +34,7 @@ static int nf_ct_ipv4_gather_frags(struct sk_buff *skb, u_int32_t user)
if (!err) { if (!err) {
ip_send_check(ip_hdr(skb)); ip_send_check(ip_hdr(skb));
skb->local_df = 1; skb->ignore_df = 1;
} }
return err; return err;
......
...@@ -25,7 +25,7 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb) ...@@ -25,7 +25,7 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE) if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE)
goto out; goto out;
if (!(ip_hdr(skb)->frag_off & htons(IP_DF)) || skb->local_df) if (!(ip_hdr(skb)->frag_off & htons(IP_DF)) || skb->ignore_df)
goto out; goto out;
mtu = dst_mtu(skb_dst(skb)); mtu = dst_mtu(skb_dst(skb));
......
...@@ -219,7 +219,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, ...@@ -219,7 +219,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
skb->mark = sk->sk_mark; skb->mark = sk->sk_mark;
mtu = dst_mtu(dst); mtu = dst_mtu(dst);
if ((skb->len <= mtu) || skb->local_df || skb_is_gso(skb)) { if ((skb->len <= mtu) || skb->ignore_df || skb_is_gso(skb)) {
IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)), IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)),
IPSTATS_MIB_OUT, skb->len); IPSTATS_MIB_OUT, skb->len);
return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL, return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL,
...@@ -347,11 +347,11 @@ static bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu) ...@@ -347,11 +347,11 @@ static bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
if (skb->len <= mtu) if (skb->len <= mtu)
return false; return false;
/* ipv6 conntrack defrag sets max_frag_size + local_df */ /* ipv6 conntrack defrag sets max_frag_size + ignore_df */
if (IP6CB(skb)->frag_max_size && IP6CB(skb)->frag_max_size > mtu) if (IP6CB(skb)->frag_max_size && IP6CB(skb)->frag_max_size > mtu)
return true; return true;
if (skb->local_df) if (skb->ignore_df)
return false; return false;
if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu) if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu)
...@@ -559,7 +559,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) ...@@ -559,7 +559,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
/* We must not fragment if the socket is set to force MTU discovery /* We must not fragment if the socket is set to force MTU discovery
* or if the skb it not generated by a local socket. * or if the skb it not generated by a local socket.
*/ */
if (unlikely(!skb->local_df && skb->len > mtu) || if (unlikely(!skb->ignore_df && skb->len > mtu) ||
(IP6CB(skb)->frag_max_size && (IP6CB(skb)->frag_max_size &&
IP6CB(skb)->frag_max_size > mtu)) { IP6CB(skb)->frag_max_size > mtu)) {
if (skb->sk && dst_allfrag(skb_dst(skb))) if (skb->sk && dst_allfrag(skb_dst(skb)))
...@@ -1234,7 +1234,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, ...@@ -1234,7 +1234,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
sizeof(struct frag_hdr) : 0) + sizeof(struct frag_hdr) : 0) +
rt->rt6i_nfheader_len; rt->rt6i_nfheader_len;
if (ip6_sk_local_df(sk)) if (ip6_sk_ignore_df(sk))
maxnonfragsize = sizeof(struct ipv6hdr) + IPV6_MAXPLEN; maxnonfragsize = sizeof(struct ipv6hdr) + IPV6_MAXPLEN;
else else
maxnonfragsize = mtu; maxnonfragsize = mtu;
...@@ -1544,7 +1544,7 @@ int ip6_push_pending_frames(struct sock *sk) ...@@ -1544,7 +1544,7 @@ int ip6_push_pending_frames(struct sock *sk)
} }
/* Allow local fragmentation. */ /* Allow local fragmentation. */
skb->local_df = ip6_sk_local_df(sk); skb->ignore_df = ip6_sk_ignore_df(sk);
*final_dst = fl6->daddr; *final_dst = fl6->daddr;
__skb_pull(skb, skb_network_header_len(skb)); __skb_pull(skb, skb_network_header_len(skb));
......
...@@ -451,7 +451,7 @@ nf_ct_frag6_reasm(struct frag_queue *fq, struct net_device *dev) ...@@ -451,7 +451,7 @@ nf_ct_frag6_reasm(struct frag_queue *fq, struct net_device *dev)
} }
sub_frag_mem_limit(&fq->q, head->truesize); sub_frag_mem_limit(&fq->q, head->truesize);
head->local_df = 1; head->ignore_df = 1;
head->next = NULL; head->next = NULL;
head->dev = dev; head->dev = dev;
head->tstamp = fq->q.stamp; head->tstamp = fq->q.stamp;
......
...@@ -78,7 +78,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb) ...@@ -78,7 +78,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
if (mtu < IPV6_MIN_MTU) if (mtu < IPV6_MIN_MTU)
mtu = IPV6_MIN_MTU; mtu = IPV6_MIN_MTU;
if (!skb->local_df && skb->len > mtu) { if (!skb->ignore_df && skb->len > mtu) {
skb->dev = dst->dev; skb->dev = dst->dev;
if (xfrm6_local_dontfrag(skb)) if (xfrm6_local_dontfrag(skb))
...@@ -120,7 +120,7 @@ int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb) ...@@ -120,7 +120,7 @@ int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb)
#endif #endif
skb->protocol = htons(ETH_P_IPV6); skb->protocol = htons(ETH_P_IPV6);
skb->local_df = 1; skb->ignore_df = 1;
return x->outer_mode->output2(x, skb); return x->outer_mode->output2(x, skb);
} }
...@@ -150,7 +150,7 @@ static int __xfrm6_output(struct sk_buff *skb) ...@@ -150,7 +150,7 @@ static int __xfrm6_output(struct sk_buff *skb)
if (skb->len > mtu && xfrm6_local_dontfrag(skb)) { if (skb->len > mtu && xfrm6_local_dontfrag(skb)) {
xfrm6_local_rxpmtu(skb, mtu); xfrm6_local_rxpmtu(skb, mtu);
return -EMSGSIZE; return -EMSGSIZE;
} else if (!skb->local_df && skb->len > mtu && skb->sk) { } else if (!skb->ignore_df && skb->len > mtu && skb->sk) {
xfrm_local_error(skb, mtu); xfrm_local_error(skb, mtu);
return -EMSGSIZE; return -EMSGSIZE;
} }
......
...@@ -1073,7 +1073,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, ...@@ -1073,7 +1073,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,
} }
/* Queue the packet to IP for output */ /* Queue the packet to IP for output */
skb->local_df = 1; skb->ignore_df = 1;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
if (tunnel->sock->sk_family == PF_INET6 && !tunnel->v4mapped) if (tunnel->sock->sk_family == PF_INET6 && !tunnel->v4mapped)
error = inet6_csk_xmit(tunnel->sock, skb, NULL); error = inet6_csk_xmit(tunnel->sock, skb, NULL);
......
...@@ -562,7 +562,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -562,7 +562,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
ip_send_check(iph); ip_send_check(iph);
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0); ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0);
rcu_read_unlock(); rcu_read_unlock();
...@@ -590,7 +590,7 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -590,7 +590,7 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
goto tx_error; goto tx_error;
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0); ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0);
rcu_read_unlock(); rcu_read_unlock();
...@@ -684,7 +684,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -684,7 +684,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
MTU problem. */ MTU problem. */
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local); rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local);
rcu_read_unlock(); rcu_read_unlock();
...@@ -774,7 +774,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -774,7 +774,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
MTU problem. */ MTU problem. */
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local); rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local);
rcu_read_unlock(); rcu_read_unlock();
...@@ -886,7 +886,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -886,7 +886,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
ip_select_ident(skb, &rt->dst, NULL); ip_select_ident(skb, &rt->dst, NULL);
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
ret = ip_vs_tunnel_xmit_prepare(skb, cp); ret = ip_vs_tunnel_xmit_prepare(skb, cp);
if (ret == NF_ACCEPT) if (ret == NF_ACCEPT)
...@@ -974,7 +974,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -974,7 +974,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
iph->hop_limit = old_iph->hop_limit; iph->hop_limit = old_iph->hop_limit;
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
ret = ip_vs_tunnel_xmit_prepare(skb, cp); ret = ip_vs_tunnel_xmit_prepare(skb, cp);
if (ret == NF_ACCEPT) if (ret == NF_ACCEPT)
...@@ -1023,7 +1023,7 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -1023,7 +1023,7 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
ip_send_check(ip_hdr(skb)); ip_send_check(ip_hdr(skb));
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0); ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0);
rcu_read_unlock(); rcu_read_unlock();
...@@ -1060,7 +1060,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -1060,7 +1060,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
} }
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0); ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0);
rcu_read_unlock(); rcu_read_unlock();
...@@ -1157,7 +1157,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -1157,7 +1157,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
ip_vs_nat_icmp(skb, pp, cp, 0); ip_vs_nat_icmp(skb, pp, cp, 0);
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local); rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local);
rcu_read_unlock(); rcu_read_unlock();
...@@ -1249,7 +1249,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -1249,7 +1249,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
ip_vs_nat_icmp_v6(skb, pp, cp, 0); ip_vs_nat_icmp_v6(skb, pp, cp, 0);
/* Another hack: avoid icmp_send in ip_fragment */ /* Another hack: avoid icmp_send in ip_fragment */
skb->local_df = 1; skb->ignore_df = 1;
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local); rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local);
rcu_read_unlock(); rcu_read_unlock();
......
...@@ -172,7 +172,7 @@ static int gre_tnl_send(struct vport *vport, struct sk_buff *skb) ...@@ -172,7 +172,7 @@ static int gre_tnl_send(struct vport *vport, struct sk_buff *skb)
df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ?
htons(IP_DF) : 0; htons(IP_DF) : 0;
skb->local_df = 1; skb->ignore_df = 1;
return iptunnel_xmit(skb->sk, rt, skb, fl.saddr, return iptunnel_xmit(skb->sk, rt, skb, fl.saddr,
OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE, OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE,
......
...@@ -170,7 +170,7 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) ...@@ -170,7 +170,7 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb)
df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ?
htons(IP_DF) : 0; htons(IP_DF) : 0;
skb->local_df = 1; skb->ignore_df = 1;
inet_get_local_port_range(net, &port_min, &port_max); inet_get_local_port_range(net, &port_min, &port_max);
src_port = vxlan_src_port(port_min, port_max, skb); src_port = vxlan_src_port(port_min, port_max, skb);
......
...@@ -216,7 +216,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport) ...@@ -216,7 +216,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
IP6_ECN_flow_xmit(sk, fl6->flowlabel); IP6_ECN_flow_xmit(sk, fl6->flowlabel);
if (!(transport->param_flags & SPP_PMTUD_ENABLE)) if (!(transport->param_flags & SPP_PMTUD_ENABLE))
skb->local_df = 1; skb->ignore_df = 1;
SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS); SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS);
......
...@@ -591,7 +591,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) ...@@ -591,7 +591,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
pr_debug("***sctp_transmit_packet*** skb->len:%d\n", nskb->len); pr_debug("***sctp_transmit_packet*** skb->len:%d\n", nskb->len);
nskb->local_df = packet->ipfragok; nskb->ignore_df = packet->ipfragok;
tp->af_specific->sctp_xmit(nskb, tp); tp->af_specific->sctp_xmit(nskb, tp);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment