Displaying 14 results from an estimated 14 matches for "dump_device_config".
2011 Apr 15
2
[PATCH] Escape DHCP options written to /tmp/net-$DEVCICE.conf
...;", name);
+ while (value[i]) {
+ switch (value[i]) {
+ case '"':
+ case '$':
+ case '`':
+ case '\\':
+ fprintf(f, "\\");
+ }
+ fprintf(f, "%c", value[i]);
+ ++i;
+ }
+ fprintf(f, "\"\n");
+}
+
static void dump_device_config(struct netdev *dev)
{
char fn[40];
@@ -103,22 +122,26 @@ static void dump_device_config(struct netdev *dev)
snprintf(fn, sizeof(fn), "/tmp/net-%s.conf", dev->name);
f = fopen(fn, "w");
if (f) {
- fprintf(f, "DEVICE=%s\n", dev->name);
- fprintf(f, "...
2006 Jul 07
0
[patch] ipconfig set hostname from dhcpd server
...ailed to set default route on %s\n",
dev->name);
+ if (dev->hostname[0] &&
+ sethostname(dev->hostname, strlen(dev->hostname)))
+ printf("IP-Config: failed to set hostname '%s' from %s\n",
+ dev->hostname, dev->name);
}
static void dump_device_config(struct netdev *dev)
--
maks
2012 May 22
0
[klibc:master] ipconfig: Use /run/ directory for script file
...stro.at>
---
usr/kinit/ipconfig/main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c
index 476384a..7be2a1f 100644
--- a/usr/kinit/ipconfig/main.c
+++ b/usr/kinit/ipconfig/main.c
@@ -147,8 +147,9 @@ static void dump_device_config(struct netdev *dev)
* sizeof(UINT64_MAX)==21
*/
char buf21[21];
+ const char path[] = "/run/";
- snprintf(fn, sizeof(fn), "/tmp/net-%s.conf", dev->name);
+ snprintf(fn, sizeof(fn), "%snet-%s.conf", path, dev->name);
f = fopen(fn, "w");
if...
2006 Jun 22
2
[patch] ipconfig add dhcp file preseeding support
...dev->nisdomainname);
printf(" rootserver: %s ", my_inet_ntoa(dev->ip_server));
printf("rootpath: %s\n", dev->bootpath);
+ printf(" filename : %s\n", dev->filename);
}
static void configure_device(struct netdev *dev)
@@ -112,6 +113,7 @@ static void dump_device_config(struct ne
fprintf(f, "NISDOMAIN=%s\n", dev->nisdomainname);
fprintf(f, "ROOTSERVER=%s\n", my_inet_ntoa(dev->ip_server));
fprintf(f, "ROOTPATH=%s\n", dev->bootpath);
+ fprintf(f, "FILENAME=%s\n", dev->filename);
fclose(f);
}
}
diff...
2011 Jul 05
6
[PATCH 1/7] ln: Check snprintf() return values
Add some semi-useful error message, as printing the failing dir or file
seems not really advisable after that error.
Signed-off-by: maximilian attems <max at stro.at>
---
usr/utils/ln.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/usr/utils/ln.c b/usr/utils/ln.c
index e826eb8..257b33f 100644
--- a/usr/utils/ln.c
+++ b/usr/utils/ln.c
@@ -9,7
2017 Feb 04
0
[PATCH] ipconfig: handle multiple interfaces correctly
...BOOTP | CAP_RARP;
static int loop_timeout = -1;
static int configured;
static int bringup_first = 0;
+static int n_devices = 0;
/* DHCP vendor class identifier */
char vendor_class_identifier[260];
@@ -220,6 +221,7 @@ static void complete_device(struct netdev *dev)
configure_device(dev);
dump_device_config(dev);
print_device_config(dev);
+ packet_close(dev);
++configured;
@@ -374,34 +376,36 @@ struct netdev *ifaces;
* 0 = No dhcp/bootp packet was received
* 1 = A packet was received and handled
*/
-static int do_pkt_recv(int pkt_fd, time_t now)
+static int do_pkt_recv(int nr, struct p...
2019 Jan 18
0
[klibc:master] ipconfig: handle multiple interfaces correctly
...BOOTP | CAP_RARP;
static int loop_timeout = -1;
static int configured;
static int bringup_first = 0;
+static int n_devices = 0;
/* DHCP vendor class identifier */
char vendor_class_identifier[260];
@@ -220,6 +221,7 @@ static void complete_device(struct netdev *dev)
configure_device(dev);
dump_device_config(dev);
print_device_config(dev);
+ packet_close(dev);
++configured;
@@ -374,34 +376,36 @@ struct netdev *ifaces;
* 0 = No dhcp/bootp packet was received
* 1 = A packet was received and handled
*/
-static int do_pkt_recv(int pkt_fd, time_t now)
+static int do_pkt_recv(int nr, struct p...
2012 May 22
0
[klibc:master] ipconfig: Write $DOMAINSEARCH as domain-search
...;
struct iovec iov[] = {
/* [0] = ip + udp header */
[1] = {&bootp, sizeof(struct bootp_hdr)},
diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c
index 148ccb6..476384a 100644
--- a/usr/kinit/ipconfig/main.c
+++ b/usr/kinit/ipconfig/main.c
@@ -176,6 +176,8 @@ static void dump_device_config(struct netdev *dev)
write_option(f, "UPTIME", buf21);
sprintf(buf21, "%u", (unsigned int)dev->dhcpleasetime);
write_option(f, "DHCPLEASETIME", buf21);
+ write_option(f, "DOMAINSEARCH", dev->domainsearch == NULL ?
+ "" : dev-&g...
2017 Dec 19
0
[PATCH] Implement classless static routes
...-Config: failed to set default route on %s\n",
+ if (netdev_setroutes(dev))
+ printf("IP-Config: failed to set routes on %s\n",
dev->name);
if (dev->hostname[0] &&
sethostname(dev->hostname, strlen(dev->hostname)))
@@ -160,8 +173,24 @@ static void dump_device_config(struct netdev *dev)
my_inet_ntoa(dev->ip_broadcast));
write_option(f, "IPV4NETMASK",
my_inet_ntoa(dev->ip_netmask));
- write_option(f, "IPV4GATEWAY",
- my_inet_ntoa(dev->ip_gateway));
+ if (dev->routes != NULL) {
+ /* Use 6 digits to encode the in...
2010 Aug 25
0
[patch] ipconfig fixes + run-init nit
...inhard Tartler <siretart at tauware.de>
Signed-off-by: maximilian attems <max at stro.at>
diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c
index f00041b..b014128 100644
--- a/usr/kinit/ipconfig/main.c
+++ b/usr/kinit/ipconfig/main.c
@@ -115,7 +115,7 @@ static void dump_device_config(struct netdev *dev)
fprintf(f, "IPV4DNS1=%s\n",
my_inet_ntoa(dev->ip_nameserver[1]));
fprintf(f, "HOSTNAME=%s\n", dev->hostname);
- fprintf(f, "DNSDOMAIN=%s\n", dev->dnsdomainname);
+ fprintf(f, "DNSDOMAIN=\"%s\"\n", dev->dns...
2018 Jun 12
0
[PATCH v2] Implement classless static routes
...-Config: failed to set default route on %s\n",
+ if (netdev_setroutes(dev))
+ printf("IP-Config: failed to set routes on %s\n",
dev->name);
if (dev->hostname[0] &&
sethostname(dev->hostname, strlen(dev->hostname)))
@@ -160,8 +180,24 @@ static void dump_device_config(struct netdev *dev)
my_inet_ntoa(dev->ip_broadcast));
write_option(f, "IPV4NETMASK",
my_inet_ntoa(dev->ip_netmask));
- write_option(f, "IPV4GATEWAY",
- my_inet_ntoa(dev->ip_gateway));
+ if (dev->routes != NULL) {
+ /* Use 6 digits to encode the in...
2019 Jan 18
0
[klibc:master] ipconfig: Implement classless static routes
...-Config: failed to set default route on %s\n",
+ if (netdev_setroutes(dev))
+ printf("IP-Config: failed to set routes on %s\n",
dev->name);
if (dev->hostname[0] &&
sethostname(dev->hostname, strlen(dev->hostname)))
@@ -161,8 +181,24 @@ static void dump_device_config(struct netdev *dev)
my_inet_ntoa(dev->ip_broadcast));
write_option(f, "IPV4NETMASK",
my_inet_ntoa(dev->ip_netmask));
- write_option(f, "IPV4GATEWAY",
- my_inet_ntoa(dev->ip_gateway));
+ if (dev->routes != NULL) {
+ /* Use 6 digits to encode the in...
2018 Jun 18
1
[PATCH v3 1/2] Implement classless static routes
...-Config: failed to set default route on %s\n",
+ if (netdev_setroutes(dev))
+ printf("IP-Config: failed to set routes on %s\n",
dev->name);
if (dev->hostname[0] &&
sethostname(dev->hostname, strlen(dev->hostname)))
@@ -160,8 +180,24 @@ static void dump_device_config(struct netdev *dev)
my_inet_ntoa(dev->ip_broadcast));
write_option(f, "IPV4NETMASK",
my_inet_ntoa(dev->ip_netmask));
- write_option(f, "IPV4GATEWAY",
- my_inet_ntoa(dev->ip_gateway));
+ if (dev->routes != NULL) {
+ /* Use 6 digits to encode the in...
2017 Dec 31
4
[PATCH klibc 0/4] Fixes from Debian and Ubuntu
The following patches come from Debian and/or Ubuntu packages of
klibc.
Ben.
Ben Hutchings (1):
[klibc] run-init: Add dry-run mode
Jay Vosburgh (1):
[klibc] ipconfig: Use separate sockets for DHCP from multiple
interfaces
Mathieu Trudel-Lapierre (1):
[klibc] ipconfig: Set broadcast when sending DHCPREQUEST and
DHCPDISCOVER
YunQiang Su (1):
[klibc] mips: setjmp.S: don't