Date: Tue, 30 Jun 2009 13:38:14 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r195190 - projects/mesh11s/sys/net80211 Message-ID: <200906301338.n5UDcEPp082108@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rpaulo Date: Tue Jun 30 13:38:14 2009 New Revision: 195190 URL: http://svn.freebsd.org/changeset/base/195190 Log: Add a helper function to detect duplicates. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_hwmp.h Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jun 30 12:35:47 2009 (r195189) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jun 30 13:38:14 2009 (r195190) @@ -1165,6 +1165,26 @@ ieee80211_hwmp_find_txnode(struct ieee80 return ieee80211_find_txnode(vap, rt->rt_nexthop); } +int +ieee80211_hwmp_checkpseq(struct ieee80211vap *vap, + uint8_t source[IEEE80211_ADDR_LEN], uint32_t seq) +{ + struct ieee80211_hwmp_route *rt; + + rt = hwmp_rt_find(vap, source); + if (rt == NULL) { + rt = hwmp_rt_add(vap, source); + rt->rt_lastpseq = seq; + return 0; + } + if (rt->rt_lastpseq >= seq) + return 1; + else { + rt->rt_lastpseq = seq; + return 0; + } +} + static int hwmp_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.h Tue Jun 30 12:35:47 2009 (r195189) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.h Tue Jun 30 13:38:14 2009 (r195190) @@ -48,6 +48,8 @@ struct ieee80211_hwmp_route { uint8_t rt_prevhop[IEEE80211_ADDR_LEN]; uint32_t rt_lifetime; int rt_preqretries; + uint32_t rt_lastpseq; /* last mesh seq number + from this node */ }; #ifdef _KERNEL @@ -76,8 +78,10 @@ void ieee80211_hwmp_recv_action(struct i struct ieee80211_node *ieee80211_hwmp_discover(struct ieee80211vap *, uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); struct ieee80211_node * -ieee80211_hwmp_find_txnode(struct ieee80211vap *vap, + ieee80211_hwmp_find_txnode(struct ieee80211vap *vap, uint8_t dest[IEEE80211_ADDR_LEN]); +int ieee80211_hwmp_checkpseq(struct ieee80211vap *, + uint8_t [IEEE80211_ADDR_LEN], uint32_t); void ieee80211_hwmp_peerdown(struct ieee80211_node *); #endif /* _KERNEL */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906301338.n5UDcEPp082108>