On Sun, Oct 13, 2013 at 03:46:47PM +0200, Alexander Aring wrote: > This patch fixes the fragmentation of receiving 6lowpan packets. > The current fragmentation isn't rfc4944 compatible. > > Signed-off-by: Alexander Aring <alex.ar...@gmail.com> > --- > net/ieee802154/6lowpan.c | 268 > +++++++++++++++++++++++++++-------------------- > 1 file changed, 154 insertions(+), 114 deletions(-) > > diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c > index 4c2072d..6df928f 100644 > --- a/net/ieee802154/6lowpan.c > +++ b/net/ieee802154/6lowpan.c > @@ -402,7 +402,8 @@ static inline int lowpan_fetch_skb_u16(struct sk_buff > *skb, u16 *val) > } > > static int > -lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh) > +lowpan_uncompress_udp_header(struct sk_buff *skb, > + struct udphdr *uh, size_t udplen) > { > u8 tmp; > > @@ -456,7 +457,11 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct > udphdr *uh) > * here, we obtain the hint from the remaining size of the > * frame ... > +} > + > +static int lowpan_check_frag_complete(struct lowpan_fragment *frame) > +{ > + int ret = 0; > + > + if (frame->bytes_rcv != frame->length) > + return ret; > + > + list_del(&frame->list); > + del_timer_sync(&frame->timer); > + > + ret = lowpan_give_skb_to_devices(frame->skb); if (ret != NET_RX_SUCCESS) dev_kfree_skb(frame->skb);
jsut added here, because we didn't clean up the frame->skb on error. > + kfree(frame); > + return ret; > +} > + > static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev, > - struct packet_type *pt, struct net_device *orig_dev) > + struct packet_type *pt, struct net_device *orig_dev) > { > + int ret; > + struct lowpan_fragment *frame; > + u16 d_tag, d_size; ------------------------------------------------------------------------------ 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