Blob Blame History Raw
From f3f604a41e44a17b1953ebd3d2162c1fc046f49f Mon Sep 17 00:00:00 2001
Message-Id: <f3f604a41e44a17b1953ebd3d2162c1fc046f49f.1588582791.git.lorenzo.bianconi@redhat.com>
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Date: Sat, 25 Apr 2020 12:18:12 +0200
Subject: [PATCH] IPv6 PD: assume status to be Success if not present

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>
Signed-off-by: Numan Siddique <numans@ovn.org>
---
 controller/pinctrl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -835,12 +835,15 @@ pinctrl_parse_dhcpv6_reply(struct dp_pac
                     plife_time = ntohl(ia_hdr->plife_time);
                     vlife_time = ntohl(ia_hdr->vlife_time);
                     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);