Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

WANG Cong and committed by
David S. Miller
60ff7467 5f013c9b

+42 -42
+2 -2
include/linux/skbuff.h
··· 426 426 * @csum_start: Offset from skb->head where checksumming should start 427 427 * @csum_offset: Offset from csum_start where checksum should be stored 428 428 * @priority: Packet queueing priority 429 - * @local_df: allow local fragmentation 429 + * @ignore_df: allow local fragmentation 430 430 * @cloned: Head may be cloned (check refcnt to be sure) 431 431 * @ip_summed: Driver fed us an IP checksum 432 432 * @nohdr: Payload reference only, must not modify header ··· 514 514 }; 515 515 __u32 priority; 516 516 kmemcheck_bitfield_begin(flags1); 517 - __u8 local_df:1, 517 + __u8 ignore_df:1, 518 518 cloned:1, 519 519 ip_summed:2, 520 520 nohdr:1,
+3 -3
include/net/ip.h
··· 269 269 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; 270 270 } 271 271 272 - static inline bool ip_sk_local_df(const struct sock *sk) 272 + static inline bool ip_sk_ignore_df(const struct sock *sk) 273 273 { 274 274 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_DO || 275 275 inet_sk(sk)->pmtudisc == IP_PMTUDISC_OMIT; ··· 304 304 { 305 305 struct iphdr *iph = ip_hdr(skb); 306 306 307 - if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { 307 + if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) { 308 308 /* This is only to work around buggy Windows95/2000 309 309 * VJ compression implementations. If the ID field 310 310 * does not change, they drop every other packet in ··· 320 320 { 321 321 struct iphdr *iph = ip_hdr(skb); 322 322 323 - if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) { 323 + if ((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) { 324 324 if (sk && inet_sk(sk)->inet_daddr) { 325 325 iph->id = htons(inet_sk(sk)->inet_id); 326 326 inet_sk(sk)->inet_id += 1 + more;
+1 -1
include/net/ip6_route.h
··· 185 185 inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_OMIT; 186 186 } 187 187 188 - static inline bool ip6_sk_local_df(const struct sock *sk) 188 + static inline bool ip6_sk_ignore_df(const struct sock *sk) 189 189 { 190 190 return inet6_sk(sk)->pmtudisc < IPV6_PMTUDISC_DO || 191 191 inet6_sk(sk)->pmtudisc == IPV6_PMTUDISC_OMIT;
+2 -2
net/core/skbuff.c
··· 694 694 #endif 695 695 memcpy(new->cb, old->cb, sizeof(old->cb)); 696 696 new->csum = old->csum; 697 - new->local_df = old->local_df; 697 + new->ignore_df = old->ignore_df; 698 698 new->pkt_type = old->pkt_type; 699 699 new->ip_summed = old->ip_summed; 700 700 skb_copy_queue_mapping(new, old); ··· 3913 3913 skb->tstamp.tv64 = 0; 3914 3914 skb->pkt_type = PACKET_HOST; 3915 3915 skb->skb_iif = 0; 3916 - skb->local_df = 0; 3916 + skb->ignore_df = 0; 3917 3917 skb_dst_drop(skb); 3918 3918 skb->mark = 0; 3919 3919 secpath_reset(skb);
+1 -1
net/ipv4/ip_forward.c
··· 42 42 static bool ip_may_fragment(const struct sk_buff *skb) 43 43 { 44 44 return unlikely((ip_hdr(skb)->frag_off & htons(IP_DF)) == 0) || 45 - skb->local_df; 45 + skb->ignore_df; 46 46 } 47 47 48 48 static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu)
+6 -6
net/ipv4/ip_output.c
··· 415 415 skb_reset_network_header(skb); 416 416 iph = ip_hdr(skb); 417 417 *((__be16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff)); 418 - if (ip_dont_fragment(sk, &rt->dst) && !skb->local_df) 418 + if (ip_dont_fragment(sk, &rt->dst) && !skb->ignore_df) 419 419 iph->frag_off = htons(IP_DF); 420 420 else 421 421 iph->frag_off = 0; ··· 501 501 iph = ip_hdr(skb); 502 502 503 503 mtu = ip_skb_dst_mtu(skb); 504 - if (unlikely(((iph->frag_off & htons(IP_DF)) && !skb->local_df) || 504 + if (unlikely(((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) || 505 505 (IPCB(skb)->frag_max_size && 506 506 IPCB(skb)->frag_max_size > mtu))) { 507 507 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS); ··· 866 866 867 867 fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); 868 868 maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; 869 - maxnonfragsize = ip_sk_local_df(sk) ? 0xFFFF : mtu; 869 + maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu; 870 870 871 871 if (cork->length + length > maxnonfragsize - fragheaderlen) { 872 872 ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, ··· 1189 1189 1190 1190 fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); 1191 1191 maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; 1192 - maxnonfragsize = ip_sk_local_df(sk) ? 0xFFFF : mtu; 1192 + maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu; 1193 1193 1194 1194 if (cork->length + size > maxnonfragsize - fragheaderlen) { 1195 1195 ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, ··· 1350 1350 * to fragment the frame generated here. No matter, what transforms 1351 1351 * how transforms change size of the packet, it will come out. 1352 1352 */ 1353 - skb->local_df = ip_sk_local_df(sk); 1353 + skb->ignore_df = ip_sk_ignore_df(sk); 1354 1354 1355 1355 /* DF bit is set when we want to see DF on outgoing frames. 1356 - * If local_df is set too, we still allow to fragment this frame 1356 + * If ignore_df is set too, we still allow to fragment this frame 1357 1357 * locally. */ 1358 1358 if (inet->pmtudisc == IP_PMTUDISC_DO || 1359 1359 inet->pmtudisc == IP_PMTUDISC_PROBE ||
+1 -1
net/ipv4/netfilter/nf_defrag_ipv4.c
··· 34 34 35 35 if (!err) { 36 36 ip_send_check(ip_hdr(skb)); 37 - skb->local_df = 1; 37 + skb->ignore_df = 1; 38 38 } 39 39 40 40 return err;
+1 -1
net/ipv4/xfrm4_output.c
··· 25 25 if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE) 26 26 goto out; 27 27 28 - if (!(ip_hdr(skb)->frag_off & htons(IP_DF)) || skb->local_df) 28 + if (!(ip_hdr(skb)->frag_off & htons(IP_DF)) || skb->ignore_df) 29 29 goto out; 30 30 31 31 mtu = dst_mtu(skb_dst(skb));
+6 -6
net/ipv6/ip6_output.c
··· 219 219 skb->mark = sk->sk_mark; 220 220 221 221 mtu = dst_mtu(dst); 222 - if ((skb->len <= mtu) || skb->local_df || skb_is_gso(skb)) { 222 + if ((skb->len <= mtu) || skb->ignore_df || skb_is_gso(skb)) { 223 223 IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)), 224 224 IPSTATS_MIB_OUT, skb->len); 225 225 return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL, ··· 347 347 if (skb->len <= mtu) 348 348 return false; 349 349 350 - /* ipv6 conntrack defrag sets max_frag_size + local_df */ 350 + /* ipv6 conntrack defrag sets max_frag_size + ignore_df */ 351 351 if (IP6CB(skb)->frag_max_size && IP6CB(skb)->frag_max_size > mtu) 352 352 return true; 353 353 354 - if (skb->local_df) 354 + if (skb->ignore_df) 355 355 return false; 356 356 357 357 if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu) ··· 559 559 /* We must not fragment if the socket is set to force MTU discovery 560 560 * or if the skb it not generated by a local socket. 561 561 */ 562 - if (unlikely(!skb->local_df && skb->len > mtu) || 562 + if (unlikely(!skb->ignore_df && skb->len > mtu) || 563 563 (IP6CB(skb)->frag_max_size && 564 564 IP6CB(skb)->frag_max_size > mtu)) { 565 565 if (skb->sk && dst_allfrag(skb_dst(skb))) ··· 1234 1234 sizeof(struct frag_hdr) : 0) + 1235 1235 rt->rt6i_nfheader_len; 1236 1236 1237 - if (ip6_sk_local_df(sk)) 1237 + if (ip6_sk_ignore_df(sk)) 1238 1238 maxnonfragsize = sizeof(struct ipv6hdr) + IPV6_MAXPLEN; 1239 1239 else 1240 1240 maxnonfragsize = mtu; ··· 1544 1544 } 1545 1545 1546 1546 /* Allow local fragmentation. */ 1547 - skb->local_df = ip6_sk_local_df(sk); 1547 + skb->ignore_df = ip6_sk_ignore_df(sk); 1548 1548 1549 1549 *final_dst = fl6->daddr; 1550 1550 __skb_pull(skb, skb_network_header_len(skb));
+1 -1
net/ipv6/netfilter/nf_conntrack_reasm.c
··· 451 451 } 452 452 sub_frag_mem_limit(&fq->q, head->truesize); 453 453 454 - head->local_df = 1; 454 + head->ignore_df = 1; 455 455 head->next = NULL; 456 456 head->dev = dev; 457 457 head->tstamp = fq->q.stamp;
+3 -3
net/ipv6/xfrm6_output.c
··· 78 78 if (mtu < IPV6_MIN_MTU) 79 79 mtu = IPV6_MIN_MTU; 80 80 81 - if (!skb->local_df && skb->len > mtu) { 81 + if (!skb->ignore_df && skb->len > mtu) { 82 82 skb->dev = dst->dev; 83 83 84 84 if (xfrm6_local_dontfrag(skb)) ··· 120 120 #endif 121 121 122 122 skb->protocol = htons(ETH_P_IPV6); 123 - skb->local_df = 1; 123 + skb->ignore_df = 1; 124 124 125 125 return x->outer_mode->output2(x, skb); 126 126 } ··· 150 150 if (skb->len > mtu && xfrm6_local_dontfrag(skb)) { 151 151 xfrm6_local_rxpmtu(skb, mtu); 152 152 return -EMSGSIZE; 153 - } else if (!skb->local_df && skb->len > mtu && skb->sk) { 153 + } else if (!skb->ignore_df && skb->len > mtu && skb->sk) { 154 154 xfrm_local_error(skb, mtu); 155 155 return -EMSGSIZE; 156 156 }
+1 -1
net/l2tp/l2tp_core.c
··· 1073 1073 } 1074 1074 1075 1075 /* Queue the packet to IP for output */ 1076 - skb->local_df = 1; 1076 + skb->ignore_df = 1; 1077 1077 #if IS_ENABLED(CONFIG_IPV6) 1078 1078 if (tunnel->sock->sk_family == PF_INET6 && !tunnel->v4mapped) 1079 1079 error = inet6_csk_xmit(tunnel->sock, skb, NULL);
+10 -10
net/netfilter/ipvs/ip_vs_xmit.c
··· 562 562 ip_send_check(iph); 563 563 564 564 /* Another hack: avoid icmp_send in ip_fragment */ 565 - skb->local_df = 1; 565 + skb->ignore_df = 1; 566 566 567 567 ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0); 568 568 rcu_read_unlock(); ··· 590 590 goto tx_error; 591 591 592 592 /* Another hack: avoid icmp_send in ip_fragment */ 593 - skb->local_df = 1; 593 + skb->ignore_df = 1; 594 594 595 595 ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0); 596 596 rcu_read_unlock(); ··· 684 684 MTU problem. */ 685 685 686 686 /* Another hack: avoid icmp_send in ip_fragment */ 687 - skb->local_df = 1; 687 + skb->ignore_df = 1; 688 688 689 689 rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local); 690 690 rcu_read_unlock(); ··· 774 774 MTU problem. */ 775 775 776 776 /* Another hack: avoid icmp_send in ip_fragment */ 777 - skb->local_df = 1; 777 + skb->ignore_df = 1; 778 778 779 779 rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local); 780 780 rcu_read_unlock(); ··· 886 886 ip_select_ident(skb, &rt->dst, NULL); 887 887 888 888 /* Another hack: avoid icmp_send in ip_fragment */ 889 - skb->local_df = 1; 889 + skb->ignore_df = 1; 890 890 891 891 ret = ip_vs_tunnel_xmit_prepare(skb, cp); 892 892 if (ret == NF_ACCEPT) ··· 974 974 iph->hop_limit = old_iph->hop_limit; 975 975 976 976 /* Another hack: avoid icmp_send in ip_fragment */ 977 - skb->local_df = 1; 977 + skb->ignore_df = 1; 978 978 979 979 ret = ip_vs_tunnel_xmit_prepare(skb, cp); 980 980 if (ret == NF_ACCEPT) ··· 1023 1023 ip_send_check(ip_hdr(skb)); 1024 1024 1025 1025 /* Another hack: avoid icmp_send in ip_fragment */ 1026 - skb->local_df = 1; 1026 + skb->ignore_df = 1; 1027 1027 1028 1028 ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0); 1029 1029 rcu_read_unlock(); ··· 1060 1060 } 1061 1061 1062 1062 /* Another hack: avoid icmp_send in ip_fragment */ 1063 - skb->local_df = 1; 1063 + skb->ignore_df = 1; 1064 1064 1065 1065 ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0); 1066 1066 rcu_read_unlock(); ··· 1157 1157 ip_vs_nat_icmp(skb, pp, cp, 0); 1158 1158 1159 1159 /* Another hack: avoid icmp_send in ip_fragment */ 1160 - skb->local_df = 1; 1160 + skb->ignore_df = 1; 1161 1161 1162 1162 rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local); 1163 1163 rcu_read_unlock(); ··· 1249 1249 ip_vs_nat_icmp_v6(skb, pp, cp, 0); 1250 1250 1251 1251 /* Another hack: avoid icmp_send in ip_fragment */ 1252 - skb->local_df = 1; 1252 + skb->ignore_df = 1; 1253 1253 1254 1254 rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local); 1255 1255 rcu_read_unlock();
+1 -1
net/openvswitch/vport-gre.c
··· 172 172 df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? 173 173 htons(IP_DF) : 0; 174 174 175 - skb->local_df = 1; 175 + skb->ignore_df = 1; 176 176 177 177 return iptunnel_xmit(skb->sk, rt, skb, fl.saddr, 178 178 OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE,
+1 -1
net/openvswitch/vport-vxlan.c
··· 170 170 df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? 171 171 htons(IP_DF) : 0; 172 172 173 - skb->local_df = 1; 173 + skb->ignore_df = 1; 174 174 175 175 inet_get_local_port_range(net, &port_min, &port_max); 176 176 src_port = vxlan_src_port(port_min, port_max, skb);
+1 -1
net/sctp/ipv6.c
··· 216 216 IP6_ECN_flow_xmit(sk, fl6->flowlabel); 217 217 218 218 if (!(transport->param_flags & SPP_PMTUD_ENABLE)) 219 - skb->local_df = 1; 219 + skb->ignore_df = 1; 220 220 221 221 SCTP_INC_STATS(sock_net(sk), SCTP_MIB_OUTSCTPPACKS); 222 222
+1 -1
net/sctp/output.c
··· 591 591 592 592 pr_debug("***sctp_transmit_packet*** skb->len:%d\n", nskb->len); 593 593 594 - nskb->local_df = packet->ipfragok; 594 + nskb->ignore_df = packet->ipfragok; 595 595 tp->af_specific->sctp_xmit(nskb, tp); 596 596 597 597 out: