svn commit: r193898 - projects/mesh11s/sys/net80211

Rui Paulo rpaulo at FreeBSD.org
Wed Jun 10 10:53:15 UTC 2009


Author: rpaulo
Date: Wed Jun 10 10:53:14 2009
New Revision: 193898
URL: http://svn.freebsd.org/changeset/base/193898

Log:
  Simplify code. No functional change.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/mesh11s/sys/net80211/ieee80211_hwmp.c

Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_hwmp.c	Wed Jun 10 10:51:38 2009	(r193897)
+++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c	Wed Jun 10 10:53:14 2009	(r193898)
@@ -872,7 +872,6 @@ ieee80211_hwmp_discover(struct ieee80211
 {
 	struct ieee80211_hwmp_state *hs = vap->iv_hwmp;
 	struct ieee80211_hwmp_fi *fi = NULL;
-	static const uint8_t invalidaddr[] = { 0, 0, 0, 0, 0, 0 };
 	struct ieee80211_meshpreq_ie preq;
 	int sendpreq = 0, unknowndst = 0;
 
@@ -887,12 +886,11 @@ ieee80211_hwmp_discover(struct ieee80211
 
 	mtx_lock(&hs->hs_lock);
 	TAILQ_FOREACH(fi, &hs->hs_head, fi_next) {
-		if (IEEE80211_ADDR_EQ(fi->fi_dest, dest)) {
-			if (IEEE80211_ADDR_EQ(fi->fi_nexthop, invalidaddr)) {
-				/* XXX check preq retries */
-				sendpreq = 1;
-				unknowndst = 1;
-			}
+		if (IEEE80211_ADDR_EQ(fi->fi_dest, dest) &&
+		    IEEE80211_ADDR_EQ(fi->fi_nexthop, invalidaddr)) {
+			/* XXX check preq retries */
+			sendpreq = 1;
+			unknowndst = 1;
 			break;
 		}
 	}
@@ -901,7 +899,7 @@ ieee80211_hwmp_discover(struct ieee80211
 	if (fi == NULL) {
 		fi = malloc(sizeof(struct ieee80211_hwmp_fi), M_80211_VAP,
 		    M_NOWAIT | M_ZERO);
-		memcpy(fi->fi_dest, dest, IEEE80211_ADDR_LEN);
+		IEEE80211_ADDR_COPY(fi->fi_dest, dest);
 		fi->fi_seq = ++hs->hs_seq;
 		fi->fi_metric = IEEE80211_MESHLMETRIC_INITIALVAL;
 		fi->fi_lifetime = ieee80211_hwmp_pathtimeout;
@@ -946,7 +944,6 @@ ieee80211_hwmp_discover(struct ieee80211
 #undef	PREQ_TADDR
 #undef	PREQ_TSEQ
 
-
 static int
 hwmp_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq)
 {
@@ -955,7 +952,7 @@ hwmp_ioctl_get80211(struct ieee80211vap 
 	struct ieee80211_hwmp_state *hs;
 	struct ieee80211_hwmp_fi *fi;
 	uint8_t *p;
-
+ 
 	if (vap->iv_opmode != IEEE80211_M_MBSS)
 		return EINVAL;
 	error = 0;


More information about the svn-src-projects mailing list