From owner-svn-src-projects@FreeBSD.ORG Tue Jun 30 19:30:58 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB35D106564A; Tue, 30 Jun 2009 19:30:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2658FC18; Tue, 30 Jun 2009 19:30:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UJUwOK090216; Tue, 30 Jun 2009 19:30:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UJUwSE090213; Tue, 30 Jun 2009 19:30:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200906301930.n5UJUwSE090213@svn.freebsd.org> From: Rui Paulo Date: Tue, 30 Jun 2009 19:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195205 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 19:30:58 -0000 Author: rpaulo Date: Tue Jun 30 19:30:58 2009 New Revision: 195205 URL: http://svn.freebsd.org/changeset/base/195205 Log: Add mesh seq modulo 2^32 operations and use them. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jun 30 19:23:44 2009 (r195204) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jun 30 19:30:58 2009 (r195205) @@ -1174,7 +1174,7 @@ ieee80211_hwmp_checkpseq(struct ieee8021 rt->rt_lastpseq = seq; return 0; } - if (rt->rt_lastpseq >= seq) { + if (IEEE80211_MESH_SEQ_GEQ(rt->rt_lastpseq, seq)) { IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, vap->iv_bss, "seqno %u <= seqno %u", seq, rt->rt_lastpseq); Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Jun 30 19:23:44 2009 (r195204) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Tue Jun 30 19:30:58 2009 (r195205) @@ -392,6 +392,8 @@ struct ieee80211_mesh_proto { }; typedef uint32_t ieee80211_mesh_seq; +#define IEEE80211_MESH_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) +#define IEEE80211_MESH_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) struct ieee80211_mesh_state { int ms_idlen;