Re: [PATCH v2] mac80211: fix the RANN propagation issues
From: Marek Lindner <hidden>
Date: 2012-03-22 19:04:55
From: Marek Lindner <hidden>
Date: 2012-03-22 19:04:55
On Thursday, March 22, 2012 17:31:33 Javier Cardona wrote:
quoted
quoted
#define SN_GT(x, y) ((long) (y) - (long) (x) < 0) #define SN_LT(x, y) ((long) (x) - (long) (y) < 0)Your macros tried to address the problem but casting your sequence number to long also breaks the wrap around.Ah, thanks for your help. I guess we do need those macros after all but they'd have to be re-written as #define SN_LT(x, y) ((s32)(x - y) < 0) #define SN_GT(x, y) ((s32)(x - y) > 0)
No, you need unsigned values for this arithmetic to work (which is why long also fails).
And since this is just to handle wrap arounds, there is no need for the new SN_EQ that was suggested earlier.
Sounds reasonable to me. Regards, Marek