Skip to content

Commit

Permalink
fix sk_buff handling
Browse files Browse the repository at this point in the history
  • Loading branch information
maage committed Sep 21, 2015
1 parent 745c774 commit 8de4eb1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions include/os/rt_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -881,15 +881,17 @@ void linux_pci_unmap_single(void *handle, ra_dma_addr_t dma_addr, size_t size, i
(RTPKT_TO_OSPKT(_pkt)->len) = (_len)

#define GET_OS_PKT_DATATAIL(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->tail)
#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len))
(skb_tail_pointer(RTPKT_TO_OSPKT(_pkt)))

#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
(skb_set_tail_pointer(RTPKT_TO_OSPKT(_pkt), \
(int)((_start) - GET_OS_PKT_DATAPTR(_pkt)) + (_len)))

#define GET_OS_PKT_HEAD(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->head)

#define GET_OS_PKT_END(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->end)
(skb_end_pointer(RTPKT_TO_OSPKT(_pkt)))

#define GET_OS_PKT_NETDEV(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->dev)
Expand Down
8 changes: 4 additions & 4 deletions os/linux/rt_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ PNDIS_PACKET duplicate_pkt(
MEM_DBG_PKT_ALLOC_INC(skb);

skb_reserve(skb, 2);
NdisMoveMemory(skb->tail, pHeader802_3, HdrLen);
NdisMoveMemory(GET_OS_PKT_DATATAIL(skb), pHeader802_3, HdrLen);
skb_put(skb, HdrLen);
NdisMoveMemory(skb->tail, pData, DataSize);
NdisMoveMemory(GET_OS_PKT_DATATAIL(skb), pData, DataSize);
skb_put(skb, DataSize);
skb->dev = pNetDev; /*get_netdev_from_bssid(pAd, FromWhichBSSID); */
pPacket = OSPKT_TO_RTPKT(skb);
Expand Down Expand Up @@ -648,7 +648,7 @@ PNDIS_PACKET ClonePacket(
pClonedPkt->dev = pRxPkt->dev;
pClonedPkt->data = pData;
pClonedPkt->len = DataSize;
pClonedPkt->tail = pClonedPkt->data + pClonedPkt->len;
SET_OS_PKT_DATATAIL(pClonedPkt, pClonedPkt->data, pClonedPkt->len);
ASSERT(DataSize < 1530);
}
return pClonedPkt;
Expand Down Expand Up @@ -693,7 +693,7 @@ void wlan_802_11_to_802_3_packet(
pOSPkt->dev = pNetDev;
pOSPkt->data = pData;
pOSPkt->len = DataSize;
pOSPkt->tail = pOSPkt->data + pOSPkt->len;
SET_OS_PKT_DATATAIL(pOSPkt, pOSPkt->data, pOSPkt->len);

/* copy 802.3 header */

Expand Down

0 comments on commit 8de4eb1

Please sign in to comment.