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 146320 Details for
Bug 223505
LSPP: tcpdump crashes kernel and system goes into debugger.
[?]
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]
diff between 3013 and 3014
diff.diff (text/plain), 4.95 KB, created by
Eric Paris
on 2007-01-23 17:12:06 UTC
(
hide
)
Description:
diff between 3013 and 3014
Filename:
MIME Type:
Creator:
Eric Paris
Created:
2007-01-23 17:12:06 UTC
Size:
4.95 KB
patch
obsolete
>diff -Naupr linux-2.6.18-3013.ppc64/include/linux/if_packet.h linux-2.6.18-3014.ppc64/include/linux/if_packet.h >--- linux-2.6.18-3013.ppc64/include/linux/if_packet.h 2006-09-19 23:42:06.000000000 -0400 >+++ linux-2.6.18-3014.ppc64/include/linux/if_packet.h 2007-01-23 11:55:21.000000000 -0500 >@@ -39,6 +39,7 @@ struct sockaddr_ll > #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 @@ struct tpacket_stats > 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; >diff -Naupr linux-2.6.18-3013.ppc64/net/packet/af_packet.c linux-2.6.18-3014.ppc64/net/packet/af_packet.c >--- linux-2.6.18-3013.ppc64/net/packet/af_packet.c 2006-09-19 23:42:06.000000000 -0400 >+++ linux-2.6.18-3014.ppc64/net/packet/af_packet.c 2007-01-23 11:55:21.000000000 -0500 >@@ -199,7 +199,8 @@ struct packet_sock { > #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,10 @@ struct packet_sock { > #endif > }; > >+#define PACKET_SKB_CB(__skb) ((struct tpacket_auxdata *)((__skb)->cb)) >+ >+extern int skb_checksum_setup(struct sk_buff *skb); >+ > #ifdef CONFIG_PACKET_MMAP > > static inline char *packet_lookup_frame(struct packet_sock *po, unsigned int position) >@@ -464,6 +469,7 @@ static int packet_rcv(struct sk_buff *sk > u8 * skb_head = skb->data; > int skb_len = skb->len; > unsigned snaplen; >+ struct tpacket_auxdata *aux; > > if (skb->pkt_type == PACKET_LOOPBACK) > goto drop; >@@ -527,6 +533,18 @@ static int packet_rcv(struct sk_buff *sk > 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; > >@@ -586,8 +604,6 @@ static int tpacket_rcv(struct sk_buff *s > else if (skb->pkt_type == PACKET_OUTGOING) { > /* Special case: outgoing packets have ll header at head */ > skb_pull(skb, skb->nh.raw - skb->data); >- if (skb->ip_summed == CHECKSUM_HW) >- status |= TP_STATUS_CSUMNOTREADY; > } > } > >@@ -601,6 +617,11 @@ static int tpacket_rcv(struct sk_buff *s > snaplen = res; > } > >+ 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 { >@@ -1124,6 +1145,11 @@ static int packet_recvmsg(struct kiocb * > 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. >@@ -1322,6 +1348,7 @@ static int > 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) >@@ -1374,6 +1401,18 @@ packet_setsockopt(struct socket *sock, i > 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; > } >@@ -1383,8 +1422,11 @@ static int packet_getsockopt(struct sock > 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; >@@ -1397,9 +1439,6 @@ static int packet_getsockopt(struct sock > > 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); >@@ -1408,16 +1447,23 @@ static int packet_getsockopt(struct sock > 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; > } >
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 223505
: 146320 |
146377