From: wenxin.wang94@gmail.com (Wenxin Wang) To: kernelnewbies@lists.kernelnewbies.org Subject: question: frag_max_size not checked in ip_finish_output Date: Wed, 21 Nov 2018 01:02:29 +0800 [thread overview] Message-ID: <CAA3R8U8vh1gR-sAus7pkTWbYSLj0i+1oFOZKXaCd-MmgSJrb3g@mail.gmail.com> (raw) Dear developers, I'm trying to understand the different behavior between `ip_finish_output` and `ip6_finish_output`, when deciding whether to do fragmentation or not. `ip_finish_output` calls `ip_fragment` when `skb->len` exceeds the destination mtu; In addition to this mtu check, `ip6_finish_output` also checks if `skb->len > IP6CB(skb)->frag_max_size`. The relevant code is here https://elixir.bootlin.com/linux/latest/source/net/ipv4/ip_output.c#L310 https://elixir.bootlin.com/linux/latest/source/net/ipv6/ip6_output.c#L151 As far as I know, `frag_max_size` prevents the forwarding routine from sending packets longer than the maximum fragment received after defragmentation. I'm wondering why `ip_finish_output` doesn't check similarily for `IPCB(skb)->frag_max_size`, especially when `ip_fragment` and `ip_do_fragment`, called (indirectly) by `ip_finish_output`, both cap the output mtu by this frag_max_size. Many thanks in advance! If I'm sending to the wrong person, or wrong mailing list, please let me know. It's my first time trying to ask questions to Linux developers, and sorry for the disturbance. Currently I'm not subscribed to any mailing list, but I will if necessary. Thank you for making Linux great ;) Sincerely, Wenxin Wang
WARNING: multiple messages have this Message-ID (diff)
From: Wenxin Wang <wenxin.wang94@gmail.com> To: kernelnewbies@kernelnewbies.org Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>, "David S. Miller" <davem@davemloft.net> Subject: question: frag_max_size not checked in ip_finish_output Date: Wed, 21 Nov 2018 01:02:29 +0800 [thread overview] Message-ID: <CAA3R8U8vh1gR-sAus7pkTWbYSLj0i+1oFOZKXaCd-MmgSJrb3g@mail.gmail.com> (raw) Message-ID: <20181120170229.OH_SPWmzHO2BHiYjGMBAV_EmImYKGuWSf_G1lRNlJGw@z> (raw) Dear developers, I'm trying to understand the different behavior between `ip_finish_output` and `ip6_finish_output`, when deciding whether to do fragmentation or not. `ip_finish_output` calls `ip_fragment` when `skb->len` exceeds the destination mtu; In addition to this mtu check, `ip6_finish_output` also checks if `skb->len > IP6CB(skb)->frag_max_size`. The relevant code is here https://elixir.bootlin.com/linux/latest/source/net/ipv4/ip_output.c#L310 https://elixir.bootlin.com/linux/latest/source/net/ipv6/ip6_output.c#L151 As far as I know, `frag_max_size` prevents the forwarding routine from sending packets longer than the maximum fragment received after defragmentation. I'm wondering why `ip_finish_output` doesn't check similarily for `IPCB(skb)->frag_max_size`, especially when `ip_fragment` and `ip_do_fragment`, called (indirectly) by `ip_finish_output`, both cap the output mtu by this frag_max_size. Many thanks in advance! If I'm sending to the wrong person, or wrong mailing list, please let me know. It's my first time trying to ask questions to Linux developers, and sorry for the disturbance. Currently I'm not subscribed to any mailing list, but I will if necessary. Thank you for making Linux great ;) Sincerely, Wenxin Wang _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next reply other threads:[~2018-11-20 17:02 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-11-20 17:02 Wenxin Wang [this message] 2018-11-20 17:02 ` question: frag_max_size not checked in ip_finish_output Wenxin Wang 2018-11-21 2:01 Wenxin Wang 2018-11-21 2:01 ` Wenxin Wang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CAA3R8U8vh1gR-sAus7pkTWbYSLj0i+1oFOZKXaCd-MmgSJrb3g@mail.gmail.com \ --to=wenxin.wang94@gmail.com \ --cc=kernelnewbies@lists.kernelnewbies.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).