diff mbox series

[ovs-dev] pinctrl: Explicitly set ICMPv6 code for packet too big

Message ID 20240829150024.387571-1-amusil@redhat.com
State Changes Requested
Headers show
Series [ovs-dev] pinctrl: Explicitly set ICMPv6 code for packet too big | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ales Musil Aug. 29, 2024, 3 p.m. UTC
The ICMPv6 code was set to 1 which is wrong for the packet too big
which is wrong, the code should always remain 0. This resulted in
wrong csum being computed. Set the code to 0 explicitly.

Reported-at: https://issues.redhat.com/browse/FDP-763
Signed-off-by: Ales Musil <amusil@redhat.com>
---
 controller/pinctrl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dumitru Ceara Aug. 29, 2024, 3:09 p.m. UTC | #1
Hi Ales,

Nit: missing . at the end of the subject.

On 8/29/24 17:00, Ales Musil wrote:
> The ICMPv6 code was set to 1 which is wrong for the packet too big
> which is wrong, the code should always remain 0. This resulted in
> wrong csum being computed. Set the code to 0 explicitly.
> 
> Reported-at: https://issues.redhat.com/browse/FDP-763

Fixes: 4725ad125b42 ("controller: Avoid double controller action for ICMP errors.")

> Signed-off-by: Ales Musil <amusil@redhat.com>
> ---
>  controller/pinctrl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 7cbb0cf81..c86b4f940 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -1756,6 +1756,7 @@ pinctrl_handle_icmp(struct rconn *swconn, const struct flow *ip_flow,
>          if (mtu) {
>              put_16aligned_be32(ih->icmp6_data.be32, *mtu);
>              ih->icmp6_base.icmp6_type = ICMP6_PACKET_TOO_BIG;
> +            ih->icmp6_base.icmp6_code = 0;
>          }
>  
>          void *data = ih + 1;

Otherwise, looks good to me, thanks for fixing this!

For v2:
Acked-by: Dumitru Ceara <dceara@redhat.com>

Regards,
Dumitru
Ales Musil Aug. 29, 2024, 3:12 p.m. UTC | #2
On Thu, Aug 29, 2024 at 5:09 PM Dumitru Ceara <dceara@redhat.com> wrote:

> Hi Ales,
>
> Nit: missing . at the end of the subject.
>
> On 8/29/24 17:00, Ales Musil wrote:
> > The ICMPv6 code was set to 1 which is wrong for the packet too big
> > which is wrong, the code should always remain 0. This resulted in
> > wrong csum being computed. Set the code to 0 explicitly.
> >
> > Reported-at: https://issues.redhat.com/browse/FDP-763
>
> Fixes: 4725ad125b42 ("controller: Avoid double controller action for ICMP
> errors.")
>
> > Signed-off-by: Ales Musil <amusil@redhat.com>
> > ---
> >  controller/pinctrl.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> > index 7cbb0cf81..c86b4f940 100644
> > --- a/controller/pinctrl.c
> > +++ b/controller/pinctrl.c
> > @@ -1756,6 +1756,7 @@ pinctrl_handle_icmp(struct rconn *swconn, const
> struct flow *ip_flow,
> >          if (mtu) {
> >              put_16aligned_be32(ih->icmp6_data.be32, *mtu);
> >              ih->icmp6_base.icmp6_type = ICMP6_PACKET_TOO_BIG;
> > +            ih->icmp6_base.icmp6_code = 0;
> >          }
> >
> >          void *data = ih + 1;
>
> Otherwise, looks good to me, thanks for fixing this!
>
> For v2:
> Acked-by: Dumitru Ceara <dceara@redhat.com>
>
> Regards,
> Dumitru
>
>
Both fixed in v2.

Thanks,
Ales
diff mbox series

Patch

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 7cbb0cf81..c86b4f940 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -1756,6 +1756,7 @@  pinctrl_handle_icmp(struct rconn *swconn, const struct flow *ip_flow,
         if (mtu) {
             put_16aligned_be32(ih->icmp6_data.be32, *mtu);
             ih->icmp6_base.icmp6_type = ICMP6_PACKET_TOO_BIG;
+            ih->icmp6_base.icmp6_code = 0;
         }
 
         void *data = ih + 1;