mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
[SK_BUFF]: Introduce skb_reset_transport_header(skb)
For the common, open coded 'skb->h.raw = skb->data' operation, so that we can later turn skb->h.raw into a offset, reducing the size of struct sk_buff in 64bit land while possibly keeping it as a pointer on 32bit. This one touches just the most simple cases: skb->h.raw = skb->data; skb->h.raw = {skb_push|[__]skb_pull}() The next ones will handle the slightly more "complex" cases. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0660e03f6b
commit
badff6d01a
49 changed files with 82 additions and 73 deletions
|
@ -507,7 +507,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb)
|
|||
*/
|
||||
skb_get(skb);
|
||||
set_arp_failure_handler(skb, arp_failure_discard);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
len = skb->len;
|
||||
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
||||
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
||||
|
@ -559,7 +559,7 @@ static int send_mpa_reject(struct iwch_ep *ep, const void *pdata, u8 plen)
|
|||
skb_get(skb);
|
||||
skb->priority = CPL_PRIORITY_DATA;
|
||||
set_arp_failure_handler(skb, arp_failure_discard);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
||||
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
||||
req->wr_lo = htonl(V_WR_TID(ep->hwtid));
|
||||
|
@ -610,7 +610,7 @@ static int send_mpa_reply(struct iwch_ep *ep, const void *pdata, u8 plen)
|
|||
*/
|
||||
skb_get(skb);
|
||||
set_arp_failure_handler(skb, arp_failure_discard);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
len = skb->len;
|
||||
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
||||
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
||||
|
|
|
@ -855,7 +855,7 @@ static void cops_rx(struct net_device *dev)
|
|||
|
||||
skb_reset_mac_header(skb); /* Point to entire packet. */
|
||||
skb_pull(skb,3);
|
||||
skb->h.raw = skb->data; /* Point to data (Skip header). */
|
||||
skb_reset_transport_header(skb); /* Point to data (Skip header). */
|
||||
|
||||
/* Update the counters. */
|
||||
lp->stats.rx_packets++;
|
||||
|
|
|
@ -776,7 +776,7 @@ static int sendup_buffer (struct net_device *dev)
|
|||
/* copy ddp(s,e)hdr + contents */
|
||||
memcpy(skb->data,(void*)ltdmabuf,len);
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
stats->rx_packets++;
|
||||
stats->rx_bytes+=skb->len;
|
||||
|
@ -923,7 +923,7 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
cbuf.laptype = skb->data[2];
|
||||
skb_pull(skb,3); /* skip past LLAP header */
|
||||
cbuf.length = skb->len; /* this is host order */
|
||||
skb->h.raw=skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
if(debug & DEBUG_UPPER) {
|
||||
printk("command ");
|
||||
|
|
|
@ -1622,7 +1622,7 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
|
|||
rq->offload_pkts++;
|
||||
skb_reset_mac_header(skb);
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
if (rq->polling) {
|
||||
rx_gather[gather_idx++] = skb;
|
||||
|
|
|
@ -265,9 +265,9 @@ static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb)
|
|||
|
||||
static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen)
|
||||
{
|
||||
skb->h.raw = skb_push(skb, headlen);
|
||||
memset(skb->h.raw, 0, headlen);
|
||||
return dccp_hdr(skb);
|
||||
skb_push(skb, headlen);
|
||||
skb_reset_transport_header(skb);
|
||||
return memset(skb->h.raw, 0, headlen);
|
||||
}
|
||||
|
||||
static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb)
|
||||
|
|
|
@ -957,6 +957,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
|
|||
skb->tail += len;
|
||||
}
|
||||
|
||||
static inline void skb_reset_transport_header(struct sk_buff *skb)
|
||||
{
|
||||
skb->h.raw = skb->data;
|
||||
}
|
||||
|
||||
static inline unsigned char *skb_network_header(const struct sk_buff *skb)
|
||||
{
|
||||
return skb->nh.raw;
|
||||
|
|
|
@ -119,7 +119,7 @@ static void __aarp_send_query(struct aarp_entry *a)
|
|||
/* Set up the buffer */
|
||||
skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb_put(skb, sizeof(*eah));
|
||||
skb->protocol = htons(ETH_P_ATALK);
|
||||
skb->dev = dev;
|
||||
|
@ -166,7 +166,7 @@ static void aarp_send_reply(struct net_device *dev, struct atalk_addr *us,
|
|||
/* Set up the buffer */
|
||||
skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb_put(skb, sizeof(*eah));
|
||||
skb->protocol = htons(ETH_P_ATALK);
|
||||
skb->dev = dev;
|
||||
|
@ -217,7 +217,7 @@ static void aarp_send_probe(struct net_device *dev, struct atalk_addr *us)
|
|||
/* Set up the buffer */
|
||||
skb_reserve(skb, dev->hard_header_len + aarp_dl->header_length);
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb_put(skb, sizeof(*eah));
|
||||
skb->protocol = htons(ETH_P_ATALK);
|
||||
skb->dev = dev;
|
||||
|
|
|
@ -1275,7 +1275,7 @@ static int handle_ip_over_ddp(struct sk_buff *skb)
|
|||
skb->protocol = htons(ETH_P_IP);
|
||||
skb_pull(skb, 13);
|
||||
skb->dev = dev;
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
stats = dev->priv;
|
||||
stats->rx_packets++;
|
||||
|
@ -1522,7 +1522,7 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||
/* Non routable, so force a drop if we slip up later */
|
||||
ddp->deh_len_hops = htons(skb->len + (DDP_MAXHOPS << 10));
|
||||
}
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
return atalk_rcv(skb, dev, pt, orig_dev);
|
||||
freeit:
|
||||
|
|
|
@ -1631,8 +1631,8 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||
if (!ax25_sk(sk)->pidincl)
|
||||
skb_pull(skb, 1); /* Remove PID */
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
copied = skb->len;
|
||||
skb_reset_transport_header(skb);
|
||||
copied = skb->len;
|
||||
|
||||
if (copied > size) {
|
||||
copied = size;
|
||||
|
|
|
@ -62,7 +62,7 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)
|
|||
|
||||
skbn->dev = ax25->ax25_dev->dev;
|
||||
skb_reset_network_header(skbn);
|
||||
skbn->h.raw = skbn->data;
|
||||
skb_reset_transport_header(skbn);
|
||||
|
||||
/* Copy data from the fragments */
|
||||
while ((skbo = skb_dequeue(&ax25->frag_queue)) != NULL) {
|
||||
|
@ -196,7 +196,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||
* Process the AX.25/LAPB frame.
|
||||
*/
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
|
||||
kfree_skb(skb);
|
||||
|
@ -246,7 +246,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||
switch (skb->data[1]) {
|
||||
case AX25_P_IP:
|
||||
skb_pull(skb,2); /* drop PID/CTRL */
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb_reset_network_header(skb);
|
||||
skb->dev = dev;
|
||||
skb->pkt_type = PACKET_HOST;
|
||||
|
@ -256,7 +256,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||
|
||||
case AX25_P_ARP:
|
||||
skb_pull(skb,2);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb_reset_network_header(skb);
|
||||
skb->dev = dev;
|
||||
skb->pkt_type = PACKET_HOST;
|
||||
|
|
|
@ -221,7 +221,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||
copied = len;
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
|
||||
|
||||
skb_free_datagram(sk, skb);
|
||||
|
|
|
@ -1074,11 +1074,11 @@ static void hci_add_acl_hdr(struct sk_buff *skb, __u16 handle, __u16 flags)
|
|||
struct hci_acl_hdr *hdr;
|
||||
int len = skb->len;
|
||||
|
||||
hdr = (struct hci_acl_hdr *) skb_push(skb, HCI_ACL_HDR_SIZE);
|
||||
skb_push(skb, HCI_ACL_HDR_SIZE);
|
||||
skb_reset_transport_header(skb);
|
||||
hdr = (struct hci_acl_hdr *)skb->h.raw;
|
||||
hdr->handle = cpu_to_le16(hci_handle_pack(handle, flags));
|
||||
hdr->dlen = cpu_to_le16(len);
|
||||
|
||||
skb->h.raw = (void *) hdr;
|
||||
}
|
||||
|
||||
int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
|
||||
|
@ -1143,7 +1143,8 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
|
|||
hdr.handle = cpu_to_le16(conn->handle);
|
||||
hdr.dlen = skb->len;
|
||||
|
||||
skb->h.raw = skb_push(skb, HCI_SCO_HDR_SIZE);
|
||||
skb_push(skb, HCI_SCO_HDR_SIZE);
|
||||
skb_reset_transport_header(skb);
|
||||
memcpy(skb->h.raw, &hdr, HCI_SCO_HDR_SIZE);
|
||||
|
||||
skb->dev = (void *) hdev;
|
||||
|
|
|
@ -375,7 +375,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||
copied = len;
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
|
||||
|
||||
hci_sock_cmsg(sk, msg, skb);
|
||||
|
|
|
@ -1773,7 +1773,7 @@ int netif_receive_skb(struct sk_buff *skb)
|
|||
__get_cpu_var(netdev_rx_stat).total++;
|
||||
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb->mac_len = skb->nh.raw - skb->mac.raw;
|
||||
|
||||
pt_prev = NULL;
|
||||
|
|
|
@ -362,7 +362,7 @@ static void arp_reply(struct sk_buff *skb)
|
|||
return;
|
||||
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
arp = arp_hdr(skb);
|
||||
|
||||
if ((arp->ar_hrd != htons(ARPHRD_ETHER) &&
|
||||
|
|
|
@ -725,7 +725,7 @@ static int dn_nsp_rx_packet(struct sk_buff *skb)
|
|||
if (!pskb_may_pull(skb, 2))
|
||||
goto free_out;
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
cb->nsp_flags = *ptr++;
|
||||
|
||||
if (decnet_debug_level & 2)
|
||||
|
|
|
@ -79,7 +79,7 @@ static void dn_nsp_send(struct sk_buff *skb)
|
|||
struct dst_entry *dst;
|
||||
struct flowi fl;
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
scp->stamp = jiffies;
|
||||
|
||||
dst = sk_dst_check(sk, 0);
|
||||
|
|
|
@ -504,7 +504,7 @@ static int dn_route_rx_long(struct sk_buff *skb)
|
|||
goto drop_it;
|
||||
|
||||
skb_pull(skb, 20);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
/* Destination info */
|
||||
ptr += 2;
|
||||
|
@ -542,7 +542,7 @@ static int dn_route_rx_short(struct sk_buff *skb)
|
|||
goto drop_it;
|
||||
|
||||
skb_pull(skb, 5);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
cb->dst = *(__le16 *)ptr;
|
||||
ptr += 2;
|
||||
|
|
|
@ -1120,7 +1120,8 @@ static int inet_gso_send_check(struct sk_buff *skb)
|
|||
if (unlikely(!pskb_may_pull(skb, ihl)))
|
||||
goto out;
|
||||
|
||||
skb->h.raw = __skb_pull(skb, ihl);
|
||||
__skb_pull(skb, ihl);
|
||||
skb_reset_transport_header(skb);
|
||||
iph = ip_hdr(skb);
|
||||
proto = iph->protocol & (MAX_INET_PROTOS - 1);
|
||||
err = -EPROTONOSUPPORT;
|
||||
|
@ -1163,7 +1164,8 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
|
|||
if (unlikely(!pskb_may_pull(skb, ihl)))
|
||||
goto out;
|
||||
|
||||
skb->h.raw = __skb_pull(skb, ihl);
|
||||
__skb_pull(skb, ihl);
|
||||
skb_reset_transport_header(skb);
|
||||
iph = ip_hdr(skb);
|
||||
id = ntohs(iph->id);
|
||||
proto = iph->protocol & (MAX_INET_PROTOS - 1);
|
||||
|
|
|
@ -182,7 +182,8 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
|
|||
}
|
||||
((struct iphdr*)work_buf)->protocol = ah->nexthdr;
|
||||
skb->nh.raw += ah_hlen;
|
||||
skb->h.raw = memcpy(skb_network_header(skb), work_buf, ihl);
|
||||
memcpy(skb_network_header(skb), work_buf, ihl);
|
||||
skb->h.raw = skb->nh.raw;
|
||||
__skb_pull(skb, ah_hlen + ihl);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -201,7 +201,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
|
|||
__skb_pull(skb, ip_hdrlen(skb));
|
||||
|
||||
/* Point into the IP datagram, just past the header. */
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
rcu_read_lock();
|
||||
{
|
||||
|
|
|
@ -500,7 +500,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
|
|||
* before previous one went down. */
|
||||
if (frag) {
|
||||
frag->ip_summed = CHECKSUM_NONE;
|
||||
frag->h.raw = frag->data;
|
||||
skb_reset_transport_header(frag);
|
||||
__skb_push(frag, hlen);
|
||||
skb_reset_network_header(frag);
|
||||
memcpy(skb_network_header(frag), iph, hlen);
|
||||
|
|
|
@ -563,7 +563,7 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert)
|
|||
*/
|
||||
skb_push(skb, sizeof(struct iphdr));
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
msg = (struct igmpmsg *)skb_network_header(skb);
|
||||
memcpy(msg, skb_network_header(pkt), sizeof(struct iphdr));
|
||||
msg->im_msgtype = IGMPMSG_WHOLEPKT;
|
||||
|
|
|
@ -1002,7 +1002,8 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
|
|||
* transport header to point to ESP. Keep UDP on the stack
|
||||
* for later.
|
||||
*/
|
||||
skb->h.raw = __skb_pull(skb, len);
|
||||
__skb_pull(skb, len);
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
/* modify the protocol (it's ESP!) */
|
||||
iph->protocol = IPPROTO_ESP;
|
||||
|
|
|
@ -52,7 +52,7 @@ static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb)
|
|||
skb->nh.raw = skb->h.raw;
|
||||
}
|
||||
ip_hdr(skb)->tot_len = htons(skb->len + ihl);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
|
|||
if (hdr->version != 6)
|
||||
goto err;
|
||||
|
||||
skb->h.raw = (u8 *)(hdr + 1);
|
||||
skb->h.raw = skb->nh.raw + sizeof(*hdr);
|
||||
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
|
||||
|
||||
pkt_len = ntohs(hdr->payload_len);
|
||||
|
|
|
@ -654,7 +654,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
|
|||
* before previous one went down. */
|
||||
if (frag) {
|
||||
frag->ip_summed = CHECKSUM_NONE;
|
||||
frag->h.raw = frag->data;
|
||||
skb_reset_transport_header(frag);
|
||||
fh = (struct frag_hdr*)__skb_push(frag, sizeof(struct frag_hdr));
|
||||
__skb_push(frag, hlen);
|
||||
skb_reset_network_header(frag);
|
||||
|
@ -747,8 +747,8 @@ slow_path:
|
|||
skb_reserve(frag, LL_RESERVED_SPACE(rt->u.dst.dev));
|
||||
skb_put(frag, len + hlen + sizeof(struct frag_hdr));
|
||||
skb_reset_network_header(frag);
|
||||
fh = (struct frag_hdr*)(frag->data + hlen);
|
||||
frag->h.raw = frag->data + hlen + sizeof(struct frag_hdr);
|
||||
fh = (struct frag_hdr *)(skb_network_header(frag) + hlen);
|
||||
frag->h.raw = frag->nh.raw + hlen + sizeof(struct frag_hdr);
|
||||
|
||||
/*
|
||||
* Charge the memory for the fragment to any owner
|
||||
|
@ -991,7 +991,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
|
|||
skb_reset_network_header(skb);
|
||||
|
||||
/* initialize protocol header pointer */
|
||||
skb->h.raw = skb->data + fragheaderlen;
|
||||
skb->h.raw = skb->nh.raw + fragheaderlen;
|
||||
|
||||
skb->ip_summed = CHECKSUM_PARTIAL;
|
||||
skb->csum = 0;
|
||||
|
|
|
@ -108,7 +108,7 @@ static int ipv6_gso_send_check(struct sk_buff *skb)
|
|||
rcu_read_lock();
|
||||
ops = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
|
||||
if (likely(ops && ops->gso_send_check)) {
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
err = ops->gso_send_check(skb);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
@ -144,7 +144,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
|
|||
rcu_read_lock();
|
||||
ops = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
|
||||
if (likely(ops && ops->gso_segment)) {
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
segs = ops->gso_segment(skb, features);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
|
|
@ -634,7 +634,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
|
|||
head->nh.raw += sizeof(struct frag_hdr);
|
||||
|
||||
skb_shinfo(head)->frag_list = head->next;
|
||||
head->h.raw = head->data;
|
||||
skb_reset_transport_header(head);
|
||||
skb_push(head, head->data - skb_network_header(head));
|
||||
atomic_sub(head->truesize, &nf_ct_frag6_mem);
|
||||
|
||||
|
|
|
@ -653,7 +653,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
|
|||
head->nh.raw += sizeof(struct frag_hdr);
|
||||
|
||||
skb_shinfo(head)->frag_list = head->next;
|
||||
head->h.raw = head->data;
|
||||
skb_reset_transport_header(head);
|
||||
skb_push(head, head->data - skb_network_header(head));
|
||||
atomic_sub(head->truesize, &ip6_frag_mem);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static int xfrm6_transport_input(struct xfrm_state *x, struct sk_buff *skb)
|
|||
}
|
||||
ipv6_hdr(skb)->payload_len = htons(skb->len + ihl -
|
||||
sizeof(struct ipv6hdr));
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ static struct sk_buff *ipxitf_adjust_skbuff(struct ipx_interface *intrfc,
|
|||
if (skb2) {
|
||||
skb_reserve(skb2, out_offset);
|
||||
skb_reset_network_header(skb2);
|
||||
skb2->h.raw = skb2->data;
|
||||
skb_reset_transport_header(skb2);
|
||||
skb_put(skb2, skb->len);
|
||||
memcpy(ipx_hdr(skb2), ipx_hdr(skb), skb->len);
|
||||
memcpy(skb2->cb, skb->cb, sizeof(skb->cb));
|
||||
|
|
|
@ -204,7 +204,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
|
|||
|
||||
/* Fill in IPX header */
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb_put(skb, sizeof(struct ipxhdr));
|
||||
ipx = ipx_hdr(skb);
|
||||
ipx->ipx_pktsize = htons(len + sizeof(struct ipxhdr));
|
||||
|
|
|
@ -1363,8 +1363,8 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,
|
|||
if (!skb)
|
||||
return err;
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
copied = skb->len;
|
||||
skb_reset_transport_header(skb);
|
||||
copied = skb->len;
|
||||
|
||||
if (copied > size) {
|
||||
IRDA_DEBUG(2, "%s(), Received truncated frame (%zd < %zd)!\n",
|
||||
|
|
|
@ -95,7 +95,7 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
|
|||
skb->dev = self->netdev;
|
||||
skb_reset_mac_header(skb);
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb->protocol = htons(ETH_P_IRDA);
|
||||
skb->priority = TC_PRIO_BESTEFFORT;
|
||||
|
||||
|
|
|
@ -953,7 +953,7 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)
|
|||
return;
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb_reset_network_header(skb);
|
||||
skb->len = msg->length;
|
||||
}
|
||||
|
|
|
@ -3667,7 +3667,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb,
|
|||
copied = len;
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
|
||||
if (err)
|
||||
goto out_free;
|
||||
|
|
|
@ -39,7 +39,7 @@ struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev)
|
|||
skb_reset_mac_header(skb);
|
||||
skb_reserve(skb, 50);
|
||||
skb_reset_network_header(skb);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
skb->protocol = htons(ETH_P_802_2);
|
||||
skb->dev = dev;
|
||||
if (sk != NULL)
|
||||
|
|
|
@ -1215,7 +1215,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
|
|||
copied = len;
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
|
||||
|
||||
if (msg->msg_name) {
|
||||
|
|
|
@ -878,7 +878,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
|
|||
if (frametype == NR_PROTOEXT &&
|
||||
circuit_index == NR_PROTO_IP && circuit_id == NR_PROTO_IP) {
|
||||
skb_pull(skb, NR_NETWORK_LEN + NR_TRANSPORT_LEN);
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
return nr_rx_ip(skb, dev);
|
||||
}
|
||||
|
@ -904,7 +904,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
|
|||
}
|
||||
|
||||
if (sk != NULL) {
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
if (frametype == NR_CONNACK && skb->len == 22)
|
||||
nr_sk(sk)->bpqext = 1;
|
||||
|
@ -1149,7 +1149,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||
return er;
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
copied = skb->len;
|
||||
|
||||
if (copied > size) {
|
||||
|
|
|
@ -51,7 +51,7 @@ static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
|
|||
if ((skbn = alloc_skb(nr->fraglen, GFP_ATOMIC)) == NULL)
|
||||
return 1;
|
||||
|
||||
skbn->h.raw = skbn->data;
|
||||
skb_reset_transport_header(skbn);
|
||||
|
||||
while ((skbo = skb_dequeue(&nr->frag_queue)) != NULL) {
|
||||
memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);
|
||||
|
|
|
@ -35,7 +35,7 @@ int nr_loopback_queue(struct sk_buff *skb)
|
|||
|
||||
if ((skbn = alloc_skb(skb->len, GFP_ATOMIC)) != NULL) {
|
||||
memcpy(skb_put(skbn, skb->len), skb->data, skb->len);
|
||||
skbn->h.raw = skbn->data;
|
||||
skb_reset_transport_header(skbn);
|
||||
|
||||
skb_queue_tail(&loopback_queue, skbn);
|
||||
|
||||
|
|
|
@ -1234,7 +1234,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||
*asmptr = qbit;
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
copied = skb->len;
|
||||
|
||||
if (copied > size) {
|
||||
|
|
|
@ -77,7 +77,7 @@ static void rose_loopback_timer(unsigned long param)
|
|||
dest = (rose_address *)(skb->data + 4);
|
||||
lci_o = 0xFFF - lci_i;
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
|
||||
sk = rose_find_socket(lci_o, &rose_loopback_neigh);
|
||||
if (sk) {
|
||||
|
|
|
@ -906,7 +906,7 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
|
|||
}
|
||||
}
|
||||
else {
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
res = rose_process_rx_frame(sk, skb);
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -1319,7 +1319,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
|
|||
unix_attach_fds(siocb->scm, skb);
|
||||
unix_get_secdata(siocb->scm, skb);
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
|
||||
if (err)
|
||||
goto out_free;
|
||||
|
|
|
@ -1210,8 +1210,7 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock,
|
|||
}
|
||||
}
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
|
||||
skb_reset_transport_header(skb);
|
||||
copied = skb->len;
|
||||
|
||||
if (copied > size) {
|
||||
|
|
|
@ -48,7 +48,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
|
|||
if ((sk = x25_find_socket(lci, nb)) != NULL) {
|
||||
int queued = 1;
|
||||
|
||||
skb->h.raw = skb->data;
|
||||
skb_reset_transport_header(skb);
|
||||
bh_lock_sock(sk);
|
||||
if (!sock_owned_by_user(sk)) {
|
||||
queued = x25_process_rx_frame(sk, skb);
|
||||
|
|
|
@ -53,7 +53,7 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
|
|||
|
||||
skb_queue_tail(&x25->fragment_queue, skb);
|
||||
|
||||
skbn->h.raw = skbn->data;
|
||||
skb_reset_transport_header(skbn);
|
||||
|
||||
skbo = skb_dequeue(&x25->fragment_queue);
|
||||
memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);
|
||||
|
|
Loading…
Reference in a new issue