From 51931b888a3b7063d8c28634dbbcc3eb2676ef82 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Tue, 29 May 2012 17:06:02 +0100 Subject: [PATCH] Fix access control when DHCPv6 but no RA in use. --- src/dhcp-common.c | 5 +++-- src/option.c | 2 +- src/radv.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dhcp-common.c b/src/dhcp-common.c index 402f644..041b46c 100644 --- a/src/dhcp-common.c +++ b/src/dhcp-common.c @@ -407,10 +407,11 @@ static int join_multicast_worker(struct in6_addr *local, int prefix, return 1; /* weird libvirt-inspired access control */ - for (context = daemon->ra_contexts; context; context = context->next) + for (context = daemon->ra_contexts ? daemon->ra_contexts : daemon->dhcp6; + context; context = context->next) if (!context->interface || strcmp(context->interface, ifrn_name) == 0) break; - + if (!context) return 1; diff --git a/src/option.c b/src/option.c index 3448532..d7634bb 100644 --- a/src/option.c +++ b/src/option.c @@ -2952,7 +2952,7 @@ static char *one_opt(int option, char *arg, char *gen_prob, int command_line) if (!atoi_check(comma, &val) || !(new->name = canonicalise_opt(arg)) || - (data && (len = parse_hex(data, (unsigned char *)data, -1, NULL, NULL)) == -1)) + (data && (len = parse_hex(data, (unsigned char *)data, -1, NULL, NULL)) == -1U)) { problem = _("bad RR record"); break; diff --git a/src/radv.c b/src/radv.c index a9cfccc..6ef0dc0 100644 --- a/src/radv.c +++ b/src/radv.c @@ -158,7 +158,8 @@ void icmp6_packet(void) return; /* weird libvirt-inspired access control */ - for (context = daemon->ra_contexts; context; context = context->next) + for (context = daemon->ra_contexts ? daemon->ra_contexts : daemon->dhcp6; + context; context = context->next) if (!context->interface || strcmp(context->interface, interface) == 0) break;