Martin, On Sat, Jul 19, 2014 at 08:17:40PM +0100, Martin Townsend wrote: > IPv6 packets sent via lowpan over iee802.15.4 with be at most 1280 octets. > > Signed-off-by: Martin Townsend <mtownsend1...@gmail.com> > --- > net/ieee802154/reassembly.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c > index b85bd3f..758377b 100644 > --- a/net/ieee802154/reassembly.c > +++ b/net/ieee802154/reassembly.c > @@ -529,7 +529,7 @@ static int __net_init lowpan_frags_init_net(struct net > *net) > ieee802154_lowpan->frags.high_thresh = IPV6_FRAG_HIGH_THRESH; > ieee802154_lowpan->frags.low_thresh = IPV6_FRAG_LOW_THRESH; > ieee802154_lowpan->frags.timeout = IPV6_FRAG_TIMEOUT; > - ieee802154_lowpan->max_dsize = 0xFFFF; > + ieee802154_lowpan->max_dsize = IPV6_MIN_MTU; > > inet_frags_init_net(&ieee802154_lowpan->frags); > > -- > 1.8.1.2 >
yes this is right. We should never accept IPv6 packets which are greater than 1280. If it's greater then we use IPv6 fragmentation, but this isn't our job to handle it. I let the ieee802154_lowpan->max_dsize configureable to handle with some stacks which are not so RFC complaint. Now, I think we should drop the sysfs entry there and print a warning about that we talking with a not RFC complaint stack and drop the packet. So: simple remove the sysfs entry and add something like this there: diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c index 6f1428c..2801c81 100644 --- a/net/ieee802154/reassembly.c +++ b/net/ieee802154/reassembly.c @@ -370,8 +370,10 @@ int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type) if (err < 0) goto err; - if (frag_info->d_size > ieee802154_lowpan->max_dsize) + if (frag_info->d_size > IPV6_MIN_MTU) { + netdev_warn(skb->dev, fooo); goto err; + } inet_frag_evictor(&ieee802154_lowpan->frags, &lowpan_frags, false); and please make a little note about where the changes are in the first line of commit msg, in your case something like: "6lowpan: reassembly: XXXXXX". - Alex ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel