Project

General

Profile

Bug #216 » 0002-batman-adv-DEBUG-track-CRC-changes.patch

Simon Wunderlich, 06/11/2015 06:48 PM

View differences:

bridge_loop_avoidance.c
222 222
	struct hlist_node *node_tmp;
223 223
	struct hlist_head *head;
224 224
	struct batadv_bla_claim *claim;
225
	struct batadv_priv *bat_priv;
225 226
	int i;
226 227
	spinlock_t *list_lock;	/* protects write access to the hash lists */
227 228

  
......
245 246
		spin_unlock_bh(list_lock);
246 247
	}
247 248

  
249
	bat_priv = backbone_gw->bat_priv;
248 250
	/* all claims gone, intialize CRC */
251
	batadv_dbg(BATADV_DBG_BLA, bat_priv,
252
		   "%s: initialize crc for %pM (was: %04x, change to: %04x)\n",
253
		   __func__, backbone_gw->orig, backbone_gw->crc, BATADV_BLA_CRC_INIT);
254

  
249 255
	spin_lock_bh(&backbone_gw->crc_lock);
250 256
	backbone_gw->crc = BATADV_BLA_CRC_INIT;
251 257
	spin_unlock_bh(&backbone_gw->crc_lock);
258

  
252 259
}
253 260

  
254 261
/**
......
607 614
			   "bla_add_claim(): changing ownership for %pM, vid %d\n",
608 615
			   mac, BATADV_PRINT_VID(vid));
609 616

  
617
		batadv_dbg(BATADV_DBG_BLA, bat_priv,
618
			   "%s: change crc for %pM (was: %04x, change to: %04x)\n",
619
			   __func__, claim->backbone_gw->orig, claim->backbone_gw->crc,
620
			   claim->backbone_gw->crc ^ crc16(0, claim->addr, ETH_ALEN));
621

  
610 622
		spin_lock_bh(&claim->backbone_gw->crc_lock);
611 623
		claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
612 624
		spin_unlock_bh(&claim->backbone_gw->crc_lock);
......
616 628
	atomic_inc(&backbone_gw->refcount);
617 629
	claim->backbone_gw = backbone_gw;
618 630

  
631
	batadv_dbg(BATADV_DBG_BLA, bat_priv,
632
		   "%s: change crc for %pM (was: %04x, change to: %04x)\n",
633
		   __func__, backbone_gw->orig, backbone_gw->crc,
634
		   backbone_gw->crc ^ crc16(0, claim->addr, ETH_ALEN));
635

  
619 636
	spin_lock_bh(&backbone_gw->crc_lock);
620 637
	backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
621 638
	spin_unlock_bh(&backbone_gw->crc_lock);
......
646 663
			   batadv_choose_claim, claim);
647 664
	batadv_claim_free_ref(claim); /* reference from the hash is gone */
648 665

  
666
	batadv_dbg(BATADV_DBG_BLA, bat_priv,
667
		   "%s: change crc for %pM (was: %04x, change to: %04x)\n",
668
		   __func__, claim->backbone_gw->orig, claim->backbone_gw->crc,
669
		   claim->backbone_gw->crc ^ crc16(0, claim->addr, ETH_ALEN));
670

  
649 671
	spin_lock_bh(&claim->backbone_gw->crc_lock);
650 672
	claim->backbone_gw->crc ^= crc16(0, claim->addr, ETH_ALEN);
651 673
	spin_unlock_bh(&claim->backbone_gw->crc_lock);
652
- 
(4-4/4)