net: rename local_df to ignore_df
Subsystems (8)
PATCH 1/1 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".
---
include/linux/skbuff.h +2 -2
@@ -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_offset: Offset from csum_start where checksum should be stored * @priority: Packet queueing priority -* @local_df: allow local fragmentation +* @ignore_df: allow local fragmentation * @cloned: Head may be cloned (check refcnt to be sure) * @ip_summed: Driver fed us an IP checksum * @nohdr: Payload reference only, must not modify header
@@ -514,7 +514,7 @@ struct sk_buff { };__u32 priority;kmemcheck_bitfield_begin (flags1); - __u8 local_df:1, + __u8 ignore_df:1, cloned:1, ip_summed:2, nohdr:1,
include/net/ip.h +3 -3
@@ -281,7 +281,7 @@ static inline bool ip_sk_use_pmtu(const struct sock *sk)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 ||inet_sk (sk)->pmtudisc ==IP_PMTUDISC_OMIT ;
@@ -316,7 +316,7 @@ static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, s {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 * VJ compression implementations. If the ID field * does not change, they drop every other packet in
@@ -332,7 +332,7 @@ static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *d {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) { iph->id =htons (inet_sk (sk)->inet_id);inet_sk (sk)->inet_id +=1 + more;
include/net/ip6_route.h +1 -1
@@ -185,7 +185,7 @@ static inline bool ip6_sk_accept_pmtu(const struct sock *sk)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 ||inet6_sk (sk)->pmtudisc ==IPV6_PMTUDISC_OMIT ;
net/core/skbuff.c +2 -2
@@ -694,7 +694,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)#endif memcpy (new->cb, old->cb,sizeof (old->cb)); new->csum = old->csum; - new->local_df = old->local_df; + new->ignore_df = old->ignore_df; new->pkt_type = old->pkt_type; new->ip_summed = old->ip_summed;skb_copy_queue_mapping (new, old);
@@ -3913,7 +3913,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) skb->tstamp.tv64 =0 ; skb->pkt_type =PACKET_HOST ; skb->skb_iif =0 ; - skb->local_df =0 ; + skb->ignore_df =0 ;skb_dst_drop (skb); skb->mark =0 ;secpath_reset (skb);
net/ipv4/ip_forward.c +3 -3
@@ -42,12 +42,12 @@static bool ip_may_fragment (const struct sk_buff *skb) {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) { -if (skb->len <= mtu || skb->local_df) +if (skb->len <= mtu || skb->ignore_df)return false;if (skb_is_gso (skb) &&skb_gso_network_seglen (skb) <= mtu)
@@ -60,7 +60,7 @@ static bool ip_gso_exceeds_dst_mtu(const struct sk_buff *skb) {unsigned int mtu; -if (skb->local_df || !skb_is_gso (skb)) +if (skb->ignore_df || !skb_is_gso (skb))return false; mtu =ip_dst_mtu_maybe_forward (skb_dst (skb), true);
net/ipv4/ip_output.c +6 -6
@@ -370,7 +370,7 @@ packet_routed:skb_reset_network_header (skb); iph =ip_hdr (skb); *((__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 );else iph->frag_off =0 ;
@@ -456,7 +456,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) iph =ip_hdr (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 > mtu))) {IP_INC_STATS (dev_net (dev),IPSTATS_MIB_FRAGFAILS );
@@ -821,7 +821,7 @@ static int __ip_append_data(struct sock *sk, fragheaderlen =sizeof (struct iphdr ) + (opt ? opt->optlen :0 ); 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) { ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
@@ -1144,7 +1144,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, fragheaderlen =sizeof (struct iphdr ) + (opt ? opt->optlen :0 ); 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) { ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
@@ -1305,10 +1305,10 @@ struct sk_buff *__ip_make_skb(struct sock *sk,* to fragment the frame generated here. No matter, what transforms * 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. -* 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. */ if (inet->pmtudisc == IP_PMTUDISC_DO || inet->pmtudisc == IP_PMTUDISC_PROBE ||
net/ipv4/xfrm4_output.c +1 -1
@@ -25,7 +25,7 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)if (IPCB (skb)->flags &IPSKB_XFRM_TUNNEL_SIZE ) 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; mtu =dst_mtu (skb_dst (skb));
net/ipv6/ip6_output.c +5 -5
@@ -219,7 +219,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, skb->mark = sk->sk_mark; 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)),IPSTATS_MIB_OUT , skb->len); return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL,
@@ -344,7 +344,7 @@ static unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)static bool ip6_pkt_too_big (const struct sk_buff *skb,unsigned int mtu) { -if (skb->len <= mtu || skb->local_df) +if (skb->len <= mtu || skb->ignore_df)return false;if (IP6CB (skb)->frag_max_size &&IP6CB (skb)->frag_max_size > mtu)
@@ -555,7 +555,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 * 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 > mtu)) {if (skb->sk &&dst_allfrag (skb_dst (skb)))
@@ -1230,7 +1230,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, sizeof(struct frag_hdr) : 0) + rt->rt6i_nfheader_len; -if (ip6_sk_local_df (sk)) +if (ip6_sk_ignore_df (sk)) maxnonfragsize =sizeof (struct ipv6hdr ) +IPV6_MAXPLEN ;else maxnonfragsize = mtu;
@@ -1540,7 +1540,7 @@ int ip6_push_pending_frames(struct sock *sk) }/* Allow local fragmentation. */ - skb->local_df =ip6_sk_local_df (sk); + skb->ignore_df =ip6_sk_ignore_df (sk); *final_dst = fl6->daddr;__skb_pull (skb,skb_network_header_len (skb));
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -1
@@ -451,7 +451,7 @@ nf_ct_frag6_reasm(struct frag_queue *fq, struct net_device *dev) }sub_frag_mem_limit (&fq->q, head->truesize); - head->local_df =1 ; + head->ignore_df =1 ; head->next =NULL ; head->dev = dev; head->tstamp = fq->q.stamp;
net/ipv6/xfrm6_output.c +3 -3
@@ -78,7 +78,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)if (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;if (xfrm6_local_dontfrag (skb))
@@ -120,7 +120,7 @@ int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb)#endif skb->protocol =htons (ETH_P_IPV6 ); - skb->local_df =1 ; + skb->ignore_df =1 ;return x->outer_mode->output2 (x, skb); }
@@ -150,7 +150,7 @@ static int __xfrm6_output(struct sk_buff *skb)if (skb->len > mtu &&xfrm6_local_dontfrag (skb)) {xfrm6_local_rxpmtu (skb, mtu);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);return -EMSGSIZE ; }
net/l2tp/l2tp_core.c +1 -1
@@ -1128,7 +1128,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, }/* Queue the packet to IP for output */ - skb->local_df =1 ; + skb->ignore_df =1 ;#if IS_ENABLED (CONFIG_IPV6 )if (tunnel->sock->sk_family ==PF_INET6 && !tunnel->v4mapped) error =inet6_csk_xmit (tunnel->sock, skb,NULL );
net/netfilter/ipvs/ip_vs_xmit.c +10 -10
@@ -562,7 +562,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,ip_send_check (iph);/* 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 );rcu_read_unlock ();
@@ -590,7 +590,7 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, goto tx_error;/* 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 );rcu_read_unlock ();
@@ -684,7 +684,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,MTU problem. */ /* 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);rcu_read_unlock ();
@@ -774,7 +774,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,MTU problem. */ /* 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);rcu_read_unlock ();
@@ -886,7 +886,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,ip_select_ident (skb, &rt->dst,NULL );/* Another hack: avoid icmp_send in ip_fragment */ - skb->local_df =1 ; + skb->ignore_df =1 ; ret =ip_vs_tunnel_xmit_prepare (skb, cp);if (ret ==NF_ACCEPT )
@@ -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;/* Another hack: avoid icmp_send in ip_fragment */ - skb->local_df =1 ; + skb->ignore_df =1 ; ret =ip_vs_tunnel_xmit_prepare (skb, cp);if (ret ==NF_ACCEPT )
@@ -1023,7 +1023,7 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,ip_send_check (ip_hdr (skb));/* 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 );rcu_read_unlock ();
@@ -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 */ - skb->local_df =1 ; + skb->ignore_df =1 ;ip_vs_send_or_cont (NFPROTO_IPV6 , skb, cp,0 );rcu_read_unlock ();
@@ -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 );/* 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);rcu_read_unlock ();
@@ -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 );/* 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);rcu_read_unlock ();
net/openvswitch/vport-gre.c +1 -1
@@ -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 ?htons (IP_DF ) :0 ; - skb->local_df =1 ; + skb->ignore_df =1 ; return iptunnel_xmit(skb->sk, rt, skb, fl.saddr, OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE,
net/openvswitch/vport-vxlan.c +1 -1
@@ -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 ?htons (IP_DF ) :0 ; - skb->local_df =1 ; + skb->ignore_df =1 ;inet_get_local_port_range (net, &port_min, &port_max); src_port =vxlan_src_port (port_min, port_max, skb);
net/sctp/ipv6.c +1 -1
@@ -216,7 +216,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)IP6_ECN_flow_xmit (sk, fl6->flowlabel);if (!(transport->param_flags &SPP_PMTUD_ENABLE )) - skb->local_df =1 ; + skb->ignore_df =1 ;SCTP_INC_STATS (sock_net (sk),SCTP_MIB_OUTSCTPPACKS );
net/sctp/output.c +1 -1
@@ -591,7 +591,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)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); out:
Florian Westphal
maintainerQuoted 2 lines · Cong Wang
As suggested by several people, rename
local_dftoignore_df, since it means "ignore df bit if it is set".
Thanks for doing this.
David, this has small conflict with a patch I sent couple of hours ago.
Also, I do have another bug fix patch that will move a function evaluating skb->local_df around [ ie. targeted at net tree ]
That patch needs more testing but I will send it within next 30 hours.
net/ipv4/ip_forward.c line 45
Quoted 10 lines
net/ipv4/ip_forward.c +1
-1@@ -42,12 +42,12 @@static bool ip_may_fragment (const struct sk_buff *skb) {return unlikely ((ip_hdr (skb)->frag_off &htons (IP_DF )) ==0 ) || - !skb->local_df; + !skb->ignore_df;
nicely illustrates why the rename is a good idea, IMO.
[ should read '|| skb->ignore_df', the negation is wrong ]
Although this'll likely collide with the netfilter patch which adds another use of local_df.
David Miller
maintainerFrom: Cong Wang <[email protected]>
Date: Sun, 4 May 2014 16:39:18 -0700
Quoted 8 lines
As suggested by several people, rename
local_dftoignore_df, since it means "ignore df bit if it is set".Cc Maciej Żenczykowski <[email protected]>Cc Florian Westphal <[email protected]>Cc David S. Miller <[email protected]>Cc Eric Dumazet <[email protected]>Signed-off-by Cong Wang <[email protected]>
I'll apply this the next time I merge net into net-next in order to deal with the conflict with Florian's bug fixes more easily.
Thanks.
I've been wondering whether 'allow_frag' or 'allow_local_frag' or 'ignore_df_set' wouldn't be better names.
At some point we'll need to add a flag which does the opposite as well (for locally generated tcp packets in non path mtu discovery mode), 'disallow_frag' or 'disallow_local_frag', 'force_df' or something like that. Picking two names which both are obvious and work well in concert would be nice.
Quoted 6 lines · David Miller
From: Cong Wang <[email protected]>
Date: Sun, 4 May 2014 16:39:18 -0700Quoted 3 lines
As suggested by several people, rename
local_dftoignore_df, since it means "ignore df bit if it is set".
Quoted 9 lines
Quoted 5 lines
Cc Maciej Żenczykowski <[email protected]>Cc Florian Westphal <[email protected]>Cc David S. Miller <[email protected]>Cc Eric Dumazet <[email protected]>Signed-off-by Cong Wang <[email protected]>I'll apply this the next time I merge net into net-next in order to deal with the conflict with Florian's bug fixes more easily.
Sounds good to me.
Thanks.