search for: packet_open

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

2017 Feb 04
0
[PATCH] ipconfig: handle multiple interfaces correctly
...rocess_receive_event(s, now); + nr--; + } + } return ret; } static int loop(void) { -#define NR_FDS 1 - struct pollfd fds[NR_FDS]; + struct pollfd *fds; struct state *s; - int pkt_fd; - int nr = 0, rc = 0; + int i, nr = 0, rc = 0; struct timeval now, prev; time_t start; - pkt_fd = packet_open(); - if (pkt_fd == -1) { - perror("packet_open"); - return -1; + fds = malloc(sizeof(struct pollfd) * n_devices); + if (!fds) { + fprintf(stderr, "malloc failed\n"); + rc = -1; + goto bail; } - fds[0].fd = pkt_fd; - fds[0].events = POLLRDNORM; + memset(fds, 0, sizeof(*f...
2019 Jan 18
0
[klibc:master] ipconfig: handle multiple interfaces correctly
...rocess_receive_event(s, now); + nr--; + } + } return ret; } static int loop(void) { -#define NR_FDS 1 - struct pollfd fds[NR_FDS]; + struct pollfd *fds; struct state *s; - int pkt_fd; - int nr = 0, rc = 0; + int i, nr = 0, rc = 0; struct timeval now, prev; time_t start; - pkt_fd = packet_open(); - if (pkt_fd == -1) { - perror("packet_open"); - return -1; + fds = malloc(sizeof(struct pollfd) * n_devices); + if (!fds) { + fprintf(stderr, "malloc failed\n"); + rc = -1; + goto bail; } - fds[0].fd = pkt_fd; - fds[0].events = POLLRDNORM; + memset(fds, 0, sizeof(*f...
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] Fix busy-looping behaviour in ipconfig
...gt;dev->ifindex == ifindex) { - process_receive_event(s, now); + ret |= process_receive_event(s, now); break; } + + bail: + return ret; } static int loop(void) @@ -254,7 +269,7 @@ struct state *s; int pkt_fd; int nr = 0; - time_t now; + struct timeval now, prev; pkt_fd = packet_open(); if (pkt_fd == -1) { @@ -265,10 +280,12 @@ fds[0].fd = pkt_fd; fds[0].events = POLLRDNORM; - now = time(NULL); + gettimeofday(&now, NULL); while (1) { int timeout = 60; int pending = 0; + int timeout_ms; + int x; for (s = slist; s; s = s->next) { if (s->state...
2004 May 28
1
ipconfig related question (do not get static IP setting)
Hi!! I found your ipconfig stuff in the udev rpm in SuSE 9.1. I'm about to setup a initramfs (pretty cool - much better than initrd) to boot linux diskless clients over the net. All the tools I would need, seem to be there with ipconfig/nfsmount ... I like to use the information I get from PXE/syslinux or Etherboot writing something like:
2010 Aug 24
0
[PATCH]: Exiting -1 if dhcp client failed
...git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index f00041b..888fdeb 100644 --- a/usr/kinit/ipconfig/main.c +++ 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;...
2003 Apr 29
0
[PATCH] Add configurable timeout to ipconfig
...4 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) { int timeout = 60; int pending = 0; @@ -308,8 +311,8 @@ for (x = 0; x < 2; x++) { int delta_ms; - if (timeout_ms <= 0) - timeo...
2011 Mar 28
5
[PATCH 1/3] Only peek and discard packets from specified device.
...: dprintf("discarded\n"); - packet_discard(); + packet_discard(dev); return 0; } diff --git a/usr/kinit/ipconfig/packet.h b/usr/kinit/ipconfig/packet.h index 627d282..524f393 100644 --- a/usr/kinit/ipconfig/packet.h +++ b/usr/kinit/ipconfig/packet.h @@ -6,8 +6,8 @@ struct iovec; int packet_open(void); void packet_close(void); int packet_send(struct netdev *dev, struct iovec *iov, int iov_len); -int packet_peek(int *ifindex); -void packet_discard(void); -int packet_recv(struct iovec *iov, int iov_len); +int packet_peek(struct netdev *dev); +void packet_discard(struct netdev *dev); +int p...
2011 Mar 27
4
ipconfig problem if multiple devices are up
Hi, it seems that ipconfig has a problem if multiple devices are up and connected to the same network. It seems that it uses the wrong socket/device index to compare it to incoming packet. To be more precise, the packet gets discarded in do_pkt_recv as the ifindex from state differs always from the incoming packet To reproduce create two tap devices: $ sudo tunctl -u uli -t tap0
2010 Mar 02
17
[PATCH 00/16] External building, update for 2.6.33 and multiple root devices.
The following patchset implements 3 seperate series of changes. External Building ================= Patches 1 through 8 enable to use of klibc's build system while leaving the src tree pristine (and potentially read only). Specifically: - srctree=<Sources for klibc> - objtree=<Ouput directory for klibc> - KLIBCKERNELSRC=<Kernel sources> - KLIBCKERNELOBJ=<Kernel