Skip to content

Commit 3e2bdd5

Browse files
committed
odhcpd: supports rewrite DNS server to local IPv6 DNS server in relay mode
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
1 parent 650a5df commit 3e2bdd5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/dhcpv6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ static void relay_server_response(uint8_t *data, size_t len)
885885
}
886886

887887
/* Rewrite DNS servers if requested */
888-
if (iface->always_rewrite_dns && dns_ptr && dns_count > 0) {
888+
if ((iface->always_rewrite_dns || iface->dns_service) && dns_ptr && dns_count > 0) {
889889
if (is_authenticated)
890890
return; /* Impossible to rewrite */
891891

src/router.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ static void forward_router_advertisement(const struct interface *iface, uint8_t
12401240
}
12411241

12421242
/* If we have to rewrite DNS entries */
1243-
if (c->always_rewrite_dns && dns_ptr && dns_count > 0) {
1243+
if ((c->always_rewrite_dns || c->dns_service) && dns_ptr && dns_count > 0) {
12441244
const struct in6_addr *rewrite = c->dns;
12451245
struct in6_addr addr;
12461246
size_t rewrite_cnt = c->dns_cnt;

0 commit comments

Comments
 (0)