Displaying 20 results from an estimated 33 matches for "udphdr".
2010 Jun 28
3
[PATCHv2] vhost-net: add dhclient work-around from userspace
...e3fc3f10d0db8cc,
+ * and older userspace does not use it.
+ * One important user of recvmsg with AF_PACKET is dhclient,
+ * so we add a work-around just for DHCP. */
+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ skb_headlen(skb) >= skb_transport_offset(skb) +
+ sizeof(struct udphdr) &&
+ udp_hdr(skb)->dest == htons(68) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPROTO_UDP &&
+ skb->protocol == htons(ETH_P_IP)) {
+ skb_checksum_help(skb);
+ /* Restore ip_summed value: tun...
2010 Jun 28
3
[PATCHv2] vhost-net: add dhclient work-around from userspace
...e3fc3f10d0db8cc,
+ * and older userspace does not use it.
+ * One important user of recvmsg with AF_PACKET is dhclient,
+ * so we add a work-around just for DHCP. */
+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ skb_headlen(skb) >= skb_transport_offset(skb) +
+ sizeof(struct udphdr) &&
+ udp_hdr(skb)->dest == htons(68) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPROTO_UDP &&
+ skb->protocol == htons(ETH_P_IP)) {
+ skb_checksum_help(skb);
+ /* Restore ip_summed value: tun...
2020 Mar 28
0
[klibc:master] ipconfig: Fix alignment of packet structure
...etion(-)
diff --git a/usr/kinit/ipconfig/packet.c b/usr/kinit/ipconfig/packet.c
index 20018010..2e1487d2 100644
--- a/usr/kinit/ipconfig/packet.c
+++ b/usr/kinit/ipconfig/packet.c
@@ -86,7 +86,7 @@ static unsigned int ip_checksum(uint16_t *hdr, int len)
struct header {
struct iphdr ip;
struct udphdr udp;
-} __attribute__ ((packed));
+} __attribute__ ((packed, aligned(4)));
static struct header ipudp_hdrs = {
.ip = {
2005 Dec 01
0
[PATCH] Log error in csum dev_queue_xmit error path
...ksum
offload needs to be diabled.
diff -r f5b119533cc8 -r 6e8be095dd84 linux-2.6-xen-sparse/net/core/dev.c
--- a/linux-2.6-xen-sparse/net/core/dev.c Thu Dec 1 14:22:22 2005
+++ b/linux-2.6-xen-sparse/net/core/dev.c Thu Dec 1 19:29:00 2005
@@ -1283,6 +1283,11 @@
skb->csum = offsetof(struct udphdr, check);
break;
default:
+ if (net_ratelimit())
+ printk(KERN_ERR "Attempting to checksum a "
+ "non-TCP/UDP packet, dropping a protocol"
+ " %d packet", skb->nh.iph->protocol);
+ rc = -EPROTO;
goto out_kfree_skb;
}
if...
2014 Jun 20
3
[Bug 963] New: nfq_udp_get_payload and nfq_udp_get_payload_len return wrong results
...nt: libnetfilter_queue
AssignedTo: netfilter-buglog at lists.netfilter.org
ReportedBy: lantw44 at gmail.com
Estimated Hours: 0.0
nfq_udp_get_payload:
udph->len is the length of packet, not the length of the UDP header.
UDP header is a constant, which equals sizeof(struct udphdr).
nfq_udp_get_payload_len:
pktb->tail - pktb->transport_header is the length of entire UDP packet,
not the length of UDP packet payload.
--
Configure bugmail: https://bugzilla.netfilter.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching al...
2010 Jun 27
0
[PATCH RFC] vhost-net: add dhclient work-around from userspace
...t;ip_summed == CHECKSUM_PARTIAL &&
+ skb->protocol == htons(ETH_P_IP) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPRODO_UDP &&
+ skb_headlen(skb) >= skb_transport_offset(skb) + sizeof(struct udphdr) &&
+ udp_hdr(skb)->source == htons(0x67)) {
+ skb_checksum_help(skb);
+ /* Restore ip_summed value: tun passes it to user. */
+ skb->ip_summed = CHECKSUM_PARTIAL;
+ }
+ } else {
+ ret = 0;
+ }
+ release_sock(sk);
+ return len;
+}
+
/* Expects to be always run from workq...
2010 Jun 27
0
[PATCH RFC] vhost-net: add dhclient work-around from userspace
...t;ip_summed == CHECKSUM_PARTIAL &&
+ skb->protocol == htons(ETH_P_IP) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPRODO_UDP &&
+ skb_headlen(skb) >= skb_transport_offset(skb) + sizeof(struct udphdr) &&
+ udp_hdr(skb)->source == htons(0x67)) {
+ skb_checksum_help(skb);
+ /* Restore ip_summed value: tun passes it to user. */
+ skb->ip_summed = CHECKSUM_PARTIAL;
+ }
+ } else {
+ ret = 0;
+ }
+ release_sock(sk);
+ return len;
+}
+
/* Expects to be always run from workq...
2004 Aug 06
0
[RFC] RTP support
...quot;rtp socket failed: %s", strerror(errno));
+
config_release_config();
/* grab a read lock, to make sure we get a chance to cleanup */
@@ -412,6 +481,23 @@
}
}
+ if (rtp_socket>=0) {
+ rtp_amount=1420-sizeof(struct iphdr)-sizeof(struct udphdr)-RTP_HDR_SIZE-RTP_MPEG_HDR_SIZE;
+ gettimeofday(&rtp_tv,NULL);
+ *(unsigned long *)(rtp_buf+4)=htonl(rtp_timestamp+
+ (((unsigned long)rtp_tv.tv_sec)*RTP_MPEG_CLK)+
+ (((unsigned long)rtp_tv.tv_usec)*(RTP_MPEG_CLK/10000))/100);
+ for(rtp...
2005 Oct 14
5
[PATCH] Fix NAT for domU checksum offload
...conntrack))
+ return 1;
+ }
+ return 0;
+}
+
+static int
+udp_manip_pkt(struct sk_buff **pskb,
+ unsigned int iphdroff,
+ const struct ip_conntrack_tuple *tuple,
+ enum ip_nat_manip_type maniptype)
+{
+ struct iphdr *iph = (struct iphdr *)((*pskb)->data + iphdroff);
+ struct udphdr *hdr;
+ unsigned int hdroff = iphdroff + iph->ihl*4;
+ u32 oldip, newip;
+ u16 *portptr, newport;
+
+ if (!skb_ip_make_writable(pskb, hdroff + sizeof(*hdr)))
+ return 0;
+
+ iph = (struct iphdr *)((*pskb)->data + iphdroff);
+ hdr = (struct udphdr *)((*pskb)->data + hdroff);
+
+ if (manipt...
2017 Feb 04
0
[PATCH] ipconfig: handle multiple interfaces correctly
...cvfrom(dev->pkt_fd, &iph, sizeof(struct iphdr),
MSG_PEEK, (struct sockaddr *)&sll, &sllen);
if (ret == -1)
return -1;
@@ -226,7 +233,7 @@ int packet_recv(struct netdev *dev, struct iovec *iov, int iov_len)
iov[0].iov_base = ip;
iov[0].iov_len = iphl + sizeof(struct udphdr);
- ret = recvmsg(pkt_fd, &msg, 0);
+ ret = recvmsg(dev->pkt_fd, &msg, 0);
if (ret == -1)
goto free_pkt;
diff --git a/usr/kinit/ipconfig/packet.h b/usr/kinit/ipconfig/packet.h
index f6cef5210958..4367efe1428e 100644
--- a/usr/kinit/ipconfig/packet.h
+++ b/usr/kinit/ipconfig/pack...
2006 Feb 22
0
Re: [PATCH] Fix IPSec for Xen checksum offload packets (Jon Mason)
...nh.iph->ihl;
> if (skb->h.raw >= skb->tail)
>- goto out_kfree_skb;
>+ goto out;
> switch (skb->nh.iph->protocol) {
> case IPPROTO_TCP:
> skb->csum = offsetof(struct tcphdr, check);
>@@ -1284,18 +1224,89 @@
> skb->csum = offsetof(struct udphdr, check);
> break;
> default:
>- if (net_ratelimit())
>- printk(KERN_ERR "Attempting to checksum a non-"
>- "TCP/UDP packet, dropping a protocol"
>- " %d packet", skb->nh.iph->protocol);
>- rc = -EPROTO;
>-...
2019 Jan 18
0
[klibc:master] ipconfig: handle multiple interfaces correctly
...cvfrom(dev->pkt_fd, &iph, sizeof(struct iphdr),
MSG_PEEK, (struct sockaddr *)&sll, &sllen);
if (ret == -1)
return -1;
@@ -226,7 +233,7 @@ int packet_recv(struct netdev *dev, struct iovec *iov, int iov_len)
iov[0].iov_base = ip;
iov[0].iov_len = iphl + sizeof(struct udphdr);
- ret = recvmsg(pkt_fd, &msg, 0);
+ ret = recvmsg(dev->pkt_fd, &msg, 0);
if (ret == -1)
goto free_pkt;
diff --git a/usr/kinit/ipconfig/packet.h b/usr/kinit/ipconfig/packet.h
index f6cef52..4367efe 100644
--- a/usr/kinit/ipconfig/packet.h
+++ b/usr/kinit/ipconfig/packet.h
@@ -3...
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
2011 Mar 28
5
[PATCH 1/3] Only peek and discard packets from specified device.
...&sllen);
}
@@ -219,7 +221,7 @@ void packet_discard(void)
* 0 = Discarded packet (non-DHCP/BOOTP traffic)
* >0 = Size of packet
*/
-int packet_recv(struct iovec *iov, int iov_len)
+int packet_recv(struct netdev* dev, struct iovec *iov, int iov_len)
{
struct iphdr *ip, iph;
struct udphdr *udp;
@@ -293,6 +295,6 @@ free_pkt:
discard_pkt:
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/ip...
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
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 May 22
0
[PATCH 2.5.69 1/3] remove ipconfig support from the kernel
...- struct net_device *dev = d->dev;
- arp_send(ARPOP_RREQUEST, ETH_P_RARP, 0, dev, 0, NULL,
- dev->dev_addr, dev->dev_addr);
-}
-#endif
-
-/*
- * DHCP/BOOTP support.
- */
-
-#ifdef IPCONFIG_BOOTP
-
-struct bootp_pkt { /* BOOTP packet format */
- struct iphdr iph; /* IP header */
- struct udphdr udph; /* UDP header */
- u8 op; /* 1=request, 2=reply */
- u8 htype; /* HW address type */
- u8 hlen; /* HW address length */
- u8 hops; /* Used only by gateways */
- u32 xid; /* Transaction ID */
- u16 secs; /* Seconds since we started */
- u16 flags; /* Just what it says */
- u32 client_i...
2009 Oct 06
1
[PATCH 2.6.32-rc3] net: VMware virtual Ethernet NIC driver: vmxnet3
...ct tcphdr);
+
+ if (unlikely(!pskb_may_pull(skb,
+ pull_size))) {
+ goto err;
+ }
+ ctx->l4_hdr_size = ((struct tcphdr *)
+ skb_transport_header(skb))->doff * 4;
+ } else if (iph->protocol == IPPROTO_UDP) {
+ ctx->l4_hdr_size =
+ sizeof(struct udphdr);
+ } else {
+ ctx->l4_hdr_size = 0;
+ }
+ } else {
+ /* for simplicity, don't copy L4 headers */
+ ctx->l4_hdr_size = 0;
+ }
+ ctx->copy_size = ctx->eth_ip_hdr_size +
+ ctx->l4_hdr_size;
+ } else {
+ ctx->eth_ip_hdr_size = 0;
+ ctx->l4_hdr_s...
2009 Oct 06
1
[PATCH 2.6.32-rc3] net: VMware virtual Ethernet NIC driver: vmxnet3
...ct tcphdr);
+
+ if (unlikely(!pskb_may_pull(skb,
+ pull_size))) {
+ goto err;
+ }
+ ctx->l4_hdr_size = ((struct tcphdr *)
+ skb_transport_header(skb))->doff * 4;
+ } else if (iph->protocol == IPPROTO_UDP) {
+ ctx->l4_hdr_size =
+ sizeof(struct udphdr);
+ } else {
+ ctx->l4_hdr_size = 0;
+ }
+ } else {
+ /* for simplicity, don't copy L4 headers */
+ ctx->l4_hdr_size = 0;
+ }
+ ctx->copy_size = ctx->eth_ip_hdr_size +
+ ctx->l4_hdr_size;
+ } else {
+ ctx->eth_ip_hdr_size = 0;
+ ctx->l4_hdr_s...
2009 Oct 12
1
[PATCH 2.6.32-rc4] net: VMware virtual Ethernet NIC driver: vmxnet3
...ct tcphdr);
+
+ if (unlikely(!pskb_may_pull(skb,
+ pull_size))) {
+ goto err;
+ }
+ ctx->l4_hdr_size = ((struct tcphdr *)
+ skb_transport_header(skb))->doff * 4;
+ } else if (iph->protocol == IPPROTO_UDP) {
+ ctx->l4_hdr_size =
+ sizeof(struct udphdr);
+ } else {
+ ctx->l4_hdr_size = 0;
+ }
+ } else {
+ /* for simplicity, don't copy L4 headers */
+ ctx->l4_hdr_size = 0;
+ }
+ ctx->copy_size = ctx->eth_ip_hdr_size +
+ ctx->l4_hdr_size;
+ } else {
+ ctx->eth_ip_hdr_size = 0;
+ ctx->l4_hdr_s...