Skip to content

Commit b2cfaa1

Browse files
committed
network_server: add gateway and dns options to DHCP6
Signed-off-by: Pau Ruiz Safont <[email protected]>
1 parent 70454e7 commit b2cfaa1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ocaml/networkd/bin/network_server.ml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,23 @@ module Interface = struct
412412
Ip.set_ipv6_link_local_addr name
413413
)
414414
| DHCP6 ->
415+
let gateway =
416+
Option.fold ~none:[]
417+
~some:(fun n -> [`gateway n])
418+
!config.gateway_interface
419+
in
420+
let dns =
421+
Option.fold ~none:[]
422+
~some:(fun n -> [`dns n])
423+
!config.dns_interface
424+
in
415425
if Dhclient.is_running ~ipv6:true name then
416426
ignore (Dhclient.stop ~ipv6:true name) ;
417427
Sysctl.set_ipv6_autoconf name false ;
418428
Ip.flush_ip_addr ~ipv6:true name ;
419429
Ip.set_ipv6_link_local_addr name ;
420-
ignore (Dhclient.ensure_running ~ipv6:true name [])
430+
let options = gateway @ dns in
431+
ignore (Dhclient.ensure_running ~ipv6:true name options)
421432
| Autoconf6 ->
422433
if Dhclient.is_running ~ipv6:true name then
423434
ignore (Dhclient.stop ~ipv6:true name) ;

0 commit comments

Comments
 (0)