Bug#694965: netcfg: Allow setup of pointopoint routes to reach gateway

2018-06-12 Thread Igor Scheller
Oh, and here is the patch File ;)

On 12.06.2018 13:49, Igor Scheller wrote:
> Hi,
> i created a merge request [1] that allows to preseed pointopoint
> connections so anyone can use a preseed file or boot parameters to
> define a pointopoint connection.
> -> If a pointopoint connection is preseeded it would be used.
>
> Improvements / thoughts welcome!
>
> Greets
> Igor Scheller
>
>
> [1] https://salsa.debian.org/installer-team/netcfg/merge_requests/2
From 06647bebad8643a1990a98431bfdc4eab80007d8 Mon Sep 17 00:00:00 2001
From: Igor Scheller 
Date: Sat, 2 Jun 2018 17:24:30 +0200
Subject: [PATCH 1/2] Add support for preseeded pointopoint

---
 static.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/static.c b/static.c
index ea12fba4..316f8d8e 100644
--- a/static.c
+++ b/static.c
@@ -557,11 +557,13 @@ int netcfg_get_static(struct debconfclient *client, struct netcfg_interface *ifa
 if (netcfg_get_ipaddress (client, iface)) {
 state = BACKUP;
 } else {
+debconf_get(client, "netcfg/get_pointopoint");
 if (strncmp(iface->name, "plip", 4) == 0
 || strncmp(iface->name, "slip", 4) == 0
 || strncmp(iface->name, "ctc", 3) == 0
 || strncmp(iface->name, "escon", 5) == 0
-|| strncmp(iface->name, "iucv", 4) == 0)
+|| strncmp(iface->name, "iucv", 4) == 0
+|| !empty_str(client->value))
 state = GET_POINTOPOINT;
 else if (iface->masklen == 0) {
 state = GET_NETMASK;
-- 
2.17.1


From 258e0a104c3207ecb723103446c686ad57181f7e Mon Sep 17 00:00:00 2001
From: Igor Scheller 
Date: Tue, 12 Jun 2018 13:12:38 +0200
Subject: [PATCH 2/2] Preseeded pointopoint: Fix routing

---
 static.c  | 2 +-
 write_interface.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/static.c b/static.c
index 316f8d8e..e3d93c79 100644
--- a/static.c
+++ b/static.c
@@ -368,7 +368,7 @@ static int netcfg_activate_static_ipv4(struct debconfclient *client,
 
 if (!empty_str(interface->pointopoint))
 {
-snprintf(buf, sizeof(buf), "ip route add default dev %s", interface->name);
+snprintf(buf, sizeof(buf), "ip route add default via %s dev %s", interface->pointopoint, interface->name);
 rv |= di_exec_shell_log(buf);
 }
 else if (!empty_str(interface->gateway)) {
diff --git a/write_interface.c b/write_interface.c
index 1f683b2a..406513e6 100644
--- a/write_interface.c
+++ b/write_interface.c
@@ -120,7 +120,7 @@ static int nc_wi_static_ipv4(const struct netcfg_interface *interface, FILE *fd)
 	fprintf(fd, "iface %s inet static\n", interface->name);
 	fprintf(fd, "\taddress %s/%i\n", interface->ipaddress,
 	empty_str(interface->pointopoint) ? interface->masklen : 32);
-	if (!empty_str(interface->gateway))
+	if (!empty_str(interface->gateway) || !empty_str(interface->pointopoint))
 		fprintf(fd, "\tgateway %s\n",
 		empty_str(interface->pointopoint) ? interface->gateway : interface->pointopoint);
 	if (!empty_str(interface->pointopoint))
-- 
2.17.1



signature.asc
Description: OpenPGP digital signature


Bug#694965: netcfg: Allow setup of pointopoint routes to reach gateway

2018-06-12 Thread Igor Scheller
Hi,
i created a merge request [1] that allows to preseed pointopoint
connections so anyone can use a preseed file or boot parameters to
define a pointopoint connection.
-> If a pointopoint connection is preseeded it would be used.

Improvements / thoughts welcome!

Greets
Igor Scheller


[1] https://salsa.debian.org/installer-team/netcfg/merge_requests/2




signature.asc
Description: OpenPGP digital signature


Bug#901255: netcfg-static: Unable to configure fe80::1 as a gateway

2018-06-10 Thread Igor Scheller
Package: netcfg-static
Severity: normal
Tags: ipv6

When I try to configure fe80::1 (next router) as a gateway in an IPv6 only
network the installer stops with an "Unreachable gateway" error.

Looking at netcfg-common.c:netcfg_gateway_reachable its checked by comparing
bytes. Imho a better way would be to configure the interface and ping the
gateway?



-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (150, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE= 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)