On Fri, Jun 27, 2014 at 05:44:50PM +0530, Varka Bhadram wrote: > On 06/27/2014 03:49 PM, Alexander Aring wrote: > >+ > >+static void > >+at86rf230_rx(struct at86rf230_local *lp, > >+ const u8 *data, u8 len) > >+{ > >+ u8 lqi; > >+ struct sk_buff *skb; > >+ u8 rx_local_buf[AT86RF2XX_MAX_BUF]; > >+ > >+ memcpy(rx_local_buf, data, len); > >+ enable_irq(lp->spi->irq); > >+ > >+ /* read full frame buffer and invalid lqi value to lowest > >+ * indicator if frame was is in a corrupted state. > >+ */ > >+ if (len < 2 || len > IEEE802154_MTU) { > > if this condition occurs we need not be proceed further right ? > > But the skbs allocated , copied the data etc,,,, :-) >
You are right for the case if (len < 2) I need to rework this. But this is also crazy because we have only the checksum and then nothing. We should check if (len < 2 + MINIMUM_OF_MAC_HEADER), but we can do this when we add a generic ieee802154_alloc_skb function, which we need, here! I will change it to: if (len < 2) return; if (len > IEEE802154_MTU) { len = IEEE802154_MTU; .... } because this could be useful in sniffing device and hopeful the non monitor device (wpan device) filter this packet. - Alex ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel