Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 149561 Details for
Bug 231444
dhclient broken in Xen guest - need xen-checksum patch
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
linux-2.6.19-packet-auxdata-csum.patch
linux-2.6.19-packet-auxdata-csum.patch (text/plain), 4.03 KB, created by
Mark McLoughlin
on 2007-03-08 12:28:04 UTC
(
hide
)
Description:
linux-2.6.19-packet-auxdata-csum.patch
Filename:
MIME Type:
Creator:
Mark McLoughlin
Created:
2007-03-08 12:28:04 UTC
Size:
4.03 KB
patch
obsolete
>--- linux-2.6.19.x86_64/net/packet/af_packet.c.packet-auxdata-csum 2006-11-29 21:57:37.000000000 +0000 >+++ linux-2.6.19.x86_64/net/packet/af_packet.c 2007-03-08 11:39:11.000000000 +0000 >@@ -199,7 +199,8 @@ > #endif > struct packet_type prot_hook; > spinlock_t bind_lock; >- char running; /* prot_hook is attached*/ >+ unsigned int running:1, /* prot_hook is attached*/ >+ auxdata:1; > int ifindex; /* bound device */ > unsigned short num; > #ifdef CONFIG_PACKET_MULTICAST >@@ -213,6 +214,8 @@ > #endif > }; > >+#define PACKET_SKB_CB(__skb) ((struct tpacket_auxdata *)((__skb)->cb)) >+ > #ifdef CONFIG_PACKET_MMAP > > static inline char *packet_lookup_frame(struct packet_sock *po, unsigned int position) >@@ -467,6 +470,7 @@ > u8 * skb_head = skb->data; > int skb_len = skb->len; > unsigned snaplen; >+ struct tpacket_auxdata *aux; > > if (skb->pkt_type == PACKET_LOOPBACK) > goto drop; >@@ -525,6 +529,18 @@ > if (dev->hard_header_parse) > sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr); > >+ if (skb_checksum_setup(skb)) >+ goto drop_n_acct; >+ >+ aux = PACKET_SKB_CB(skb); >+ aux->tp_status = TP_STATUS_USER; >+ if (skb->ip_summed == CHECKSUM_HW) >+ aux->tp_status |= TP_STATUS_CSUMNOTREADY; >+ aux->tp_len = skb->len; >+ aux->tp_snaplen = snaplen; >+ aux->tp_mac = 0; >+ aux->tp_net = skb->nh.raw - skb->data; >+ > if (pskb_trim(skb, snaplen)) > goto drop_n_acct; > >@@ -594,6 +610,11 @@ > if (run_filter(skb, sk, &snaplen) < 0) > goto drop_n_restore; > >+ if (skb_checksum_setup(skb)) >+ goto drop; >+ if (skb->ip_summed == CHECKSUM_HW) >+ status |= TP_STATUS_CSUMNOTREADY; >+ > if (sk->sk_type == SOCK_DGRAM) { > macoff = netoff = TPACKET_ALIGN(TPACKET_HDRLEN) + 16; > } else { >@@ -1117,6 +1138,11 @@ > if (msg->msg_name) > memcpy(msg->msg_name, skb->cb, msg->msg_namelen); > >+ if (pkt_sk(sk)->auxdata) { >+ struct tpacket_auxdata *aux = PACKET_SKB_CB(skb); >+ put_cmsg(msg, SOL_PACKET, PACKET_AUXDATA, sizeof(*aux), aux); >+ } >+ > /* > * Free or return the buffer as appropriate. Again this > * hides all the races and re-entrancy issues from us. >@@ -1315,6 +1341,7 @@ > packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) > { > struct sock *sk = sock->sk; >+ struct packet_sock *po = pkt_sk(sk); > int ret; > > if (level != SOL_PACKET) >@@ -1367,6 +1394,18 @@ > return 0; > } > #endif >+ case PACKET_AUXDATA: >+ { >+ int val; >+ >+ if (optlen < sizeof(val)) >+ return -EINVAL; >+ if (copy_from_user(&val, optval, sizeof(val))) >+ return -EFAULT; >+ >+ po->auxdata = !!val; >+ return 0; >+ } > default: > return -ENOPROTOOPT; > } >@@ -1376,8 +1415,11 @@ > char __user *optval, int __user *optlen) > { > int len; >+ int val; > struct sock *sk = sock->sk; > struct packet_sock *po = pkt_sk(sk); >+ void *data; >+ struct tpacket_stats st; > > if (level != SOL_PACKET) > return -ENOPROTOOPT; >@@ -1390,9 +1432,6 @@ > > switch(optname) { > case PACKET_STATISTICS: >- { >- struct tpacket_stats st; >- > if (len > sizeof(struct tpacket_stats)) > len = sizeof(struct tpacket_stats); > spin_lock_bh(&sk->sk_receive_queue.lock); >@@ -1401,16 +1440,23 @@ > spin_unlock_bh(&sk->sk_receive_queue.lock); > st.tp_packets += st.tp_drops; > >- if (copy_to_user(optval, &st, len)) >- return -EFAULT; >+ data = &st; >+ break; >+ case PACKET_AUXDATA: >+ if (len > sizeof(int)) >+ len = sizeof(int); >+ val = po->auxdata; >+ >+ data = &val; > break; >- } > default: > return -ENOPROTOOPT; > } > > if (put_user(len, optlen)) > return -EFAULT; >+ if (copy_to_user(optval, data, len)) >+ return -EFAULT; > return 0; > } > >--- linux-2.6.19.x86_64/include/linux/if_packet.h.packet-auxdata-csum 2006-11-29 21:57:37.000000000 +0000 >+++ linux-2.6.19.x86_64/include/linux/if_packet.h 2007-03-08 11:39:11.000000000 +0000 >@@ -39,6 +39,7 @@ > #define PACKET_RX_RING 5 > #define PACKET_STATISTICS 6 > #define PACKET_COPY_THRESH 7 >+#define PACKET_AUXDATA 8 > > struct tpacket_stats > { >@@ -46,6 +47,15 @@ > unsigned int tp_drops; > }; > >+struct tpacket_auxdata >+{ >+ __u32 tp_status; >+ __u32 tp_len; >+ __u32 tp_snaplen; >+ __u16 tp_mac; >+ __u16 tp_net; >+}; >+ > struct tpacket_hdr > { > unsigned long tp_status;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 231444
: 149561 |
149562
|
152271