Since we drop the skb copies, we don't need this function.

Signed-off-by: Alexander Aring <alex.ar...@gmail.com>
---
 net/ieee802154/6lowpan.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 42deee6..711f905 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -709,6 +709,9 @@ static int lowpan_give_skb_to_devices(struct sk_buff *skb)
        struct lowpan_dev_record *entry;
        int stat = NET_RX_SUCCESS;
 
+       skb->protocol = htons(ETH_P_IPV6);
+       skb->pkt_type = PACKET_HOST;
+
        rcu_read_lock();
        list_for_each_entry_rcu(entry, &lowpan_devices, list)
                if (lowpan_dev_info(entry->ldev)->real_dev == skb->dev) {
@@ -720,19 +723,6 @@ static int lowpan_give_skb_to_devices(struct sk_buff *skb)
        return stat;
 }
 
-static int lowpan_skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr)
-{
-       int stat = NET_RX_SUCCESS;
-
-       skb_push(skb, sizeof(struct ipv6hdr));
-       skb_copy_to_linear_data(skb, hdr, sizeof(struct ipv6hdr));
-
-       skb->protocol = htons(ETH_P_IPV6);
-       skb->pkt_type = PACKET_HOST;
-
-       return lowpan_give_skb_to_devices(skb);
-}
-
 static void lowpan_fragment_timer_expired(unsigned long entry_addr)
 {
        struct lowpan_fragment *entry = (struct lowpan_fragment *)entry_addr;
@@ -1049,7 +1039,11 @@ lowpan_process_data(struct sk_buff *skb)
 
        lowpan_raw_dump_table(__func__, "raw header dump",
                        (u8 *)&hdr, sizeof(hdr));
-       return lowpan_skb_deliver(skb, &hdr);
+
+       skb_push(skb, sizeof(struct ipv6hdr));
+       skb_copy_to_linear_data(skb, &hdr, sizeof(struct ipv6hdr));
+
+       return lowpan_give_skb_to_devices(skb);
 
 unlock_and_drop:
        spin_unlock_bh(&flist_lock);
-- 
1.8.4


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to