On Sat, Sep 28, 2013 at 11:15:46PM +0200, Alexander Aring wrote: > diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h > index 1b1b5db..05a2a37 100644 > --- a/net/ieee802154/6lowpan.h > +++ b/net/ieee802154/6lowpan.h > @@ -246,4 +246,32 @@ static inline bool lowpan_fetch_skb(struct sk_buff *skb, > return false; > } > > +/* Checks if ieee802154_addr are equals, > + * if yes return 1 otherwise 0 > + */ > +static inline int lowpan_equal_ieee802154_addr(struct ieee802154_addr *a, > + struct ieee802154_addr *b) > +{ > + if (a->pan_id != b->pan_id) > + return 0; > +
Don't know if it's right to check the pan_id here. Maybe somebody knows more about this? > + if (a->addr_type != b->addr_type) > + return 0; > + > + switch (a->addr_type) { > + case IEEE802154_ADDR_LONG: > + if (memcmp(a->hwaddr, b->hwaddr, IEEE802154_ADDR_LEN)) > + return 0; > + break; > + case IEEE802154_ADDR_SHORT: > + if (a->short_addr != b->short_addr) > + return 0; > + break; > + default: > + return 0; > + } > + > + return 1; > +} > + > #endif /* __6LOWPAN_H__ */ > -- > 1.8.4 > - Alex ------------------------------------------------------------------------------ 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=60133471&iu=/4140/ostg.clktrk _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel