netcfg: restore upstream behavior and configuration features from last release.

This commit is contained in:
Luis Guzmán 2023-02-23 19:07:16 +00:00
parent 0077ab560d
commit d7e291dfb7
11 changed files with 8235 additions and 68 deletions

View file

@ -0,0 +1,33 @@
From ad4fc74f5ad7b5195f3cf23c7943c4736702ae72 Mon Sep 17 00:00:00 2001
From: Dimitri John Ledkov <xnox@ubuntu.com>
Date: Wed, 25 Apr 2018 13:25:45 +0100
Subject: 1.142ubuntu7 (patches unapplied)
Imported using git-ubuntu import.
---
debian/changelog | 7 +++++++
write_interface.c | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/write_interface.c b/write_interface.c
index 5ca1cc0..67d2977 100644
--- a/write_interface.c
+++ b/write_interface.c
@@ -170,11 +170,12 @@ static int nc_wi_netplan_write_nameservers(const struct netcfg_interface *interf
{
int i;
- if (empty_str(domain))
+ if (empty_str(domain) && empty_str(interface->nameservers[0]))
return 1;
fprintf(fd, " nameservers:\n");
- fprintf(fd, " search: [ %s ]\n", domain);
+ if (!empty_str(domain))
+ fprintf(fd, " search: [ %s ]\n", domain);
fprintf(fd, " addresses:\n");
for (i = 0; i < NETCFG_NAMESERVERS_MAX; i++) {
if (!empty_str(interface->nameservers[i])) {
--
cgit v1.1