search for: loop_timeout

Displaying 10 results from an estimated 10 matches for "loop_timeout".

2003 Apr 29
0
[PATCH] Add configurable timeout to ipconfig
...in.c is yucky imho. Needs cleaning. -- Russell King (22/10/2002) diff -Nru a/ipconfig/main.c b/ipconfig/main.c --- a/ipconfig/main.c Tue Apr 29 13:03:14 2003 +++ b/ipconfig/main.c Tue Apr 29 13:03:14 2003 @@ -18,6 +18,7 @@ static const char *progname; static char do_not_config; +static int loop_timeout = -1; struct state { int state; @@ -270,6 +271,7 @@ int pkt_fd; int nr = 0; struct timeval now, prev; + time_t start; pkt_fd = packet_open(); if (pkt_fd == -1) { @@ -281,6 +283,7 @@ fds[0].events = POLLRDNORM; gettimeofday(&now, NULL); + start = now.tv_sec; while (1) {...
2010 Aug 24
0
[PATCH]: Exiting -1 if dhcp client failed
...+++ b/usr/kinit/ipconfig/main.c -334,6 +334,7 @@ static int loop(void) int nr = 0; struct timeval now, prev; time_t start; + int return_code=0; pkt_fd = packet_open(); if (pkt_fd == -1) { -396,6 +397,7 @@ static int loop(void) now.tv_sec - start >= loop_timeout) { printf("IP-Config: no response after %d " "secs - giving up\n", loop_timeout); + return_code=-1; goto bail; } -410,7 +412,7 @@ static int loop(void) bail: packet_close(); -...
2017 Feb 04
0
[PATCH] ipconfig: handle multiple interfaces correctly
...nsertions(+), 40 deletions(-) diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index 7be2a1fcb5af..c65fed5fb98e 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -30,6 +30,7 @@ static unsigned int default_caps = CAP_DHCP | CAP_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_co...
2019 Jan 18
0
[klibc:master] ipconfig: handle multiple interfaces correctly
...nged, 58 insertions(+), 40 deletions(-) diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index 7be2a1f..c65fed5 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -30,6 +30,7 @@ static unsigned int default_caps = CAP_DHCP | CAP_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_co...
2010 Aug 25
0
[patch] ipconfig fixes + run-init nit
...main.c +++ b/usr/kinit/ipconfig/main.c @@ -331,7 +331,7 @@ static int loop(void) struct pollfd fds[NR_FDS]; struct state *s; int pkt_fd; - int nr = 0; + int nr = 0, rc = 0; struct timeval now, prev; time_t start; @@ -396,6 +396,7 @@ static int loop(void) now.tv_sec - start >= loop_timeout) { printf("IP-Config: no response after %d " "secs - giving up\n", loop_timeout); + rc = -1; goto bail; } @@ -410,7 +411,7 @@ static int loop(void) bail: packet_close(); - return 0; + return rc; } static int add_one_dev(struct netdev...
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
2003 Apr 29
0
[PATCH] ipconfig: fix memory leak, and exit if no interfaces to configure
...ame); + exit(1); } int main(int argc, char *argv[]) @@ -430,8 +446,6 @@ } local_port = port; remote_port = local_port - 1; - printf("IP-Config: binding source port to %d, " - "dest to %d\n", local_port, remote_port); break; case 't': loop_timeout = atoi(optarg); @@ -448,7 +462,6 @@ case 'd': add_device(optarg); break; - case '?': fprintf(stderr, "%s: invalid option -%c\n", progname, optopt); @@ -456,6 +469,13 @@ } } while (1); + check_for_devs(); + + if (local_port != LOCAL_PORT) { +...
2005 Jan 06
0
skip unconnected interfaces
...es devices that are connected: --- klibc-0.194/ipconfig/main.c.orig 2005-01-06 15:20:24.749525888 -0700 +++ klibc-0.194/ipconfig/main.c 2005-01-06 15:24:48.038499880 -0700 @@ -27,6 +27,7 @@ static char do_not_config; static unsigned int default_caps = CAP_DHCP | CAP_BOOTP | CAP_RARP; static int loop_timeout = -1; +static int only_connected = 0; static int configured; struct state { @@ -290,6 +291,38 @@ return ret; } +static int ulong_from_sys_device_file(const char *path_prefix, + const char *dev_name, + const char *dev_file, + unsigned long *val) +{ + char t[PATH_M...
2008 May 24
3
ipconfig and boot filename option
Hi, ipconfig is used in ltsp (thin clients) initramfs. Some of the users have to have 2 dhcp servers in ltsp environments, so they hit on this problem: The first dhcp request is from the pxe rom boot code. This code ignores any dhcp offers that don't have a filename field. So they always get the correct address, from the ltsp server. The second dhcp request (in initramfs) is done by
2008 Jun 14
2
PATCH: ipconfig may discard useful packets
...1,11 +384,8 @@ static int loop(void) gettimeofday(&now, NULL); if ((fds[0].revents & POLLRDNORM)) { - nr = do_pkt_recv(pkt_fd, now.tv_sec); - if (nr == 1) + if (do_pkt_recv(pkt_fd, now.tv_sec) == 1) break; - else if (nr == 0) - packet_discard(); } if (loop_timeout >= 0 && diff --git a/usr/kinit/ipconfig/packet.c b/usr/kinit/ipconfig/packet.c index 283cf02..4bc01b5 100644 --- a/usr/kinit/ipconfig/packet.c +++ b/usr/kinit/ipconfig/packet.c @@ -165,6 +165,12 @@ int packet_send(struct netdev *dev, struct iovec *iov, int iov_len) return sendmsg(pkt_f...