Re: [Linux-zigbee-devel] [PATCH net-next] ieee802154: properly unshare skbs in ieee802154 *_rcv functions

2014-03-18 Thread David Miller
From: Phoebe Buckheister Date: Mon, 17 Mar 2014 16:41:28 +0100 > ieee802154 sockets do not properly unshare received skbs, which leads to > panics (at least) when they are used in conjunction with 6lowpan, so > run skb_share_check on received skbs. > 6lowpan also contains a use-after-free, which

Re: [Linux-zigbee-devel] [PATCH net-next] ieee802154: fix variable declaration and initializer

2014-03-18 Thread Eric Dumazet
On Tue, 2014-03-18 at 21:19 -0600, Jean Sacren wrote: > 2) Fix the initializer by deleting the double logical negation >operators as they don't serve any purpose. > ... > > static int phy_set_lbt(struct wpan_phy *phy, struct genl_info *info) > { > - u8 on = !!nla_get_u8(info->attrs[IE

Re: [Linux-zigbee-devel] [PATCH net-next] ieee802154: fix variable declaration and initializer

2014-03-18 Thread Joe Perches
On Tue, 2014-03-18 at 20:32 -0700, Eric Dumazet wrote: > On Tue, 2014-03-18 at 21:19 -0600, Jean Sacren wrote: > > > 2) Fix the initializer by deleting the double logical negation > >operators as they don't serve any purpose. > > > ... > > > > static int phy_set_lbt(struct wpan_phy *phy, s

Re: [Linux-zigbee-devel] [PATCH net-next] ieee802154: fix variable declaration and initializer

2014-03-18 Thread Eric Dumazet
On Tue, 2014-03-18 at 20:42 -0700, Joe Perches wrote: > On Tue, 2014-03-18 at 20:32 -0700, Eric Dumazet wrote: > > On Tue, 2014-03-18 at 21:19 -0600, Jean Sacren wrote: > > > > > 2) Fix the initializer by deleting the double logical negation > > >operators as they don't serve any purpose. > >

Re: [Linux-zigbee-devel] [PATCH net-next] ieee802154: fix variable declaration and initializer

2014-03-18 Thread Joe Perches
On Tue, 2014-03-18 at 22:56 -0600, Jean Sacren wrote: > Stating it is a "fix" is not a false statement at all. !! falsely > changes the value to be int TWICE for nothing! Are you still not > convinced? Not so fast Jean. There's no logic change. Changing the type to bool does exactly the same thi

Re: [Linux-zigbee-devel] [PATCH net-next] ieee802154: fix variable declaration and initializer

2014-03-18 Thread Joe Perches
On Tue, 2014-03-18 at 21:35 -0700, Eric Dumazet wrote: > On Tue, 2014-03-18 at 20:42 -0700, Joe Perches wrote: > > On Tue, 2014-03-18 at 20:32 -0700, Eric Dumazet wrote: > > > On Tue, 2014-03-18 at 21:19 -0600, Jean Sacren wrote: > > > > > > > 2) Fix the initializer by deleting the double logical

Re: [Linux-zigbee-devel] [PATCH net-next] ieee802154: fix variable declaration and initializer

2014-03-18 Thread Eric Dumazet
On Tue, 2014-03-18 at 22:56 -0600, Jean Sacren wrote: > Stating it is a "fix" is not a false statement at all. !! falsely > changes the value to be int TWICE for nothing! Are you still not > convinced? I think you are mistaken. X = !!(a) makes sure X is 0 or 1. Its a valid and useful construct.