Blob Blame History Raw
From 0ced3a9527a2163bdb8f7da30a71f2f327c2e0fb Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com>
Date: Wed, 4 Mar 2020 18:57:04 +0100
Subject: [PATCH] Adjust changes to version 2.80

Modify previous changes to current version.
---
 src/dhcp-common.c |  6 +++---
 src/dhcp6.c       |  4 ++--
 src/option.c      |  2 +-
 src/rfc3315.c     | 12 ++++++------
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/dhcp-common.c b/src/dhcp-common.c
index 2933343..ffa927d 100644
--- a/src/dhcp-common.c
+++ b/src/dhcp-common.c
@@ -286,7 +286,7 @@ static int is_config_in_context(struct dhcp_context *context, struct dhcp_config
 	      if ((addr_list->flags & ADDRLIST_WILDCARD) && context->prefix == 64)
 		return 1;
 	      
-	      if (is_same_net6(&addr_list->addr.addr6, &context->start6, context->prefix))
+	      if (is_same_net6(&addr_list->addr.addr.addr6, &context->start6, context->prefix))
 		return 1;
 	    }
     }
@@ -438,8 +438,8 @@ void dhcp_update_configs(struct dhcp_config *configs)
 
 		if (config->addr6 && !config->addr6->next && !(config->addr6->flags & (ADDRLIST_WILDCARD|ADDRLIST_PREFIX)))
 		  {
-		    memcpy(&config->addr6->addr.addr6, &crec->addr.addr6, IN6ADDRSZ);
-		    config->flags |= CONFIG_ADDR6 | CONFIG_ADDR6_HOSTS;
+		    memcpy(&config->addr6->addr.addr.addr6, &crec->addr.addr.addr.addr6, IN6ADDRSZ);
+		    config->flags |= CONFIG_ADDR6 | CONFIG_ADDR_HOSTS;
 		  }
 	    
 		continue;
diff --git a/src/dhcp6.c b/src/dhcp6.c
index 4e28e61..1dedd2f 100644
--- a/src/dhcp6.c
+++ b/src/dhcp6.c
@@ -394,8 +394,8 @@ struct dhcp_config *config_find_by_address6(struct dhcp_config *configs, struct
 	struct addrlist *addr_list;
 	
 	for (addr_list = config->addr6; addr_list; addr_list = addr_list->next)
-	  if ((!net || is_same_net6(&addr_list->addr.addr6, net, prefix) || ((addr_list->flags & ADDRLIST_WILDCARD) && prefix == 64)) &&
-	      is_same_net6(&addr_list->addr.addr6, addr, (addr_list->flags & ADDRLIST_PREFIX) ? addr_list->prefixlen : 128))
+	  if ((!net || is_same_net6(&addr_list->addr.addr.addr6, net, prefix) || ((addr_list->flags & ADDRLIST_WILDCARD) && prefix == 64)) &&
+	      is_same_net6(&addr_list->addr.addr.addr6, addr, (addr_list->flags & ADDRLIST_PREFIX) ? addr_list->prefixlen : 128))
 	    return config;
       }
   
diff --git a/src/option.c b/src/option.c
index 2bbb11b..61cfb8c 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3156,7 +3156,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
 		    new_addr = opt_malloc(sizeof(struct addrlist));
 		    new_addr->next = new->addr6;
 		    new_addr->flags = 0;
-		    new_addr->addr.addr6 = in6;
+		    new_addr->addr.addr.addr6 = in6;
 		    new->addr6 = new_addr;
 		    
 		    if (pref)
diff --git a/src/rfc3315.c b/src/rfc3315.c
index 9dc33f9..a7bf929 100644
--- a/src/rfc3315.c
+++ b/src/rfc3315.c
@@ -1801,12 +1801,12 @@ static int config_implies(struct dhcp_config *config, struct dhcp_context *conte
   for (addr_list = config->addr6; addr_list; addr_list = addr_list->next)
     {
       prefix = (addr_list->flags & ADDRLIST_PREFIX) ? addr_list->prefixlen : 128;
-      wild_addr = addr_list->addr.addr6;
+      wild_addr = addr_list->addr.addr.addr6;
       
       if ((addr_list->flags & ADDRLIST_WILDCARD) && context->prefix == 64)
 	{
 	  wild_addr = context->start6;
-	  setaddr6part(&wild_addr, addr6part(&addr_list->addr.addr6));
+	  setaddr6part(&wild_addr, addr6part(&addr_list->addr.addr.addr6));
 	}
       else if (!is_same_net6(&context->start6, addr, context->prefix))
 	continue;
@@ -1828,7 +1828,7 @@ static int config_valid(struct dhcp_config *config, struct dhcp_context *context
 
   for (addr_list = config->addr6; addr_list; addr_list = addr_list->next)
     {
-      addrpart = addr6part(&addr_list->addr.addr6);
+      addrpart = addr6part(&addr_list->addr.addr.addr6);
 
       if ((addr_list->flags & ADDRLIST_WILDCARD))
 	{
@@ -1838,8 +1838,8 @@ static int config_valid(struct dhcp_config *config, struct dhcp_context *context
 	  *addr = context->start6;
 	  setaddr6part(addr, addrpart);
 	}
-      else if (is_same_net6(&context->start6, &addr_list->addr.addr6, context->prefix))
-	*addr = addr_list->addr.addr6;
+      else if (is_same_net6(&context->start6, &addr_list->addr.addr.addr6, context->prefix))
+	*addr = addr_list->addr.addr.addr6;
       else
 	continue;
       
@@ -1853,7 +1853,7 @@ static int config_valid(struct dhcp_config *config, struct dhcp_context *context
 	  
 	  addrpart++;
 	  setaddr6part(addr, addrpart);
-	  if (!is_same_net6(addr, &addr_list->addr.addr6, addr_list->prefixlen))
+	  if (!is_same_net6(addr, &addr_list->addr.addr.addr6, addr_list->prefixlen))
 	    break;
 	}
     }
-- 
2.21.1