search for: packet_recv

Displaying 14 results from an estimated 14 matches for "packet_recv".

2011 Mar 28
5
[PATCH 1/3] Only peek and discard packets from specified device.
...ns(+), 22 deletions(-) diff --git a/usr/kinit/ipconfig/bootp_proto.c b/usr/kinit/ipconfig/bootp_proto.c index baf9d3e..f2cc90c 100644 --- a/usr/kinit/ipconfig/bootp_proto.c +++ b/usr/kinit/ipconfig/bootp_proto.c @@ -169,7 +169,7 @@ int bootp_recv_reply(struct netdev *dev) }; int ret; - ret = packet_recv(iov, 3); + ret = packet_recv(dev, iov, 3); if (ret <= 0) return ret; diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c index fc0494d..993db52 100644 --- a/usr/kinit/ipconfig/dhcp_proto.c +++ b/usr/kinit/ipconfig/dhcp_proto.c @@ -147,7 +147,7 @@ static int dhcp...
2010 Aug 25
0
[patch] ipconfig fixes + run-init nit
...entric fixes. Erwan Velu (1): [klibc] ipconfig: non zero exit on timeout H. Peter Anvin (1): [klibc] 1.5.19 released, next version is 1.5.20 Julien BLACHE (2): [klibc] ipconfig: fix infinite loop [klibc] ipconfig: differentiate between error and non-DHCP/BOOTP traffic in packet_recv() Michael Prokop (1): [klibc] ipconfig fix dns domain maximilian attems (1): [klibc] run-init: get rid of over paranoid test for /init git diff -M --stat --summary klibc-1.5.19.. usr/kinit/ipconfig/bootp_proto.c | 2 +- usr/kinit/ipconfig/dhcp_proto.c | 4 ++-- usr/kinit/ipc...
2008 Jun 14
2
PATCH: ipconfig may discard useful packets
...y be needed. A scenario where the bug occurs: In main.c: nr = do_pkt_recv(pkt_fd, now.tv_sec); if (nr == 1) break; else if (nr == 0) packet_discard(); <== This one The following functions may be called: do_pkt_recv > process_receive_event > e.g. dhcp_recv_offer > dhcp_recv > packet_recv packet_recv may receive a not-appropriate packet, and jump to discard_pkt, in which case it *discards* the packet and returns 0. This return value (0) will propagate to main, so (nr == 0) and packet_discard() will be called *again*, causing the NIC to wait until it happens to receive some packet....
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
2017 Feb 04
0
[PATCH] ipconfig: handle multiple interfaces correctly
...scard(struct netdev *dev) @@ -174,7 +181,7 @@ void packet_discard(struct netdev *dev) sll.sll_ifindex = dev->ifindex; - recvfrom(pkt_fd, &iph, sizeof(iph), 0, + recvfrom(dev->pkt_fd, &iph, sizeof(iph), 0, (struct sockaddr *)&sll, &sllen); } @@ -207,7 +214,7 @@ int packet_recv(struct netdev *dev, struct iovec *iov, int iov_len) msg.msg_name = &sll; msg.msg_namelen = sllen; - ret = recvfrom(pkt_fd, &iph, sizeof(struct iphdr), + ret = recvfrom(dev->pkt_fd, &iph, sizeof(struct iphdr), MSG_PEEK, (struct sockaddr *)&sll, &sllen); if (r...
2019 Jan 18
0
[klibc:master] ipconfig: handle multiple interfaces correctly
...scard(struct netdev *dev) @@ -174,7 +181,7 @@ void packet_discard(struct netdev *dev) sll.sll_ifindex = dev->ifindex; - recvfrom(pkt_fd, &iph, sizeof(iph), 0, + recvfrom(dev->pkt_fd, &iph, sizeof(iph), 0, (struct sockaddr *)&sll, &sllen); } @@ -207,7 +214,7 @@ int packet_recv(struct netdev *dev, struct iovec *iov, int iov_len) msg.msg_name = &sll; msg.msg_namelen = sllen; - ret = recvfrom(pkt_fd, &iph, sizeof(struct iphdr), + ret = recvfrom(dev->pkt_fd, &iph, sizeof(struct iphdr), MSG_PEEK, (struct sockaddr *)&sll, &sllen); if (r...
2008 Jun 14
5
PATCH: ipconfig may accept DHCPOFFER as DHCPACK
...r, exts, extlen); > if (ret == 1 && serverid != INADDR_NONE) 116c111 < ret = bootp_parse(dev, hdr, exts, extlen) ? DHCPACK : 0; --- > ret = bootp_parse(dev, hdr, exts, extlen); 121c116 < ret = DHCPNAK; --- > ret = 2; 130,135d124 < * Returns: < *-1 = Error in packet_recv < * 0 = Not handled < * 2 = DHCPOFFER (from dhcp_proto.h) < * 5 = DHCPACK < * 6 = DHCPNACK
2009 Jan 15
1
Bug#511959: klibc-utils: ipconfig times out when several machines boot at the very same time
...ith DEBUG/IPC_DEBUG, and discovered that the machines that don't boot receive the messages broadcasted by the other dhcp clients (be it DISCOVER or REQUEST) and from that point on, receive nothing else. Now, looking at the code (under usr/kinit/ipconfig for those following at home): packet.c: packet_recv() | ? | if (udp->source != htons(cfg_remote_port) || | udp->dest != htons(cfg_local_port)) | goto free_pkt; | ? | free_pkt: | free(ip); | return 0; | ? Which means in case of source/dest mismatch (which is the case when a message from anoth...
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
2009 Mar 12
1
the return value of packet_peek()
...I execute ipconfig the first time, it will get an ip address from dhcp server, If I execute ipconfig the second time (or more times), since my TP-LINK TL-R402M router will give an icmp(ping) packet before DHCPOFFER, the ipconfig will fail after it receive the packet and tries unpack teh packet in packet_recv() since we have a packet form checking there: if (ntohs(ip->tot_len) > ret || ip->protocol != IPPROTO_UDP) goto free_pkt; ip config will fall in a loop and always got the icmp packet instead of DHCPOFFER packet in this situation. If I change the retrun value of packet_peek and make a...
2010 Aug 12
1
Bug#584583: [PATCH] Additional fix for ipconfig
...place > that were not warranted and badly tested. Indeed as mailinglist history show I had been sceptic to that monster patch, but several users had pushed for it, see: http://bugs.debian.org/511959 > After this commit, if a random UDP packet comes in before the expected > DHCP reply packet_recv() will exit with an error and the interface will be > sent into DEVST_ERROR instead of just ignoring this packet. On busy LANs, > ipconfig can go through this loop several times. > > JB. as mika is currently on vacation after Debconf. I will look into the issue and see if said patch...
2011 Jul 08
4
[PATCH 0/4] usr/kinit checkpatch
Various coding style fixes checkpatch warns about. The goal is not to be 100% checkpatch compliant, but to have more consistent coding style. As this is a trivial patch serie, will land in 24 hours in klibc git, unless of course ml review hits a bugger. Checked with size(3) that the generated kinit, fstype, ipconfig and nfsmount are the same. maximilian attems (4): [klibc] ipconfig: reduce
2003 Apr 29
0
[PATCH] Fix busy-looping behaviour in ipconfig
...et.h b/ipconfig/packet.h --- a/ipconfig/packet.h Tue Apr 29 11:01:50 2003 +++ b/ipconfig/packet.h Tue Apr 29 11:01:50 2003 @@ -5,5 +5,5 @@ 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); -
2014 Mar 15
1
Upgrading from 4.1.4 to 4.1.6 on FreeBSD 9.2
...undefined reference to `E_deshash at SAMBA_4.1.4' /usr/local/lib/libsamdb.so: undefined reference to `samdb_partitions_dn at SAMBA_4.1.4' /usr/local/lib/libgensec.so: undefined reference to `ndr_print_NEGOTIATE_MESSAGE at SAMBA_4.1.4' /usr/local/lib/libgensec.so: undefined reference to `packet_recv at SAMBA_4.1.4' /usr/local/lib/libsamdb.so: undefined reference to `dom_sid_string at SAMBA_4.1.4' /usr/local/lib/libsamdb.so: undefined reference to `dom_sid_parse at SAMBA_4.1.4' /usr/local/lib/libndr-standard.so: undefined reference to `ndr_pull_security_descriptor at SAMBA_4.1.4'...