diff mbox series

[ovs-dev,ovn] IPv6 PD: assume status to be Success if not present

Message ID 53a079116e4777c690776576f84232a405a8f0ce.1587809701.git.lorenzo.bianconi@redhat.com
State Accepted
Headers show
Series [ovs-dev,ovn] IPv6 PD: assume status to be Success if not present | expand

Commit Message

Lorenzo Bianconi April 25, 2020, 10:18 a.m. UTC
According to the RFC3315 (section 22.13. Status Code Option),
if status code option is not present in the delegation server
reply, it will be assumed to be Success. In this particular case,
do not stop IPv6 PD state machine

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 controller/pinctrl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Numan Siddique April 27, 2020, 10:32 a.m. UTC | #1
On Sat, Apr 25, 2020 at 3:48 PM Lorenzo Bianconi
<lorenzo.bianconi@redhat.com> wrote:
>
> According to the RFC3315 (section 22.13. Status Code Option),
> if status code option is not present in the delegation server
> reply, it will be assumed to be Success. In this particular case,
> do not stop IPv6 PD state machine
>
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

Thanks Lorenzo. I applied this patch to master.

Numan

> ---
>  controller/pinctrl.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 7ac487f05..3230bb386 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -852,12 +852,15 @@ pinctrl_parse_dhcpv6_reply(struct dp_packet *pkt_in,
>                      }
>                      prefix_len = ia_hdr->plen;
>                      memcpy(&ipv6, &ia_hdr->ipv6, sizeof (struct in6_addr));
> +                    status = true;
>                  }
>                  if (ntohs(in_opt->code) == DHCPV6_OPT_STATUS_CODE) {
>                     struct dhcpv6_opt_status *status_hdr;
>
>                     status_hdr = (struct dhcpv6_opt_status *)in_opt;
> -                   status = ntohs(status_hdr->status_code) == 0;
> +                   if (ntohs(status_hdr->status_code)) {
> +                       status = false;
> +                   }
>                  }
>                  size += sizeof *in_opt + ntohs(in_opt->len);
>                  in_opt = (struct dhcpv6_opt_header *)(in_dhcpv6_data + size);
> --
> 2.25.3
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
diff mbox series

Patch

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 7ac487f05..3230bb386 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -852,12 +852,15 @@  pinctrl_parse_dhcpv6_reply(struct dp_packet *pkt_in,
                     }
                     prefix_len = ia_hdr->plen;
                     memcpy(&ipv6, &ia_hdr->ipv6, sizeof (struct in6_addr));
+                    status = true;
                 }
                 if (ntohs(in_opt->code) == DHCPV6_OPT_STATUS_CODE) {
                    struct dhcpv6_opt_status *status_hdr;
 
                    status_hdr = (struct dhcpv6_opt_status *)in_opt;
-                   status = ntohs(status_hdr->status_code) == 0;
+                   if (ntohs(status_hdr->status_code)) {
+                       status = false;
+                   }
                 }
                 size += sizeof *in_opt + ntohs(in_opt->len);
                 in_opt = (struct dhcpv6_opt_header *)(in_dhcpv6_data + size);