diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-03-05 20:17:54 +0200 | 
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-03-05 20:23:23 +0200 | 
| commit | 15569c58f8001d37bccaed7f99b6987315125036 (patch) | |
| tree | b81f9925182682ee2ad7fd969eb1de6f0072ccf8 | |
| parent | 38e385615ac3355f09e3f8df99a25a1c30af249a (diff) | |
*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
Just keep the code cool.
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
97 files changed, 1126 insertions, 1275 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 206680c403..664d62fd11 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -600,8 +600,9 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,  	/* Don't try to register if Zebra doesn't know of this instance. */  	if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: No zebra instance to talk to, not installing remote macip", -				   __PRETTY_FUNCTION__); +			zlog_debug( +				"%s: No zebra instance to talk to, not installing remote macip", +				__func__);  		return 0;  	}  	s = zclient->obuf; @@ -662,8 +663,9 @@ static int bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,  	/* Don't try to register if Zebra doesn't know of this instance. */  	if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: No zebra instance to talk to, not installing remote vtep", -				   __PRETTY_FUNCTION__); +			zlog_debug( +				"%s: No zebra instance to talk to, not installing remote vtep", +				__func__);  		return 0;  	} diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index b483d39bba..a44effaac5 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1450,7 +1450,7 @@ static int bgp_connect_success(struct peer *peer)  	if (bgp_getsockname(peer) < 0) {  		flog_err_sys(EC_LIB_SOCKET,  			     "%s: bgp_getsockname(): failed for peer %s, fd %d", -			     __FUNCTION__, peer->host, peer->fd); +			     __func__, peer->host, peer->fd);  		bgp_notify_send(  			peer, BGP_NOTIFY_FSM_ERR,  			BGP_NOTIFY_SUBCODE_UNSPECIFIC); /* internal error */ diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 55b44de6fb..dfa9ac9398 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -153,7 +153,7 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,  			if (BGP_DEBUG(nht, NHT)) {  				zlog_debug(  					"%s: Attempting to register with unknown AFI %d (not %d or %d)", -					__FUNCTION__, afi, AFI_IP, AFI_IP6); +					__func__, afi, AFI_IP, AFI_IP6);  			}  			return 0;  		} @@ -338,7 +338,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)  	if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) {  		if (BGP_DEBUG(nht, NHT))  			zlog_debug("%s[%s]: Failure to decode nexthop update", -				   __PRETTY_FUNCTION__, bgp->name_pretty); +				   __func__, bgp->name_pretty);  		return;  	} @@ -563,7 +563,7 @@ static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p)  		if (BGP_DEBUG(nht, NHT)) {  			zlog_debug(  				"%s: Attempting to make prefix with unknown AFI %d (not %d or %d)", -				__FUNCTION__, afi, AFI_IP, AFI_IP6); +				__func__, afi, AFI_IP, AFI_IP6);  		}  		break;  	} @@ -591,15 +591,17 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)  	/* Don't try to register if Zebra doesn't know of this instance. */  	if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bnc->bgp)) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: No zebra instance to talk to, not installing NHT entry", -				   __PRETTY_FUNCTION__); +			zlog_debug( +				"%s: No zebra instance to talk to, not installing NHT entry", +				__func__);  		return;  	}  	if (!bgp_zebra_num_connects()) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: We have not connected yet, cannot send nexthops", -				   __PRETTY_FUNCTION__); +			zlog_debug( +				"%s: We have not connected yet, cannot send nexthops", +				__func__);  	}  	p = &(bnc->node->p);  	if ((command == ZEBRA_NEXTHOP_REGISTER @@ -801,9 +803,10 @@ static void evaluate_paths(struct bgp_nexthop_cache *bnc)  		if (!CHECK_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED)) {  			if (BGP_DEBUG(nht, NHT)) -				zlog_debug("%s: Updating peer (%s(%s)) status with NHT", -					   __FUNCTION__, peer->host, -					   peer->bgp->name_pretty); +				zlog_debug( +					"%s: Updating peer (%s(%s)) status with NHT", +					__func__, peer->host, +					peer->bgp->name_pretty);  			bgp_fsm_event_update(peer, valid_nexthops);  			SET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);  		} @@ -882,7 +885,7 @@ void bgp_nht_register_enhe_capability_interfaces(struct peer *peer)  	if (!sockunion2hostprefix(&peer->su, &p)) {  		if (BGP_DEBUG(nht, NHT))  			zlog_debug("%s: Unable to convert prefix to sockunion", -				   __PRETTY_FUNCTION__); +				   __func__);  		return;  	} diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 906083f755..81bb45aa76 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -696,7 +696,7 @@ static int bgp_capability_hostname(struct peer *peer,  		flog_warn(  			EC_BGP_CAPABILITY_INVALID_DATA,  			"%s: Received malformed hostname capability from peer %s", -			__FUNCTION__, peer->host); +			__func__, peer->host);  		return -1;  	} @@ -720,7 +720,7 @@ static int bgp_capability_hostname(struct peer *peer,  		flog_warn(  			EC_BGP_CAPABILITY_INVALID_DATA,  			"%s: Received invalid domain name len (hostname capability) from peer %s", -			__FUNCTION__, peer->host); +			__func__, peer->host);  		return -1;  	} @@ -729,7 +729,7 @@ static int bgp_capability_hostname(struct peer *peer,  		flog_warn(  			EC_BGP_CAPABILITY_INVALID_DATA,  			"%s: Received runt domain name (hostname capability) from peer %s", -			__FUNCTION__, peer->host); +			__func__, peer->host);  		return -1;  	} diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 3132c8b866..0e251dced8 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -1348,7 +1348,7 @@ static int bgp_open_receive(struct peer *peer, bgp_size_t size)  	if (bgp_getsockname(peer) < 0) {  		flog_err_sys(EC_LIB_SOCKET,  			     "%s: bgp_getsockname() failed for peer: %s", -			     __FUNCTION__, peer->host); +			     __func__, peer->host);  		return BGP_Stop;  	} diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 996746bf82..c8e4ef1bb6 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2926,8 +2926,7 @@ static int bgp_maximum_prefix_restart_timer(struct thread *thread)  			peer->host);  	if ((peer_clear(peer, NULL) < 0) && bgp_debug_neighbor_events(peer)) -		zlog_debug("%s: %s peer_clear failed", -			   __PRETTY_FUNCTION__, peer->host); +		zlog_debug("%s: %s peer_clear failed", __func__, peer->host);  	return 0;  } @@ -3732,7 +3731,7 @@ int bgp_update(struct peer *peer, struct prefix *p, uint32_t addpath_id,  							  ->nexthop,  						  buf1, INET6_ADDRSTRLEN);  					zlog_debug("%s(%s): NH unresolved", -						   __FUNCTION__, buf1); +						   __func__, buf1);  				}  				bgp_path_info_unset_flag(rn, pi,  							 BGP_PATH_VALID); @@ -3880,8 +3879,8 @@ int bgp_update(struct peer *peer, struct prefix *p, uint32_t addpath_id,  				inet_ntop(AF_INET,  					  (const void *)&attr_new->nexthop,  					  buf1, INET6_ADDRSTRLEN); -				zlog_debug("%s(%s): NH unresolved", -					   __FUNCTION__, buf1); +				zlog_debug("%s(%s): NH unresolved", __func__, +					   buf1);  			}  			bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);  		} @@ -5040,7 +5039,7 @@ void bgp_static_update(struct bgp *bgp, struct prefix *p,  							  INET6_ADDRSTRLEN);  						zlog_debug(  							"%s(%s): Route not in table, not advertising", -							__FUNCTION__, buf1); +							__func__, buf1);  					}  					bgp_path_info_unset_flag(  						rn, pi, BGP_PATH_VALID); @@ -5089,7 +5088,7 @@ void bgp_static_update(struct bgp *bgp, struct prefix *p,  					  INET6_ADDRSTRLEN);  				zlog_debug(  					"%s(%s): Route not in table, not advertising", -					__FUNCTION__, buf1); +					__func__, buf1);  			}  			bgp_path_info_unset_flag(rn, new, BGP_PATH_VALID);  		} diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index bb718c355f..f3ab608492 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -72,8 +72,9 @@ static inline int bgp_install_info_to_zebra(struct bgp *bgp)  		return 0;  	if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) { -		zlog_debug("%s: No zebra instance to talk to, not installing information", -			   __PRETTY_FUNCTION__); +		zlog_debug( +			"%s: No zebra instance to talk to, not installing information", +			__func__);  		return 0;  	} @@ -1918,8 +1919,9 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni)  	/* Don't try to register if Zebra doesn't know of this instance. */  	if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: No zebra instance to talk to, cannot advertise subnet", -				   __PRETTY_FUNCTION__); +			zlog_debug( +				"%s: No zebra instance to talk to, cannot advertise subnet", +				__func__);  		return 0;  	} @@ -1968,8 +1970,9 @@ int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)  	/* Don't try to register if Zebra doesn't know of this instance. */  	if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: No zebra instance to talk to, not installing gw_macip", -				   __PRETTY_FUNCTION__); +			zlog_debug( +				"%s: No zebra instance to talk to, not installing gw_macip", +				__func__);  		return 0;  	} @@ -1996,8 +1999,9 @@ int bgp_zebra_vxlan_flood_control(struct bgp *bgp,  	/* Don't try to register if Zebra doesn't know of this instance. */  	if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: No zebra instance to talk to, not installing all vni", -				   __PRETTY_FUNCTION__); +			zlog_debug( +				"%s: No zebra instance to talk to, not installing all vni", +				__func__);  		return 0;  	} @@ -2092,7 +2096,7 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)  		if (!bgp_pbr && note != ZAPI_RULE_REMOVED) {  			if (BGP_DEBUG(zebra, ZEBRA))  				zlog_debug("%s: Fail to look BGP rule (%u)", -					   __PRETTY_FUNCTION__, unique); +					   __func__, unique);  			return 0;  		}  	} @@ -2100,8 +2104,7 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)  	switch (note) {  	case ZAPI_RULE_FAIL_INSTALL:  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received RULE_FAIL_INSTALL", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received RULE_FAIL_INSTALL", __func__);  		if (bgp_pbra) {  			bgp_pbra->installed = false;  			bgp_pbra->install_in_progress = false; @@ -2128,14 +2131,12 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)  					   bgp_pbr);  		}  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received RULE_INSTALLED", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received RULE_INSTALLED", __func__);  		break;  	case ZAPI_RULE_FAIL_REMOVE:  	case ZAPI_RULE_REMOVED:  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received RULE REMOVED", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received RULE REMOVED", __func__);  		break;  	} @@ -2157,15 +2158,14 @@ static int ipset_notify_owner(ZAPI_CALLBACK_ARGS)  	if (!bgp_pbim) {  		if (BGP_DEBUG(zebra, ZEBRA))  			zlog_debug("%s: Fail to look BGP match ( %u, ID %u)", -				   __PRETTY_FUNCTION__, note, unique); +				   __func__, note, unique);  		return 0;  	}  	switch (note) {  	case ZAPI_IPSET_FAIL_INSTALL:  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received IPSET_FAIL_INSTALL", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received IPSET_FAIL_INSTALL", __func__);  		bgp_pbim->installed = false;  		bgp_pbim->install_in_progress = false;  		break; @@ -2173,14 +2173,12 @@ static int ipset_notify_owner(ZAPI_CALLBACK_ARGS)  		bgp_pbim->installed = true;  		bgp_pbim->install_in_progress = false;  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received IPSET_INSTALLED", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received IPSET_INSTALLED", __func__);  		break;  	case ZAPI_IPSET_FAIL_REMOVE:  	case ZAPI_IPSET_REMOVED:  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received IPSET REMOVED", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received IPSET REMOVED", __func__);  		break;  	} @@ -2205,8 +2203,9 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)  						     unique);  	if (!bgp_pbime) {  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Fail to look BGP match entry (%u, ID %u)", -				   __PRETTY_FUNCTION__, note, unique); +			zlog_debug( +				"%s: Fail to look BGP match entry (%u, ID %u)", +				__func__, note, unique);  		return 0;  	} @@ -2214,7 +2213,7 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)  	case ZAPI_IPSET_ENTRY_FAIL_INSTALL:  		if (BGP_DEBUG(zebra, ZEBRA))  			zlog_debug("%s: Received IPSET_ENTRY_FAIL_INSTALL", -				   __PRETTY_FUNCTION__); +				   __func__);  		bgp_pbime->installed = false;  		bgp_pbime->install_in_progress = false;  		break; @@ -2227,7 +2226,7 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)  		bgp_pbime->install_in_progress = false;  		if (BGP_DEBUG(zebra, ZEBRA))  			zlog_debug("%s: Received IPSET_ENTRY_INSTALLED", -				   __PRETTY_FUNCTION__); +				   __func__);  		/* link bgp_path_info to bpme */  		path = (struct bgp_path_info *)bgp_pbime->path;  		extra = bgp_path_info_extra_get(path); @@ -2238,7 +2237,7 @@ static int ipset_entry_notify_owner(ZAPI_CALLBACK_ARGS)  	case ZAPI_IPSET_ENTRY_REMOVED:  		if (BGP_DEBUG(zebra, ZEBRA))  			zlog_debug("%s: Received IPSET_ENTRY_REMOVED", -				   __PRETTY_FUNCTION__); +				   __func__);  		break;  	}  	return 0; @@ -2259,14 +2258,14 @@ static int iptable_notify_owner(ZAPI_CALLBACK_ARGS)  	if (!bgpm) {  		if (BGP_DEBUG(zebra, ZEBRA))  			zlog_debug("%s: Fail to look BGP iptable (%u %u)", -				   __PRETTY_FUNCTION__, note, unique); +				   __func__, note, unique);  		return 0;  	}  	switch (note) {  	case ZAPI_IPTABLE_FAIL_INSTALL:  		if (BGP_DEBUG(zebra, ZEBRA))  			zlog_debug("%s: Received IPTABLE_FAIL_INSTALL", -				   __PRETTY_FUNCTION__); +				   __func__);  		bgpm->installed_in_iptable = false;  		bgpm->install_iptable_in_progress = false;  		break; @@ -2274,15 +2273,13 @@ static int iptable_notify_owner(ZAPI_CALLBACK_ARGS)  		bgpm->installed_in_iptable = true;  		bgpm->install_iptable_in_progress = false;  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received IPTABLE_INSTALLED", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received IPTABLE_INSTALLED", __func__);  		bgpm->action->refcnt++;  		break;  	case ZAPI_IPTABLE_FAIL_REMOVE:  	case ZAPI_IPTABLE_REMOVED:  		if (BGP_DEBUG(zebra, ZEBRA)) -			zlog_debug("%s: Received IPTABLE REMOVED", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Received IPTABLE REMOVED", __func__);  		break;  	}  	return 0; @@ -2786,12 +2783,10 @@ void bgp_send_pbr_rule_action(struct bgp_pbr_action *pbra,  		return;  	if (BGP_DEBUG(zebra, ZEBRA)) {  		if (pbr) -			zlog_debug("%s: table %d (ip rule) %d", -				   __PRETTY_FUNCTION__, +			zlog_debug("%s: table %d (ip rule) %d", __func__,  				   pbra->table_id, install);  		else -			zlog_debug("%s: table %d fwmark %d %d", -				   __PRETTY_FUNCTION__, +			zlog_debug("%s: table %d fwmark %d %d", __func__,  				   pbra->table_id, pbra->fwmark, install);  	}  	s = zclient->obuf; @@ -2820,10 +2815,9 @@ void bgp_send_pbr_ipset_match(struct bgp_pbr_match *pbrim, bool install)  	if (pbrim->install_in_progress)  		return;  	if (BGP_DEBUG(zebra, ZEBRA)) -		zlog_debug("%s: name %s type %d %d, ID %u", -			   __PRETTY_FUNCTION__, -			   pbrim->ipset_name, pbrim->type, -			   install, pbrim->unique); +		zlog_debug("%s: name %s type %d %d, ID %u", __func__, +			   pbrim->ipset_name, pbrim->type, install, +			   pbrim->unique);  	s = zclient->obuf;  	stream_reset(s); @@ -2849,9 +2843,9 @@ void bgp_send_pbr_ipset_entry_match(struct bgp_pbr_match_entry *pbrime,  	if (pbrime->install_in_progress)  		return;  	if (BGP_DEBUG(zebra, ZEBRA)) -		zlog_debug("%s: name %s %d %d, ID %u", __PRETTY_FUNCTION__, -			   pbrime->backpointer->ipset_name, -			   pbrime->unique, install, pbrime->unique); +		zlog_debug("%s: name %s %d %d, ID %u", __func__, +			   pbrime->backpointer->ipset_name, pbrime->unique, +			   install, pbrime->unique);  	s = zclient->obuf;  	stream_reset(s); @@ -2916,9 +2910,8 @@ void bgp_send_pbr_iptable(struct bgp_pbr_action *pba,  	if (pbm->install_iptable_in_progress)  		return;  	if (BGP_DEBUG(zebra, ZEBRA)) -		zlog_debug("%s: name %s type %d mark %d %d, ID %u", -			   __PRETTY_FUNCTION__, pbm->ipset_name, -			   pbm->type, pba->fwmark, install, +		zlog_debug("%s: name %s type %d mark %d %d, ID %u", __func__, +			   pbm->ipset_name, pbm->type, pba->fwmark, install,  			   pbm->unique2);  	s = zclient->obuf;  	stream_reset(s); diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index f28e557572..006306b260 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3228,7 +3228,7 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,  	if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {  		if (BGP_DEBUG(zebra, ZEBRA))  			zlog_debug("%s: Registering BGP instance %s to zebra", -				   __PRETTY_FUNCTION__, name); +				   __func__, name);  		bgp_zebra_instance_register(bgp);  	} diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c index 6367ef58ab..48e9a18e5a 100644 --- a/eigrpd/eigrp_packet.c +++ b/eigrpd/eigrp_packet.c @@ -351,13 +351,13 @@ int eigrp_write(struct thread *thread)  	ep = eigrp_fifo_next(ei->obuf);  	if (!ep) {  		flog_err(EC_LIB_DEVELOPMENT, -			 "%s: Interface %s no packet on queue?", -			 __PRETTY_FUNCTION__, ei->ifp->name); +			 "%s: Interface %s no packet on queue?", __func__, +			 ei->ifp->name);  		goto out;  	}  	if (ep->length < EIGRP_HEADER_LEN) {  		flog_err(EC_EIGRP_PACKET, "%s: Packet just has a header?", -			 __PRETTY_FUNCTION__); +			 __func__);  		eigrp_header_dump((struct eigrp_header *)ep->s->data);  		eigrp_packet_delete(ei);  		goto out; @@ -1205,7 +1205,7 @@ uint16_t eigrp_add_internalTLV_to_stream(struct stream *s,  		break;  	default:  		flog_err(EC_LIB_DEVELOPMENT, "%s: Unexpected prefix length: %d", -			 __PRETTY_FUNCTION__, pe->destination->prefixlen); +			 __func__, pe->destination->prefixlen);  		return 0;  	}  	stream_putl(s, 0x00000000); diff --git a/eigrpd/eigrp_reply.c b/eigrpd/eigrp_reply.c index ccf0496736..79405efbbf 100644 --- a/eigrpd/eigrp_reply.c +++ b/eigrpd/eigrp_reply.c @@ -173,7 +173,7 @@ void eigrp_reply_receive(struct eigrp *eigrp, struct ip *iph,  			flog_err(  				EC_EIGRP_PACKET,  				"%s: Received prefix %s which we do not know about", -				__PRETTY_FUNCTION__, +				__func__,  				prefix2str(&dest_addr, buf, sizeof(buf)));  			eigrp_IPv4_InternalTLV_free(tlv);  			continue; diff --git a/eigrpd/eigrp_topology.c b/eigrpd/eigrp_topology.c index 56dbe3d85e..7676af15f2 100644 --- a/eigrpd/eigrp_topology.c +++ b/eigrpd/eigrp_topology.c @@ -138,7 +138,7 @@ void eigrp_prefix_entry_add(struct route_table *topology,  			zlog_debug(  				"%s: %s Should we have found this entry in the topo table?", -				__PRETTY_FUNCTION__, +				__func__,  				prefix2str(pe->destination, buf, sizeof(buf)));  		}  		route_unlock_node(rn); @@ -402,7 +402,7 @@ eigrp_topology_update_distance(struct eigrp_fsm_action_message *msg)  		break;  	default:  		flog_err(EC_LIB_DEVELOPMENT, "%s: Please implement handler", -			 __PRETTY_FUNCTION__); +			 __func__);  		break;  	}  distance_done: @@ -136,7 +136,7 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info,  		if (bfd_debug)  			zlog_debug(  				"%s: Suppressing BFD peer reg/dereg messages", -				__FUNCTION__); +				__func__);  		return;  	} @@ -146,7 +146,7 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info,  			zlog_debug(  				"%s: Can't send BFD peer register, Zebra client not "  				"established", -				__FUNCTION__); +				__func__);  		return;  	} @@ -454,7 +454,7 @@ void bfd_client_sendmsg(struct zclient *zclient, int command,  			zlog_debug(  				"%s: Can't send BFD client register, Zebra client not "  				"established", -				__FUNCTION__); +				__func__);  		return;  	} diff --git a/lib/ptm_lib.c b/lib/ptm_lib.c index 54f027deeb..b66ae221cf 100644 --- a/lib/ptm_lib.c +++ b/lib/ptm_lib.c @@ -143,7 +143,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key,  	csv_record_t *mh_rec, *rec;  	if (!p_ctxt) { -		ERRLOG("%s: no context \n", __FUNCTION__); +		ERRLOG("%s: no context \n", __func__);  		return -1;  	} @@ -154,7 +154,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key,  	/* append to the hdr record */  	rec = csv_append_record(csv, rec, 1, key);  	if (!rec) { -		ERRLOG("%s: Could not append key \n", __FUNCTION__); +		ERRLOG("%s: Could not append key \n", __func__);  		return -1;  	} @@ -162,7 +162,7 @@ int ptm_lib_append_msg(ptm_lib_handle_t *hdl, void *ctxt, const char *key,  	/* append to the data record */  	rec = csv_append_record(csv, rec, 1, val);  	if (!rec) { -		ERRLOG("%s: Could not append val \n", __FUNCTION__); +		ERRLOG("%s: Could not append val \n", __func__);  		return -1;  	} @@ -186,7 +186,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt,  	csv = csv_init(NULL, NULL, PTMLIB_MSG_SZ);  	if (!csv) { -		ERRLOG("%s: Could not allocate csv \n", __FUNCTION__); +		ERRLOG("%s: Could not allocate csv \n", __func__);  		return -1;  	} @@ -194,7 +194,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt,  				     cmd_id, hdl->client_name);  	if (!rec) { -		ERRLOG("%s: Could not allocate record \n", __FUNCTION__); +		ERRLOG("%s: Could not allocate record \n", __func__);  		csv_clean(csv);  		csv_free(csv);  		return -1; @@ -202,7 +202,7 @@ int ptm_lib_init_msg(ptm_lib_handle_t *hdl, int cmd_id, int type, void *in_ctxt,  	p_ctxt = calloc(1, sizeof(*p_ctxt));  	if (!p_ctxt) { -		ERRLOG("%s: Could not allocate context \n", __FUNCTION__); +		ERRLOG("%s: Could not allocate context \n", __func__);  		csv_clean(csv);  		csv_free(csv);  		return -1; @@ -234,7 +234,7 @@ int ptm_lib_cleanup_msg(ptm_lib_handle_t *hdl, void *ctxt)  	csv_t *csv;  	if (!p_ctxt) { -		ERRLOG("%s: no context \n", __FUNCTION__); +		ERRLOG("%s: no context \n", __func__);  		return -1;  	} @@ -254,7 +254,7 @@ int ptm_lib_complete_msg(ptm_lib_handle_t *hdl, void *ctxt, char *buf, int *len)  	csv_record_t *rec;  	if (!p_ctxt) { -		ERRLOG("%s: no context \n", __FUNCTION__); +		ERRLOG("%s: no context \n", __func__);  		return -1;  	} @@ -268,7 +268,7 @@ int ptm_lib_complete_msg(ptm_lib_handle_t *hdl, void *ctxt, char *buf, int *len)  	/* parse csv contents into string */  	if (buf && len) {  		if (csv_serialize(csv, buf, *len)) { -			ERRLOG("%s: cannot serialize\n", __FUNCTION__); +			ERRLOG("%s: cannot serialize\n", __func__);  			return -1;  		}  		*len = csvlen(csv); @@ -425,8 +425,7 @@ int ptm_lib_process_msg(ptm_lib_handle_t *hdl, int fd, char *inbuf, int inlen,  		csv_decode(csv, inbuf);  		p_ctxt = calloc(1, sizeof(*p_ctxt));  		if (!p_ctxt) { -			ERRLOG("%s: Could not allocate context \n", -			       __FUNCTION__); +			ERRLOG("%s: Could not allocate context \n", __func__);  			csv_clean(csv);  			csv_free(csv);  			return -1; diff --git a/lib/routemap.c b/lib/routemap.c index f3860924dd..e2baa36f24 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2684,8 +2684,7 @@ static void route_map_print_dependency(struct hash_bucket *bucket, void *data)  	char *rmap_name = dep_data->rname;  	char *dep_name = data; -	zlog_debug("%s: Dependency for %s: %s", __FUNCTION__, dep_name, -		   rmap_name); +	zlog_debug("%s: Dependency for %s: %s", __func__, dep_name, rmap_name);  }  static int route_map_dep_update(struct hash *dephash, const char *dep_name, @@ -493,8 +493,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),  	/* initialise NS, in case VRF backend if NETNS */  	ns_init();  	if (debug_vrf) -		zlog_debug("%s: Initializing VRF subsystem", -			   __PRETTY_FUNCTION__); +		zlog_debug("%s: Initializing VRF subsystem", __func__);  	vrf_master.vrf_new_hook = create;  	vrf_master.vrf_enable_hook = enable; @@ -535,8 +534,7 @@ void vrf_terminate(void)  	struct vrf *vrf;  	if (debug_vrf) -		zlog_debug("%s: Shutting down vrf subsystem", -			   __PRETTY_FUNCTION__); +		zlog_debug("%s: Shutting down vrf subsystem", __func__);  	while (!RB_EMPTY(vrf_id_head, &vrfs_by_id)) {  		vrf = RB_ROOT(vrf_id_head, &vrfs_by_id); diff --git a/lib/wheel.c b/lib/wheel.c index 8e479c931b..214e5e8167 100644 --- a/lib/wheel.c +++ b/lib/wheel.c @@ -146,8 +146,8 @@ int wheel_add_item(struct timer_wheel *wheel, void *item)  	slot = (*wheel->slot_key)(item);  	if (debug_timer_wheel) -		zlog_debug("%s: Inserting %p: %lld %lld", __PRETTY_FUNCTION__, -			   item, slot, slot % wheel->slots); +		zlog_debug("%s: Inserting %p: %lld %lld", __func__, item, slot, +			   slot % wheel->slots);  	listnode_add(wheel->wheel_slot_lists[slot % wheel->slots], item);  	return 0; @@ -160,8 +160,8 @@ int wheel_remove_item(struct timer_wheel *wheel, void *item)  	slot = (*wheel->slot_key)(item);  	if (debug_timer_wheel) -		zlog_debug("%s: Removing %p: %lld %lld", __PRETTY_FUNCTION__, -			   item, slot, slot % wheel->slots); +		zlog_debug("%s: Removing %p: %lld %lld", __func__, item, slot, +			   slot % wheel->slots);  	listnode_delete(wheel->wheel_slot_lists[slot % wheel->slots], item);  	return 0; diff --git a/lib/zclient.c b/lib/zclient.c index b0d2ea43a2..ec193035f5 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -236,9 +236,8 @@ int zclient_socket_connect(struct zclient *zclient)  	ret = connect(sock, (struct sockaddr *)&zclient_addr, zclient_addr_len);  	if (ret < 0) {  		if (zclient_debug) -			zlog_debug("%s connect failure: %d(%s)", -				   __PRETTY_FUNCTION__, errno, -				   safe_strerror(errno)); +			zlog_debug("%s connect failure: %d(%s)", __func__, +				   errno, safe_strerror(errno));  		close(sock);  		return -1;  	} @@ -958,7 +957,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)  	if (api->type >= ZEBRA_ROUTE_MAX) {  		flog_err(EC_LIB_ZAPI_ENCODE,  			 "%s: Specified route type (%u) is not a legal value\n", -			 __PRETTY_FUNCTION__, api->type); +			 __func__, api->type);  		return -1;  	}  	stream_putc(s, api->type); @@ -970,7 +969,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)  	if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) {  		flog_err(EC_LIB_ZAPI_ENCODE,  			 "%s: Specified route SAFI (%u) is not a legal value\n", -			 __PRETTY_FUNCTION__, api->safi); +			 __func__, api->safi);  		return -1;  	}  	stream_putc(s, api->safi); @@ -1122,7 +1121,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)  	if (api->type >= ZEBRA_ROUTE_MAX) {  		flog_err(EC_LIB_ZAPI_ENCODE,  			 "%s: Specified route type: %d is not a legal value\n", -			 __PRETTY_FUNCTION__, api->type); +			 __func__, api->type);  		return -1;  	} @@ -1133,7 +1132,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)  	if (api->safi < SAFI_UNICAST || api->safi >= SAFI_MAX) {  		flog_err(EC_LIB_ZAPI_ENCODE,  			 "%s: Specified route SAFI (%u) is not a legal value\n", -			 __PRETTY_FUNCTION__, api->safi); +			 __func__, api->safi);  		return -1;  	} @@ -1146,7 +1145,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)  			flog_err(  				EC_LIB_ZAPI_ENCODE,  				"%s: V4 prefixlen is %d which should not be more than 32", -				__PRETTY_FUNCTION__, api->prefix.prefixlen); +				__func__, api->prefix.prefixlen);  			return -1;  		}  		break; @@ -1155,14 +1154,14 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)  			flog_err(  				EC_LIB_ZAPI_ENCODE,  				"%s: v6 prefixlen is %d which should not be more than 128", -				__PRETTY_FUNCTION__, api->prefix.prefixlen); +				__func__, api->prefix.prefixlen);  			return -1;  		}  		break;  	default:  		flog_err(EC_LIB_ZAPI_ENCODE, -			 "%s: Specified family %d is not v4 or v6", -			 __PRETTY_FUNCTION__, api->prefix.family); +			 "%s: Specified family %d is not v4 or v6", __func__, +			 api->prefix.family);  		return -1;  	}  	STREAM_GET(&api->prefix.u.prefix, s, PSIZE(api->prefix.prefixlen)); @@ -1174,7 +1173,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)  			flog_err(  				EC_LIB_ZAPI_ENCODE,  				"%s: SRC Prefix prefixlen received: %d is too large", -				__PRETTY_FUNCTION__, api->src_prefix.prefixlen); +				__func__, api->src_prefix.prefixlen);  			return -1;  		}  		STREAM_GET(&api->src_prefix.prefix, s, @@ -1185,7 +1184,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)  			flog_err(  				EC_LIB_ZAPI_ENCODE,  				"%s: SRC prefix specified in some manner that makes no sense", -				__PRETTY_FUNCTION__); +				__func__);  			return -1;  		}  	} @@ -1309,8 +1308,7 @@ bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno,  	STREAM_GETL(s, ifi);  	if (zclient_debug) -		zlog_debug("%s: %u %u %u %u", __PRETTY_FUNCTION__, seq, prio, -			   uni, ifi); +		zlog_debug("%s: %u %u %u %u", __func__, seq, prio, uni, ifi);  	*seqno = seq;  	*priority = prio;  	*unique = uni; @@ -1332,7 +1330,7 @@ bool zapi_ipset_notify_decode(struct stream *s, uint32_t *unique,  	STREAM_GETL(s, uni);  	if (zclient_debug) -		zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni); +		zlog_debug("%s: %u", __func__, uni);  	*unique = uni;  	return true; @@ -1354,7 +1352,7 @@ bool zapi_ipset_entry_notify_decode(struct stream *s, uint32_t *unique,  	STREAM_GET(ipset_name, s, ZEBRA_IPSET_NAME_SIZE);  	if (zclient_debug) -		zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni); +		zlog_debug("%s: %u", __func__, uni);  	*unique = uni;  	return true; @@ -1374,7 +1372,7 @@ bool zapi_iptable_notify_decode(struct stream *s,  	STREAM_GETL(s, uni);  	if (zclient_debug) -		zlog_debug("%s: %u", __PRETTY_FUNCTION__, uni); +		zlog_debug("%s: %u", __func__, uni);  	*unique = uni;  	return true; @@ -2664,8 +2662,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl)  			if (zl->route.prefix.prefixlen > IPV4_MAX_BITLEN) {  				zlog_debug(  					"%s: Specified prefix length %d is greater than a v4 address can support", -					__PRETTY_FUNCTION__, -					zl->route.prefix.prefixlen); +					__func__, zl->route.prefix.prefixlen);  				return -1;  			}  			STREAM_GET(&zl->route.prefix.u.prefix4.s_addr, s, @@ -2675,8 +2672,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl)  			if (zl->route.prefix.prefixlen > IPV6_MAX_BITLEN) {  				zlog_debug(  					"%s: Specified prefix length %d is greater than a v6 address can support", -					__PRETTY_FUNCTION__, -					zl->route.prefix.prefixlen); +					__func__, zl->route.prefix.prefixlen);  				return -1;  			}  			STREAM_GET(&zl->route.prefix.u.prefix6, s, psize); @@ -2684,7 +2680,7 @@ int zapi_labels_decode(struct stream *s, struct zapi_labels *zl)  		default:  			flog_err(EC_LIB_ZAPI_ENCODE,  				 "%s: Specified family %u is not v4 or v6", -				 __PRETTY_FUNCTION__, zl->route.prefix.family); +				 __func__, zl->route.prefix.family);  			return -1;  		} diff --git a/nhrpd/nhrp_event.c b/nhrpd/nhrp_event.c index 9301c2d515..40efeb5795 100644 --- a/nhrpd/nhrp_event.c +++ b/nhrpd/nhrp_event.c @@ -200,7 +200,7 @@ static int evmgr_reconnect(struct thread *t)  	fd = sock_open_unix(nhrp_event_socket_path);  	if (fd < 0) {  		zlog_warn("%s: failure connecting nhrp-event socket: %s", -			  __PRETTY_FUNCTION__, strerror(errno)); +			  __func__, strerror(errno));  		zbufq_reset(&evmgr->obuf);  		thread_add_timer(master, evmgr_reconnect, evmgr, 10,  				 &evmgr->t_reconnect); diff --git a/nhrpd/vici.c b/nhrpd/vici.c index d6105b71d4..4f12d796a5 100644 --- a/nhrpd/vici.c +++ b/nhrpd/vici.c @@ -481,8 +481,8 @@ static int vici_reconnect(struct thread *t)  	fd = sock_open_unix("/var/run/charon.vici");  	if (fd < 0) {  		debugf(NHRP_DEBUG_VICI, -		       "%s: failure connecting VICI socket: %s", -		       __PRETTY_FUNCTION__, strerror(errno)); +		       "%s: failure connecting VICI socket: %s", __func__, +		       strerror(errno));  		thread_add_timer(master, vici_reconnect, vici, 2,  				 &vici->t_reconnect);  		return 0; diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index ff82bb1798..b0d501dab4 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -232,8 +232,8 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,  							&route->prefix)), buf,  						  sizeof(buf));  					zlog_debug( -						"%s: route %s with cost %u is not best, ignore." -						, __PRETTY_FUNCTION__, buf, +						"%s: route %s with cost %u is not best, ignore.", +						__func__, buf,  						route->path.cost);  				}  				return 0; @@ -246,9 +246,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,  				if (is_debug) {  					prefix2str(&route->prefix, buf,  						   sizeof(buf)); -					zlog_debug("%s: intra-prefix route %s with cost %u is not best, ignore." -					   , __PRETTY_FUNCTION__, buf, -					   route->path.cost); +					zlog_debug( +						"%s: intra-prefix route %s with cost %u is not best, ignore.", +						__func__, buf, +						route->path.cost);  				}  				return 0;  			} diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index e4c4d4ad9c..9fe077b544 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -61,8 +61,7 @@ static void ospf6_area_lsdb_hook_add(struct ospf6_lsa *lsa)  	case OSPF6_LSTYPE_ROUTER:  	case OSPF6_LSTYPE_NETWORK:  		if (IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa->header->type)) { -			zlog_debug("%s Examin LSA %s", __PRETTY_FUNCTION__, -				   lsa->name); +			zlog_debug("%s Examin LSA %s", __func__, lsa->name);  			zlog_debug(" Schedule SPF Calculation for %s",  				   OSPF6_AREA(lsa->lsdb->data)->name);  		} diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 0f9a20df87..486e4d8d2a 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -532,7 +532,7 @@ void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa)  	if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {  		prefix2str(&route->prefix, buf, sizeof(buf));  		zlog_debug("%s: AS-External %u route add %s cost %u(%u) nh %u", -			   __PRETTY_FUNCTION__, +			   __func__,  			   (route->path.type == OSPF6_PATH_TYPE_EXTERNAL1) ? 1  									   : 2,  			   buf, route->path.cost, route->path.u.cost_e2, @@ -892,8 +892,7 @@ static int ospf6_asbr_routemap_update_timer(struct thread *thread)  	if (ospf6->rmap[arg_type].map) {  		if (IS_OSPF6_DEBUG_ASBR)  			zlog_debug("%s: route-map %s update, reset redist %s", -				   __PRETTY_FUNCTION__, -				   ospf6->rmap[arg_type].name, +				   __func__, ospf6->rmap[arg_type].name,  				   ZROUTE_NAME(arg_type));  		ospf6_zebra_no_redistribute(arg_type); @@ -917,8 +916,8 @@ void ospf6_asbr_distribute_list_update(int type)  	args[1] = (void *)((ptrdiff_t)type);  	if (IS_OSPF6_DEBUG_ASBR) -		zlog_debug("%s: trigger redistribute %s reset thread", -			   __PRETTY_FUNCTION__, ZROUTE_NAME(type)); +		zlog_debug("%s: trigger redistribute %s reset thread", __func__, +			   ZROUTE_NAME(type));  	ospf6->t_distribute_update = NULL;  	thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer, @@ -943,7 +942,7 @@ static void ospf6_asbr_routemap_update(const char *mapname)  				if (IS_OSPF6_DEBUG_ASBR)  					zlog_debug(  						"%s: route-map %s update, reset redist %s", -						__PRETTY_FUNCTION__, mapname, +						__func__, mapname,  						ZROUTE_NAME(type));  				route_map_counter_increment( diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 15dbd0716a..891421b7e8 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -258,8 +258,8 @@ void ospf6_install_lsa(struct ospf6_lsa *lsa)  	if (IS_OSPF6_DEBUG_LSA_TYPE(lsa->header->type)  	    || IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa->header->type))  		zlog_debug("%s Install LSA: %s age %d seqnum %x in LSDB.", -			   __PRETTY_FUNCTION__, lsa->name, -			   ntohs(lsa->header->age), ntohl(lsa->header->seqnum)); +			   __func__, lsa->name, ntohs(lsa->header->age), +			   ntohl(lsa->header->seqnum));  	/* actually install */  	lsa->installed = now; @@ -1004,7 +1004,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,  				if (is_debug)  					zlog_debug(  						"%s: Current copy of LSA %s is MAXAGE, but new has recent Age.", -						old->name, __PRETTY_FUNCTION__); +						old->name, __func__);  				ospf6_lsa_purge(old);  				if (new->header->adv_router diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 61879b2cbb..192e6356b1 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -1636,7 +1636,7 @@ void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa)  		return;  	if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) -		zlog_debug("%s: LSA %s found", __PRETTY_FUNCTION__, lsa->name); +		zlog_debug("%s: LSA %s found", __func__, lsa->name);  	oa = OSPF6_AREA(lsa->lsdb->data); @@ -1732,21 +1732,22 @@ void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa)  		if (old) {  			if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {  				prefix2str(&route->prefix, buf, sizeof(buf)); -				zlog_debug("%s Update route: %s old cost %u new cost %u paths %u nh %u", -					   __PRETTY_FUNCTION__, buf, -					   old->path.cost, route->path.cost, -					   listcount(route->paths), -					   listcount(route->nh_list)); +				zlog_debug( +					"%s Update route: %s old cost %u new cost %u paths %u nh %u", +					__func__, buf, old->path.cost, +					route->path.cost, +					listcount(route->paths), +					listcount(route->nh_list));  			}  			ospf6_intra_prefix_route_ecmp_path(oa, old, route);  		} else {  			if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {  				prefix2str(&route->prefix, buf, sizeof(buf)); -				zlog_debug("%s route %s add with cost %u paths %u nh %u", -					   __PRETTY_FUNCTION__, buf, -					   route->path.cost, -					   listcount(route->paths), -					   listcount(route->nh_list)); +				zlog_debug( +					"%s route %s add with cost %u paths %u nh %u", +					__func__, buf, route->path.cost, +					listcount(route->paths), +					listcount(route->nh_list));  			}  			ospf6_route_add(route, oa->route_table);  		} @@ -1859,8 +1860,7 @@ void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa)  	char buf[PREFIX2STR_BUFFER];  	if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) -		zlog_debug("%s: %s disappearing", __PRETTY_FUNCTION__, -			   lsa->name); +		zlog_debug("%s: %s disappearing", __func__, lsa->name);  	oa = OSPF6_AREA(lsa->lsdb->data); @@ -1917,12 +1917,12 @@ void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa)  				if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) {  					prefix2str(&route->prefix, buf,  						   sizeof(buf)); -					zlog_debug("%s: route remove %s with path type %u cost %u paths %u nh %u", -						   __PRETTY_FUNCTION__, buf, -						   route->path.type, -						   route->path.cost, -						   listcount(route->paths), -						   listcount(route->nh_list)); +					zlog_debug( +						"%s: route remove %s with path type %u cost %u paths %u nh %u", +						__func__, buf, route->path.type, +						route->path.cost, +						listcount(route->paths), +						listcount(route->nh_list));  				}  				ospf6_route_remove(route, oa->route_table);  			} @@ -2054,8 +2054,8 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)  	if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(oa->area_id) ||  	    IS_OSPF6_DEBUG_ROUTE(MEMORY)) -		zlog_info("%s: border-router calculation for area %s", -			  __PRETTY_FUNCTION__, oa->name); +		zlog_info("%s: border-router calculation for area %s", __func__, +			  oa->name);  	hook_add = oa->ospf6->brouter_table->hook_add;  	hook_remove = oa->ospf6->brouter_table->hook_remove; @@ -2161,10 +2161,11 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)  			if (ospf6_route_lookup(&adv_prefix, oa->spf_table)) {  				if (IS_OSPF6_DEBUG_BROUTER) { -					zlog_debug("%s: keep inter brouter %s as adv router 0x%x found in spf", -						   __PRETTY_FUNCTION__, -						   brouter_name, -					brouter->path.origin.adv_router); +					zlog_debug( +						"%s: keep inter brouter %s as adv router 0x%x found in spf", +						__func__, brouter_name, +						brouter->path.origin +							.adv_router);  					ospf6_brouter_debug_print(brouter);  				}  				UNSET_FLAG(brouter->flag, OSPF6_ROUTE_REMOVE); @@ -2183,9 +2184,9 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)  				       brouter_id)  			    || IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(  				       oa->area_id)) -				zlog_info("%s: brouter %s disappears via area %s", -					  __PRETTY_FUNCTION__, brouter_name, -					  oa->name); +				zlog_info( +					"%s: brouter %s disappears via area %s", +					__func__, brouter_name, oa->name);  			/* This is used to protect nbrouter from removed from  			 * the table. For an example, ospf6_abr_examin_summary,  			 * removes brouters which are marked for remove. @@ -2201,8 +2202,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)  			    || IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(  				       oa->area_id))  				zlog_info("%s: brouter %s appears via area %s", -					  __PRETTY_FUNCTION__, brouter_name, -					  oa->name); +					  __func__, brouter_name, oa->name);  			/* newly added */  			if (hook_add) @@ -2229,7 +2229,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)  	if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID(oa->area_id) ||  	    IS_OSPF6_DEBUG_ROUTE(MEMORY))  		zlog_info("%s: border-router calculation for area %s: done", -			  __PRETTY_FUNCTION__, oa->name); +			  __func__, oa->name);  }  static const struct ospf6_lsa_handler router_handler = { diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index d75fc39bbb..21f9b0722c 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -2186,9 +2186,8 @@ int ospf6_lsupdate_send_neighbor_now(struct ospf6_neighbor *on,  	if (IS_OSPF6_DEBUG_FLOODING  	    || IS_OSPF6_DEBUG_MESSAGE(OSPF6_MESSAGE_TYPE_LSUPDATE, SEND)) -		zlog_debug("%s: Send lsupdate with lsa %s (age %u)", -			   __PRETTY_FUNCTION__, lsa->name, -			   ntohs(lsa->header->age)); +		zlog_debug("%s: Send lsupdate with lsa %s (age %u)", __func__, +			   lsa->name, ntohs(lsa->header->age));  	ospf6_send_lsupdate(on, NULL, oh); @@ -2244,8 +2243,7 @@ int ospf6_lsupdate_send_interface(struct thread *thread)  				if (IS_OSPF6_DEBUG_MESSAGE(  					    OSPF6_MESSAGE_TYPE_LSUPDATE, SEND))  					zlog_debug("%s: LSUpdate length %d", -						   __PRETTY_FUNCTION__, -						   ntohs(oh->length)); +						   __func__, ntohs(oh->length));  				memset(sendbuf, 0, iobuflen);  				oh = (struct ospf6_header *)sendbuf; diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 966ef44825..524017a31e 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -351,7 +351,7 @@ static int ospf6_spf_install(struct ospf6_vertex *v,  			if (IS_OSPF6_DEBUG_SPF(PROCESS)) {  				zlog_debug(  					"%s: V lsa %s id %u, route id %u are different", -					__PRETTY_FUNCTION__, v->lsa->name, +					__func__, v->lsa->name,  					ntohl(v->lsa->header->id),  					ntohl(route->path.origin.id));  			} @@ -995,15 +995,15 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,  		rtr_lsa = ospf6_lsdb_next(end, rtr_lsa);  	}  	if (IS_OSPF6_DEBUG_SPF(PROCESS)) -		zlog_debug("%s: adv_router %s num_lsa %u to convert.", -			   __PRETTY_FUNCTION__, ifbuf, num_lsa); +		zlog_debug("%s: adv_router %s num_lsa %u to convert.", __func__, +			   ifbuf, num_lsa);  	if (num_lsa == 1)  		return lsa;  	if (num_lsa == 0) {  		if (IS_OSPF6_DEBUG_SPF(PROCESS))  			zlog_debug("%s: adv_router %s not found in LSDB.", -				   __PRETTY_FUNCTION__, ifbuf); +				   __func__, ifbuf);  		return NULL;  	} @@ -1052,7 +1052,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,  			inet_ntop(AF_INET, &interface_id, ifbuf, sizeof(ifbuf));  			zlog_debug(  				"%s: Next Router LSA %s to aggreat with len %u interface_id %s", -				__PRETTY_FUNCTION__, rtr_lsa->name, +				__func__, rtr_lsa->name,  				ntohs(lsa_header->length), ifbuf);  		} @@ -1074,9 +1074,9 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,  	if (IS_OSPF6_DEBUG_SPF(PROCESS))  		zlog_debug("%s: LSA %s id %u type 0%x len %u num_lsa %u", -			   __PRETTY_FUNCTION__, lsa->name, -			   ntohl(lsa->header->id), ntohs(lsa->header->type), -			   ntohs(lsa->header->length), num_lsa); +			   __func__, lsa->name, ntohl(lsa->header->id), +			   ntohs(lsa->header->type), ntohs(lsa->header->length), +			   num_lsa);  	return lsa;  } diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 95537eb86e..96eee51929 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -111,7 +111,7 @@ static void ospf6_top_brouter_hook_add(struct ospf6_route *route)  		inet_ntop(AF_INET, &brouter_id, brouter_name,  			  sizeof(brouter_name));  		zlog_debug("%s: brouter %s add with adv router %x nh count %u", -			   __PRETTY_FUNCTION__, brouter_name, +			   __func__, brouter_name,  			   route->path.origin.adv_router,  			   listcount(route->nh_list));  	} @@ -131,7 +131,7 @@ static void ospf6_top_brouter_hook_remove(struct ospf6_route *route)  		inet_ntop(AF_INET, &brouter_id, brouter_name,  			  sizeof(brouter_name));  		zlog_debug("%s: brouter %p %s del with adv router %x nh %u", -			   __PRETTY_FUNCTION__, (void *)route, brouter_name, +			   __func__, (void *)route, brouter_name,  			   route->path.origin.adv_router,  			   listcount(route->nh_list));  	} diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 6832737ada..1717f1e650 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -64,10 +64,9 @@ static int ospf6_router_id_update_zebra(ZAPI_CALLBACK_ARGS)  	if (IS_OSPF6_DEBUG_ZEBRA(RECV)) {  		char buf[INET_ADDRSTRLEN]; -		zlog_debug("%s: zebra router-id %s update", -			   __PRETTY_FUNCTION__, -			   inet_ntop(AF_INET, &router_id.u.prefix4, -				     buf, INET_ADDRSTRLEN)); +		zlog_debug("%s: zebra router-id %s update", __func__, +			   inet_ntop(AF_INET, &router_id.u.prefix4, buf, +				     INET_ADDRSTRLEN));  	}  	ospf6_router_id_update(); diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index c29b464cab..818e7e72bc 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -948,7 +948,7 @@ void ospf_lsa_flush_area(struct ospf_lsa *lsa, struct ospf_area *area)  	   retransmissions */  	lsa->data->ls_age = htons(OSPF_LSA_MAXAGE);  	if (IS_DEBUG_OSPF_EVENT) -		zlog_debug("%s: MAXAGE set to LSA %s", __PRETTY_FUNCTION__, +		zlog_debug("%s: MAXAGE set to LSA %s", __func__,  			   inet_ntoa(lsa->data->id));  	monotime(&lsa->tv_recv);  	lsa->tv_orig = lsa->tv_recv; diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index f2efaf322f..1622b2fd25 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -272,8 +272,8 @@ struct ospf_interface *ospf_if_new(struct ospf *ospf, struct interface *ifp,  	if (IS_DEBUG_OSPF_EVENT)  		zlog_debug("%s: ospf interface %s vrf %s id %u created", -			   __PRETTY_FUNCTION__, ifp->name, -			   ospf_get_name(ospf), ospf->vrf_id); +			   __func__, ifp->name, ospf_get_name(ospf), +			   ospf->vrf_id);  	return oi;  } @@ -349,7 +349,7 @@ void ospf_if_free(struct ospf_interface *oi)  	if (IS_DEBUG_OSPF_EVENT)  		zlog_debug("%s: ospf interface %s vrf %s id %u deleted", -			   __PRETTY_FUNCTION__, oi->ifp->name, +			   __func__, oi->ifp->name,  			   ospf_vrf_id_to_name(oi->ifp->vrf_id),  			   oi->ifp->vrf_id); diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 35bbe06cd1..52db1de2d9 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -2858,7 +2858,7 @@ void ospf_lsa_maxage_delete(struct ospf *ospf, struct ospf_lsa *lsa)  	} else {  		if (IS_DEBUG_OSPF_EVENT)  			zlog_debug("%s: lsa %s is not found in maxage db.", -				   __PRETTY_FUNCTION__, dump_lsa_key(lsa)); +				   __func__, dump_lsa_key(lsa));  	}  } diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c index 0fc2cd60f9..58f087ca4f 100644 --- a/ospfd/ospf_nsm.c +++ b/ospfd/ospf_nsm.c @@ -684,7 +684,7 @@ static void nsm_change_state(struct ospf_neighbor *nbr, int state)  			zlog_info(  				"%s:[%s:%s], %s -> %s): "  				"scheduling new router-LSA origination", -				__PRETTY_FUNCTION__, inet_ntoa(nbr->router_id), +				__func__, inet_ntoa(nbr->router_id),  				ospf_get_name(oi->ospf),  				lookup_msg(ospf_nsm_state_msg, old_state, NULL),  				lookup_msg(ospf_nsm_state_msg, state, NULL)); diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 213db15fa5..de8c371f17 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -2376,9 +2376,9 @@ static struct stream *ospf_recv_packet(struct ospf *ospf, int fd,  	}  	if (IS_DEBUG_OSPF_PACKET(0, RECV)) -		zlog_debug("%s: fd %d(%s) on interface %d(%s)", -			   __PRETTY_FUNCTION__, fd, ospf_get_name(ospf), -			   ifindex, *ifp ? (*ifp)->name : "Unknown"); +		zlog_debug("%s: fd %d(%s) on interface %d(%s)", __func__, fd, +			   ospf_get_name(ospf), ifindex, +			   *ifp ? (*ifp)->name : "Unknown");  	return ibuf;  } @@ -2984,8 +2984,7 @@ static enum ospf_read_return_enum ospf_read_helper(struct ospf *ospf)  			if (IS_DEBUG_OSPF_PACKET(0, RECV))  				zlog_debug(  					"%s: Unable to determine incoming interface from: %s(%s)", -					__PRETTY_FUNCTION__, -					inet_ntoa(iph->ip_src), +					__func__, inet_ntoa(iph->ip_src),  					ospf_get_name(ospf));  			return OSPF_READ_CONTINUE;  		} @@ -3689,7 +3688,7 @@ static void ospf_hello_send_sub(struct ospf_interface *oi, in_addr_t addr)  		if (oi->ospf->vrf_id)  			zlog_debug(  				"%s: Hello Tx interface %s ospf vrf %s id %u", -				__PRETTY_FUNCTION__, oi->ifp->name, +				__func__, oi->ifp->name,  				ospf_vrf_id_to_name(oi->ospf->vrf_id),  				oi->ospf->vrf_id);  	} diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 7bd586fd31..5c9fbdb902 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -2455,7 +2455,7 @@ static void ospfTrapNbrStateChange(struct ospf_neighbor *on)  	ospf_nbr_state_message(on, msgbuf, sizeof(msgbuf));  	if (IS_DEBUG_OSPF_EVENT) -		zlog_info("%s: trap sent: %s now %s", __PRETTY_FUNCTION__, +		zlog_info("%s: trap sent: %s now %s", __func__,  			  inet_ntoa(on->address.u.prefix4), msgbuf);  	oid_copy_addr(index, &(on->address.u.prefix4), IN_ADDR_SIZE); @@ -2508,7 +2508,7 @@ static void ospfTrapIfStateChange(struct ospf_interface *oi)  	oid index[sizeof(oid) * (IN_ADDR_SIZE + 1)];  	if (IS_DEBUG_OSPF_EVENT) -		zlog_info("%s: trap sent: %s now %s", __PRETTY_FUNCTION__, +		zlog_info("%s: trap sent: %s now %s", __func__,  			  inet_ntoa(oi->address->u.prefix4),  			  lookup_msg(ospf_ism_state_msg, oi->state, NULL)); diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index d415256652..1cea79d641 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -87,8 +87,8 @@ static int ospf_router_id_update_zebra(ZAPI_CALLBACK_ARGS)  			prefix2str(&router_id, buf, sizeof(buf));  			zlog_debug(  				"%s: ospf instance not found for vrf %s id %u router_id %s", -				__PRETTY_FUNCTION__, -				ospf_vrf_id_to_name(vrf_id), vrf_id, buf); +				__func__, ospf_vrf_id_to_name(vrf_id), vrf_id, +				buf);  		}  	}  	return 0; @@ -197,7 +197,7 @@ static int ospf_interface_vrf_update(ZAPI_CALLBACK_ARGS)  	if (IS_DEBUG_OSPF_EVENT)  		zlog_debug(  			"%s: Rx Interface %s VRF change vrf_id %u New vrf %s id %u", -			__PRETTY_FUNCTION__, ifp->name, vrf_id, +			__func__, ifp->name, vrf_id,  			ospf_vrf_id_to_name(new_vrf_id), new_vrf_id);  	/*if_update(ifp, ifp->name, strlen(ifp->name), new_vrf_id);*/ @@ -1320,8 +1320,7 @@ void ospf_zebra_vrf_register(struct ospf *ospf)  	if (ospf->vrf_id != VRF_UNKNOWN) {  		if (IS_DEBUG_OSPF_EVENT) -			zlog_debug("%s: Register VRF %s id %u", -				   __PRETTY_FUNCTION__, +			zlog_debug("%s: Register VRF %s id %u", __func__,  				   ospf_vrf_id_to_name(ospf->vrf_id),  				   ospf->vrf_id);  		zclient_send_reg_requests(zclient, ospf->vrf_id); @@ -1336,8 +1335,7 @@ void ospf_zebra_vrf_deregister(struct ospf *ospf)  	if (ospf->vrf_id != VRF_DEFAULT && ospf->vrf_id != VRF_UNKNOWN) {  		if (IS_DEBUG_OSPF_EVENT)  			zlog_debug("%s: De-Register VRF %s id %u to Zebra.", -				   __PRETTY_FUNCTION__, -				   ospf_vrf_id_to_name(ospf->vrf_id), +				   __func__, ospf_vrf_id_to_name(ospf->vrf_id),  				   ospf->vrf_id);  		/* Deregister for router-id, interfaces,  		 * redistributed routes. */ diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 2a3f1329a0..2a0f8cdc0c 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -220,7 +220,7 @@ static struct ospf *ospf_new(unsigned short instance, const char *name)  		if (IS_DEBUG_OSPF_EVENT)  			zlog_debug(  				"%s: Create new ospf instance with vrf_name %s vrf_id %u", -				__PRETTY_FUNCTION__, name, new->vrf_id); +				__func__, name, new->vrf_id);  	} else {  		new->vrf_id = VRF_DEFAULT;  		vrf = vrf_lookup_by_id(VRF_DEFAULT); @@ -1308,7 +1308,7 @@ void ospf_if_update(struct ospf *ospf, struct interface *ifp)  	if (IS_DEBUG_OSPF_EVENT)  		zlog_debug(  			"%s: interface %s ifp->vrf_id %u ospf vrf %s vrf_id %u router_id %s", -			__PRETTY_FUNCTION__, ifp->name, ifp->vrf_id, +			__func__, ifp->name, ifp->vrf_id,  			ospf_vrf_id_to_name(ospf->vrf_id), ospf->vrf_id,  			inet_ntoa(ospf->router_id)); @@ -2019,8 +2019,8 @@ void ospf_vrf_unlink(struct ospf *ospf, struct vrf *vrf)  static int ospf_vrf_new(struct vrf *vrf)  {  	if (IS_DEBUG_OSPF_EVENT) -		zlog_debug("%s: VRF Created: %s(%u)", __PRETTY_FUNCTION__, -			   vrf->name, vrf->vrf_id); +		zlog_debug("%s: VRF Created: %s(%u)", __func__, vrf->name, +			   vrf->vrf_id);  	return 0;  } @@ -2029,8 +2029,8 @@ static int ospf_vrf_new(struct vrf *vrf)  static int ospf_vrf_delete(struct vrf *vrf)  {  	if (IS_DEBUG_OSPF_EVENT) -		zlog_debug("%s: VRF Deletion: %s(%u)", __PRETTY_FUNCTION__, -			   vrf->name, vrf->vrf_id); +		zlog_debug("%s: VRF Deletion: %s(%u)", __func__, vrf->name, +			   vrf->vrf_id);  	return 0;  } @@ -2113,8 +2113,8 @@ static int ospf_vrf_disable(struct vrf *vrf)  		return 0;  	if (IS_DEBUG_OSPF_EVENT) -		zlog_debug("%s: VRF %s id %d disabled.", __PRETTY_FUNCTION__, -			   vrf->name, vrf->vrf_id); +		zlog_debug("%s: VRF %s id %d disabled.", __func__, vrf->name, +			   vrf->vrf_id);  	ospf = ospf_lookup_by_name(vrf->name);  	if (ospf) { @@ -2126,8 +2126,8 @@ static int ospf_vrf_disable(struct vrf *vrf)  		ospf_vrf_unlink(ospf, vrf);  		ospf->oi_running = 0;  		if (IS_DEBUG_OSPF_EVENT) -			zlog_debug("%s: ospf old_vrf_id %d unlinked", -				   __PRETTY_FUNCTION__, old_vrf_id); +			zlog_debug("%s: ospf old_vrf_id %d unlinked", __func__, +				   old_vrf_id);  		thread_cancel(ospf->t_read);  		close(ospf->fd);  		ospf->fd = -1; diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c index fd77a07fb8..9f4a75fa49 100644 --- a/pbrd/pbr_map.c +++ b/pbrd/pbr_map.c @@ -595,8 +595,8 @@ bool pbr_map_check_valid(const char *name)  	pbrm = pbrm_find(name);  	if (!pbrm) {  		DEBUGD(&pbr_dbg_map, -		       "%s: Specified PBR-MAP(%s) does not exist?", -		       __PRETTY_FUNCTION__, name); +		       "%s: Specified PBR-MAP(%s) does not exist?", __func__, +		       name);  		return false;  	} @@ -726,8 +726,8 @@ void pbr_map_check(struct pbr_map_sequence *pbrms)  	bool install;  	pbrm = pbrms->parent; -	DEBUGD(&pbr_dbg_map, "%s: for %s(%u)", __PRETTY_FUNCTION__, -	       pbrm->name, pbrms->seqno); +	DEBUGD(&pbr_dbg_map, "%s: for %s(%u)", __func__, pbrm->name, +	       pbrms->seqno);  	if (pbr_map_check_valid(pbrm->name))  		DEBUGD(&pbr_dbg_map, "We are totally valid %s",  		       pbrm->name); @@ -735,16 +735,13 @@ void pbr_map_check(struct pbr_map_sequence *pbrms)  	if (pbrms->reason == PBR_MAP_VALID_SEQUENCE_NUMBER) {  		install = true;  		DEBUGD(&pbr_dbg_map, "%s: Installing %s(%u) reason: %" PRIu64, -		       __PRETTY_FUNCTION__, pbrm->name, pbrms->seqno, -		       pbrms->reason); +		       __func__, pbrm->name, pbrms->seqno, pbrms->reason);  		DEBUGD(&pbr_dbg_map,  		       "\tSending PBR_MAP_POLICY_INSTALL event");  	} else {  		install = false; -		DEBUGD(&pbr_dbg_map, -		       "%s: Removing %s(%u) reason: %" PRIu64, -		       __PRETTY_FUNCTION__, pbrm->name, -		       pbrms->seqno, pbrms->reason); +		DEBUGD(&pbr_dbg_map, "%s: Removing %s(%u) reason: %" PRIu64, +		       __func__, pbrm->name, pbrms->seqno, pbrms->reason);  	}  	if (install) diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c index adcb86833a..c0c417a743 100644 --- a/pbrd/pbr_nht.c +++ b/pbrd/pbr_nht.c @@ -97,8 +97,7 @@ static void *pbr_nh_alloc(void *p)  	/* Decremented again in pbr_nh_delete */  	++nhrc->refcount; -	DEBUGD(&pbr_dbg_nht, "%s: Sending nexthop to Zebra", -	       __PRETTY_FUNCTION__); +	DEBUGD(&pbr_dbg_nht, "%s: Sending nexthop to Zebra", __func__);  	pbr_send_rnh(new->nexthop, true); @@ -116,7 +115,7 @@ static void pbr_nh_delete(struct pbr_nexthop_cache **pnhc)  		--nhrc->refcount;  	if (!nhrc || nhrc->refcount == 0) {  		DEBUGD(&pbr_dbg_nht, "%s: Removing nexthop from Zebra", -		       __PRETTY_FUNCTION__); +		       __func__);  		pbr_send_rnh((*pnhc)->nexthop, false);  	}  	if (nhrc && nhrc->refcount == 0) { @@ -197,8 +196,8 @@ static void *pbr_nhgc_alloc(void *p)  	strlcpy(new->name, pnhgc->name, sizeof(pnhgc->name));  	new->table_id = pbr_nht_get_next_tableid(false); -	DEBUGD(&pbr_dbg_nht, "%s: NHT: %s assigned Table ID: %u", -	       __PRETTY_FUNCTION__, new->name, new->table_id); +	DEBUGD(&pbr_dbg_nht, "%s: NHT: %s assigned Table ID: %u", __func__, +	       new->name, new->table_id);  	new->nhh = hash_create_size(8, pbr_nh_hash_key, pbr_nh_hash_equal,  				    "PBR NH Cache Hash"); @@ -215,7 +214,7 @@ void pbr_nhgroup_add_cb(const char *name)  	if (!nhgc) {  		DEBUGD(&pbr_dbg_nht, "%s: Could not find nhgc with name: %s\n", -		       __PRETTY_FUNCTION__, name); +		       __func__, name);  		return;  	} @@ -224,8 +223,7 @@ void pbr_nhgroup_add_cb(const char *name)  	if (!pnhgc)  		return; -	DEBUGD(&pbr_dbg_nht, "%s: Added nexthop-group %s", __PRETTY_FUNCTION__, -	       name); +	DEBUGD(&pbr_dbg_nht, "%s: Added nexthop-group %s", __func__, name);  	pbr_map_check_nh_group_change(name);  } @@ -242,7 +240,7 @@ void pbr_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc,  	if (!pbr_nht_get_next_tableid(true)) {  		zlog_warn(  			"%s: Exhausted all table identifiers; cannot create nexthop-group cache for nexthop-group '%s'", -			__PRETTY_FUNCTION__, nhgc->name); +			__func__, nhgc->name);  		return;  	} @@ -261,7 +259,7 @@ void pbr_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc,  	if (DEBUG_MODE_CHECK(&pbr_dbg_nht, DEBUG_MODE_ALL)) {  		nexthop2str(nhop, debugstr, sizeof(debugstr));  		DEBUGD(&pbr_dbg_nht, "%s: Added %s to nexthop-group %s", -		       __PRETTY_FUNCTION__, debugstr, nhgc->name); +		       __func__, debugstr, nhgc->name);  	}  	pbr_nht_install_nexthop_group(pnhgc, nhgc->nhg); @@ -302,7 +300,7 @@ void pbr_nhgroup_del_nexthop_cb(const struct nexthop_group_cmd *nhgc,  	if (DEBUG_MODE_CHECK(&pbr_dbg_nht, DEBUG_MODE_ALL)) {  		nexthop2str(nhop, debugstr, sizeof(debugstr));  		DEBUGD(&pbr_dbg_nht, "%s: Removed %s from nexthop-group %s", -		       __PRETTY_FUNCTION__, debugstr, nhgc->name); +		       __func__, debugstr, nhgc->name);  	}  	if (pnhgc->nhh->count) @@ -315,8 +313,7 @@ void pbr_nhgroup_del_nexthop_cb(const struct nexthop_group_cmd *nhgc,  void pbr_nhgroup_delete_cb(const char *name)  { -	DEBUGD(&pbr_dbg_nht, "%s: Removed nexthop-group %s", -	       __PRETTY_FUNCTION__, name); +	DEBUGD(&pbr_dbg_nht, "%s: Removed nexthop-group %s", __func__, name);  	/* delete group from all pbrms's */  	pbr_nht_delete_group(name); @@ -339,8 +336,8 @@ static void pbr_nht_find_nhg_from_table_install(struct hash_bucket *b,  	uint32_t *table_id = (uint32_t *)data;  	if (pnhgc->table_id == *table_id) { -		DEBUGD(&pbr_dbg_nht, "%s: Table ID (%u) matches %s", -		       __PRETTY_FUNCTION__, *table_id, pnhgc->name); +		DEBUGD(&pbr_dbg_nht, "%s: Table ID (%u) matches %s", __func__, +		       *table_id, pnhgc->name);  		/*  		 * If the table has been re-handled by zebra @@ -527,7 +524,7 @@ void pbr_nht_add_individual_nexthop(struct pbr_map_sequence *pbrms)  	if (!pbr_nht_get_next_tableid(true)) {  		zlog_warn(  			"%s: Exhausted all table identifiers; cannot create nexthop-group cache for nexthop-group '%s'", -			__PRETTY_FUNCTION__, find.name); +			__func__, find.name);  		return;  	} @@ -641,7 +638,7 @@ void pbr_nht_delete_group(const char *name)  bool pbr_nht_nexthop_valid(struct nexthop_group *nhg)  { -	DEBUGD(&pbr_dbg_nht, "%s: %p", __PRETTY_FUNCTION__, nhg); +	DEBUGD(&pbr_dbg_nht, "%s: %p", __func__, nhg);  	return true;  } @@ -650,13 +647,13 @@ bool pbr_nht_nexthop_group_valid(const char *name)  	struct pbr_nexthop_group_cache *pnhgc;  	struct pbr_nexthop_group_cache lookup; -	DEBUGD(&pbr_dbg_nht, "%s: %s", __PRETTY_FUNCTION__, name); +	DEBUGD(&pbr_dbg_nht, "%s: %s", __func__, name);  	snprintf(lookup.name, sizeof(lookup.name), "%s", name);  	pnhgc = hash_get(pbr_nhg_hash, &lookup, NULL);  	if (!pnhgc)  		return false; -	DEBUGD(&pbr_dbg_nht, "%s: \t%d %d", __PRETTY_FUNCTION__, pnhgc->valid, +	DEBUGD(&pbr_dbg_nht, "%s: \t%d %d", __func__, pnhgc->valid,  	       pnhgc->installed);  	if (pnhgc->valid && pnhgc->installed)  		return true; @@ -982,7 +979,7 @@ uint32_t pbr_nht_get_table(const char *name)  	if (!pnhgc) {  		DEBUGD(&pbr_dbg_nht,  		       "%s: Could not find nexthop-group cache w/ name '%s'", -		       __PRETTY_FUNCTION__, name); +		       __func__, name);  		return 5000;  	} diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index ec0327d74f..c2d93a405e 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -62,8 +62,7 @@ struct pbr_interface *pbr_if_new(struct interface *ifp)  /* Inteface addition message from zebra. */  int pbr_ifp_create(struct interface *ifp)  { -	DEBUGD(&pbr_dbg_zebra, -	       "%s: %s", __PRETTY_FUNCTION__, ifp->name); +	DEBUGD(&pbr_dbg_zebra, "%s: %s", __func__, ifp->name);  	if (!ifp->info)  		pbr_if_new(ifp); @@ -78,8 +77,7 @@ int pbr_ifp_create(struct interface *ifp)  int pbr_ifp_destroy(struct interface *ifp)  { -	DEBUGD(&pbr_dbg_zebra, -	       "%s: %s", __PRETTY_FUNCTION__, ifp->name); +	DEBUGD(&pbr_dbg_zebra, "%s: %s", __func__, ifp->name);  	pbr_map_policy_interface_update(ifp, false); @@ -93,8 +91,7 @@ static int interface_address_add(ZAPI_CALLBACK_ARGS)  	c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id); -	DEBUGD(&pbr_dbg_zebra, -	       "%s: %s added %s", __PRETTY_FUNCTION__, +	DEBUGD(&pbr_dbg_zebra, "%s: %s added %s", __func__,  	       c ? c->ifp->name : "Unknown",  	       c ? prefix2str(c->address, buf, sizeof(buf)) : "Unknown"); @@ -111,8 +108,7 @@ static int interface_address_delete(ZAPI_CALLBACK_ARGS)  	if (!c)  		return 0; -	DEBUGD(&pbr_dbg_zebra, -	       "%s: %s deleted %s", __PRETTY_FUNCTION__, c->ifp->name, +	DEBUGD(&pbr_dbg_zebra, "%s: %s deleted %s", __func__, c->ifp->name,  	       prefix2str(c->address, buf, sizeof(buf)));  	connected_free(&c); @@ -121,8 +117,7 @@ static int interface_address_delete(ZAPI_CALLBACK_ARGS)  int pbr_ifp_up(struct interface *ifp)  { -	DEBUGD(&pbr_dbg_zebra, -	       "%s: %s is up", __PRETTY_FUNCTION__, ifp->name); +	DEBUGD(&pbr_dbg_zebra, "%s: %s is up", __func__, ifp->name);  	pbr_nht_nexthop_interface_update(ifp); @@ -131,8 +126,7 @@ int pbr_ifp_up(struct interface *ifp)  int pbr_ifp_down(struct interface *ifp)  { -	DEBUGD(&pbr_dbg_zebra, -	       "%s: %s is down", __PRETTY_FUNCTION__, ifp->name); +	DEBUGD(&pbr_dbg_zebra, "%s: %s is down", __func__, ifp->name);  	pbr_nht_nexthop_interface_update(ifp); @@ -177,30 +171,30 @@ static int route_notify_owner(ZAPI_CALLBACK_ARGS)  	switch (note) {  	case ZAPI_ROUTE_FAIL_INSTALL:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: [%s] Route install failure for table: %u", -		       __PRETTY_FUNCTION__, buf, table_id); +		       "%s: [%s] Route install failure for table: %u", __func__, +		       buf, table_id);  		break;  	case ZAPI_ROUTE_BETTER_ADMIN_WON:  		DEBUGD(&pbr_dbg_zebra,  		       "%s: [%s] Route better admin distance won for table: %u", -		       __PRETTY_FUNCTION__, buf, table_id); +		       __func__, buf, table_id);  		break;  	case ZAPI_ROUTE_INSTALLED:  		DEBUGD(&pbr_dbg_zebra,  		       "%s: [%s] Route installed succeeded for table: %u", -		       __PRETTY_FUNCTION__, buf, table_id); +		       __func__, buf, table_id);  		pbr_nht_route_installed_for_table(table_id);  		break;  	case ZAPI_ROUTE_REMOVED:  		DEBUGD(&pbr_dbg_zebra,  		       "%s: [%s] Route Removed succeeded for table: %u", -		       __PRETTY_FUNCTION__, buf, table_id); +		       __func__, buf, table_id);  		pbr_nht_route_removed_for_table(table_id);  		break;  	case ZAPI_ROUTE_REMOVE_FAIL:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: [%s] Route remove fail for table: %u", -		       __PRETTY_FUNCTION__, buf, table_id); +		       "%s: [%s] Route remove fail for table: %u", __func__, +		       buf, table_id);  		break;  	} @@ -224,8 +218,8 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)  	pbrms = pbrms_lookup_unique(unique, ifi, &pmi);  	if (!pbrms) {  		DEBUGD(&pbr_dbg_zebra, -		       "%s: Failure to lookup pbrms based upon %u", -		       __PRETTY_FUNCTION__, unique); +		       "%s: Failure to lookup pbrms based upon %u", __func__, +		       unique);  		return 0;  	} @@ -256,8 +250,7 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS)  static void zebra_connected(struct zclient *zclient)  { -	DEBUGD(&pbr_dbg_zebra, "%s: Registering for fun and profit", -	       __PRETTY_FUNCTION__); +	DEBUGD(&pbr_dbg_zebra, "%s: Registering for fun and profit", __func__);  	zclient_send_reg_requests(zclient, VRF_DEFAULT);  } @@ -318,8 +311,7 @@ void route_add(struct pbr_nexthop_group_cache *pnhgc, struct nexthop_group nhg,  {  	struct zapi_route api; -	DEBUGD(&pbr_dbg_zebra, "%s for Table: %d", __PRETTY_FUNCTION__, -	       pnhgc->table_id); +	DEBUGD(&pbr_dbg_zebra, "%s for Table: %d", __func__, pnhgc->table_id);  	memset(&api, 0, sizeof(api)); @@ -347,12 +339,11 @@ void route_add(struct pbr_nexthop_group_cache *pnhgc, struct nexthop_group nhg,  	case AFI_L2VPN:  		DEBUGD(&pbr_dbg_zebra,  		       "%s: Asked to install unsupported route type: L2VPN", -		       __PRETTY_FUNCTION__); +		       __func__);  		break;  	case AFI_UNSPEC:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: Asked to install unspecified route type", -		       __PRETTY_FUNCTION__); +		       "%s: Asked to install unspecified route type", __func__);  		break;  	}  } @@ -365,8 +356,7 @@ void route_delete(struct pbr_nexthop_group_cache *pnhgc, afi_t afi)  {  	struct zapi_route api; -	DEBUGD(&pbr_dbg_zebra, "%s for Table: %d", __PRETTY_FUNCTION__, -	       pnhgc->table_id); +	DEBUGD(&pbr_dbg_zebra, "%s for Table: %d", __func__, pnhgc->table_id);  	memset(&api, 0, sizeof(api));  	api.vrf_id = VRF_DEFAULT; @@ -394,12 +384,11 @@ void route_delete(struct pbr_nexthop_group_cache *pnhgc, afi_t afi)  	case AFI_L2VPN:  		DEBUGD(&pbr_dbg_zebra,  		       "%s: Asked to delete unsupported route type: L2VPN", -		       __PRETTY_FUNCTION__); +		       __func__);  		break;  	case AFI_UNSPEC:  		DEBUGD(&pbr_dbg_zebra, -		       "%s: Asked to delete unspecified route type", -		       __PRETTY_FUNCTION__); +		       "%s: Asked to delete unspecified route type", __func__);  		break;  	}  } @@ -418,16 +407,15 @@ static int pbr_zebra_nexthop_update(ZAPI_CALLBACK_ARGS)  	if (DEBUG_MODE_CHECK(&pbr_dbg_zebra, DEBUG_MODE_ALL)) {  		DEBUGD(&pbr_dbg_zebra, "%s: Received Nexthop update: %s", -		       __PRETTY_FUNCTION__, -		       prefix2str(&nhr.prefix, buf, sizeof(buf))); +		       __func__, prefix2str(&nhr.prefix, buf, sizeof(buf))); -		DEBUGD(&pbr_dbg_zebra, "%s: (\tNexthops(%u)", -		       __PRETTY_FUNCTION__, nhr.nexthop_num); +		DEBUGD(&pbr_dbg_zebra, "%s: (\tNexthops(%u)", __func__, +		       nhr.nexthop_num);  		for (i = 0; i < nhr.nexthop_num; i++) {  			DEBUGD(&pbr_dbg_zebra,  			       "%s: \tType: %d: vrf: %d, ifindex: %d gate: %s", -			       __PRETTY_FUNCTION__, nhr.nexthops[i].type, +			       __func__, nhr.nexthops[i].type,  			       nhr.nexthops[i].vrf_id, nhr.nexthops[i].ifindex,  			       inet_ntoa(nhr.nexthops[i].gate.ipv4));  		} @@ -490,8 +478,7 @@ void pbr_send_rnh(struct nexthop *nhop, bool reg)  	if (zclient_send_rnh(zclient, command, &p,  			     false, nhop->vrf_id) < 0) { -		zlog_warn("%s: Failure to send nexthop to zebra", -			  __PRETTY_FUNCTION__); +		zlog_warn("%s: Failure to send nexthop to zebra", __func__);  	}  } @@ -569,8 +556,8 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,  	is_installed &= pbrms->installed; -	DEBUGD(&pbr_dbg_zebra, "%s: for %s %d(%" PRIu64 ")", -	       __PRETTY_FUNCTION__, pbrm->name, install, is_installed); +	DEBUGD(&pbr_dbg_zebra, "%s: for %s %d(%" PRIu64 ")", __func__, +	       pbrm->name, install, is_installed);  	/*  	 * If we are installed and asked to do so again @@ -595,9 +582,9 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,  	 */  	stream_putl(s, 1); -	DEBUGD(&pbr_dbg_zebra, "%s: \t%s %s %d %s %u", -	       __PRETTY_FUNCTION__, install ? "Installing" : "Deleting", -	       pbrm->name, install, pmi->ifp->name, pmi->delete); +	DEBUGD(&pbr_dbg_zebra, "%s: \t%s %s %d %s %u", __func__, +	       install ? "Installing" : "Deleting", pbrm->name, install, +	       pmi->ifp->name, pmi->delete);  	pbr_encode_pbr_map_sequence(s, pbrms, pmi->ifp); diff --git a/pimd/pim_assert.c b/pimd/pim_assert.c index 53ab22754c..957f904714 100644 --- a/pimd/pim_assert.c +++ b/pimd/pim_assert.c @@ -56,7 +56,7 @@ void pim_ifassert_winner_set(struct pim_ifchannel *ch,  		if (ch->ifassert_state != new_state) {  			zlog_debug(  				"%s: (S,G)=%s assert state changed from %s to %s on interface %s", -				__PRETTY_FUNCTION__, ch->sg_str, +				__func__, ch->sg_str,  				pim_ifchannel_ifassert_name(ch->ifassert_state),  				pim_ifchannel_ifassert_name(new_state),  				ch->interface->name); @@ -71,8 +71,8 @@ void pim_ifassert_winner_set(struct pim_ifchannel *ch,  				       sizeof(winner_str));  			zlog_debug(  				"%s: (S,G)=%s assert winner changed from %s to %s on interface %s", -				__PRETTY_FUNCTION__, ch->sg_str, was_str, -				winner_str, ch->interface->name); +				__func__, ch->sg_str, was_str, winner_str, +				ch->interface->name);  		}  	} /* PIM_DEBUG_PIM_EVENTS */ @@ -130,7 +130,7 @@ static void if_could_assert_do_a1(const char *caller, struct pim_ifchannel *ch)  		if (assert_action_a1(ch)) {  			zlog_warn(  				"%s: %s: (S,G)=%s assert_action_a1 failure on interface %s", -				__PRETTY_FUNCTION__, caller, ch->sg_str, +				__func__, caller, ch->sg_str,  				ch->interface->name);  			/* log warning only */  		} @@ -153,12 +153,12 @@ static int dispatch_assert(struct interface *ifp, struct in_addr source_addr,  	case PIM_IFASSERT_NOINFO:  		if (recv_metric.rpt_bit_flag) {  			/* RPT bit set */ -			if_could_assert_do_a1(__PRETTY_FUNCTION__, ch); +			if_could_assert_do_a1(__func__, ch);  		} else {  			/* RPT bit clear */  			if (inferior_assert(&ch->ifassert_my_metric,  					    &recv_metric)) { -				if_could_assert_do_a1(__PRETTY_FUNCTION__, ch); +				if_could_assert_do_a1(__func__, ch);  			} else if (acceptable_assert(&ch->ifassert_my_metric,  						     &recv_metric)) {  				if (PIM_IF_FLAG_TEST_ASSERT_TRACKING_DESIRED( @@ -205,8 +205,7 @@ static int dispatch_assert(struct interface *ifp, struct in_addr source_addr,  	default: {  		zlog_warn(  			"%s: (S,G)=%s invalid assert state %d on interface %s", -			__PRETTY_FUNCTION__, ch->sg_str, ch->ifassert_state, -			ifp->name); +			__func__, ch->sg_str, ch->ifassert_state, ifp->name);  	}  		return -2;  	} @@ -225,7 +224,7 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh,  	int curr_size;  	struct pim_interface *pim_ifp = NULL; -	on_trace(__PRETTY_FUNCTION__, ifp, src_addr); +	on_trace(__func__, ifp, src_addr);  	curr = buf;  	curr_size = buf_size; @@ -239,7 +238,7 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh,  		char src_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));  		zlog_warn("%s: pim_parse_addr_group() failure: from %s on %s", -			  __PRETTY_FUNCTION__, src_str, ifp->name); +			  __func__, src_str, ifp->name);  		return -1;  	}  	curr += offset; @@ -253,7 +252,7 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh,  		char src_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));  		zlog_warn("%s: pim_parse_addr_ucast() failure: from %s on %s", -			  __PRETTY_FUNCTION__, src_str, ifp->name); +			  __func__, src_str, ifp->name);  		return -2;  	}  	curr += offset; @@ -264,7 +263,7 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh,  		pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));  		zlog_warn(  			"%s: preference/metric size is less than 8 bytes: size=%d from %s on interface %s", -			__PRETTY_FUNCTION__, curr_size, src_str, ifp->name); +			__func__, curr_size, src_str, ifp->name);  		return -3;  	} @@ -297,9 +296,8 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh,  		pim_inet4_dump("<grp?>", sg.grp, group_str, sizeof(group_str));  		zlog_debug(  			"%s: from %s on %s: (S,G)=(%s,%s) pref=%u metric=%u rpt_bit=%u", -			__PRETTY_FUNCTION__, neigh_str, ifp->name, source_str, -			group_str, msg_metric.metric_preference, -			msg_metric.route_metric, +			__func__, neigh_str, ifp->name, source_str, group_str, +			msg_metric.metric_preference, msg_metric.route_metric,  			PIM_FORCE_BOOLEAN(msg_metric.rpt_bit_flag));  	} @@ -380,7 +378,7 @@ int pim_assert_build_msg(uint8_t *pim_msg, int buf_size, struct interface *ifp,  			       sizeof(group_str));  		zlog_warn(  			"%s: failure encoding group address %s: space left=%d", -			__PRETTY_FUNCTION__, group_str, remain); +			__func__, group_str, remain);  		return -1;  	} @@ -394,7 +392,7 @@ int pim_assert_build_msg(uint8_t *pim_msg, int buf_size, struct interface *ifp,  			       sizeof(source_str));  		zlog_warn(  			"%s: failure encoding source address %s: space left=%d", -			__PRETTY_FUNCTION__, source_str, remain); +			__func__, source_str, remain);  		return -2;  	} @@ -429,7 +427,7 @@ static int pim_assert_do(struct pim_ifchannel *ch,  	if (!ifp) {  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug("%s: channel%s has no associated interface!", -				   __PRETTY_FUNCTION__, ch->sg_str); +				   __func__, ch->sg_str);  		return -1;  	}  	pim_ifp = ifp->info; @@ -437,7 +435,7 @@ static int pim_assert_do(struct pim_ifchannel *ch,  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug(  				"%s: channel %s pim not enabled on interface: %s", -				__PRETTY_FUNCTION__, ch->sg_str, ifp->name); +				__func__, ch->sg_str, ifp->name);  		return -1;  	} @@ -448,7 +446,7 @@ static int pim_assert_do(struct pim_ifchannel *ch,  	if (pim_msg_size < 1) {  		zlog_warn(  			"%s: failure building PIM assert message: msg_size=%d", -			__PRETTY_FUNCTION__, pim_msg_size); +			__func__, pim_msg_size);  		return -2;  	} @@ -465,7 +463,7 @@ static int pim_assert_do(struct pim_ifchannel *ch,  	if (PIM_DEBUG_PIM_TRACE) {  		zlog_debug("%s: to %s: (S,G)=%s pref=%u metric=%u rpt_bit=%u", -			   __PRETTY_FUNCTION__, ifp->name, ch->sg_str, +			   __func__, ifp->name, ch->sg_str,  			   metric.metric_preference, metric.route_metric,  			   PIM_FORCE_BOOLEAN(metric.rpt_bit_flag));  	} @@ -475,7 +473,7 @@ static int pim_assert_do(struct pim_ifchannel *ch,  			 qpim_all_pim_routers_addr, pim_msg, pim_msg_size,  			 ifp->name)) {  		zlog_warn("%s: could not send PIM message on interface %s", -			  __PRETTY_FUNCTION__, ifp->name); +			  __func__, ifp->name);  		return -3;  	} @@ -516,7 +514,7 @@ static int on_assert_timer(struct thread *t)  	if (PIM_DEBUG_PIM_TRACE) {  		zlog_debug("%s: (S,G)=%s timer expired on interface %s", -			   __PRETTY_FUNCTION__, ch->sg_str, ifp->name); +			   __func__, ch->sg_str, ifp->name);  	}  	ch->t_ifassert_timer = NULL; @@ -532,8 +530,8 @@ static int on_assert_timer(struct thread *t)  		if (PIM_DEBUG_PIM_EVENTS)  			zlog_warn(  				"%s: (S,G)=%s invalid assert state %d on interface %s", -				__PRETTY_FUNCTION__, ch->sg_str, -				ch->ifassert_state, ifp->name); +				__func__, ch->sg_str, ch->ifassert_state, +				ifp->name);  	}  	} @@ -546,8 +544,7 @@ static void assert_timer_off(struct pim_ifchannel *ch)  		if (ch->t_ifassert_timer) {  			zlog_debug(  				"%s: (S,G)=%s cancelling timer on interface %s", -				__PRETTY_FUNCTION__, ch->sg_str, -				ch->interface->name); +				__func__, ch->sg_str, ch->interface->name);  		}  	}  	THREAD_OFF(ch->t_ifassert_timer); @@ -559,8 +556,7 @@ static void pim_assert_timer_set(struct pim_ifchannel *ch, int interval)  	if (PIM_DEBUG_PIM_TRACE) {  		zlog_debug("%s: (S,G)=%s starting %u sec timer on interface %s", -			   __PRETTY_FUNCTION__, ch->sg_str, interval, -			   ch->interface->name); +			   __func__, ch->sg_str, interval, ch->interface->name);  	}  	thread_add_timer(router->master, on_assert_timer, ch, interval, @@ -591,7 +587,7 @@ int assert_action_a1(struct pim_ifchannel *ch)  	pim_ifp = ifp->info;  	if (!pim_ifp) {  		zlog_warn("%s: (S,G)=%s multicast not enabled on interface %s", -			  __PRETTY_FUNCTION__, ch->sg_str, ifp->name); +			  __func__, ch->sg_str, ifp->name);  		return -1; /* must return since pim_ifp is used below */  	} @@ -604,7 +600,7 @@ int assert_action_a1(struct pim_ifchannel *ch)  	if (assert_action_a3(ch)) {  		zlog_warn(  			"%s: (S,G)=%s assert_action_a3 failure on interface %s", -			__PRETTY_FUNCTION__, ch->sg_str, ifp->name); +			__func__, ch->sg_str, ifp->name);  		/* warning only */  	} @@ -612,7 +608,7 @@ int assert_action_a1(struct pim_ifchannel *ch)  		if (PIM_DEBUG_PIM_EVENTS)  			zlog_warn(  				"%s: channel%s not in expected PIM_IFASSERT_I_AM_WINNER state", -				__PRETTY_FUNCTION__, ch->sg_str); +				__func__, ch->sg_str);  	}  	return 0; @@ -639,7 +635,7 @@ static void assert_action_a2(struct pim_ifchannel *ch,  		if (PIM_DEBUG_PIM_EVENTS)  			zlog_warn(  				"%s: channel%s not in expected PIM_IFASSERT_I_AM_LOSER state", -				__PRETTY_FUNCTION__, ch->sg_str); +				__func__, ch->sg_str);  	}  } @@ -657,7 +653,7 @@ static int assert_action_a3(struct pim_ifchannel *ch)  		if (PIM_DEBUG_PIM_EVENTS)  			zlog_warn(  				"%s: channel%s expected to be in PIM_IFASSERT_I_AM_WINNER state", -				__PRETTY_FUNCTION__, ch->sg_str); +				__func__, ch->sg_str);  		return -1;  	} @@ -665,7 +661,7 @@ static int assert_action_a3(struct pim_ifchannel *ch)  	if (pim_assert_send(ch)) {  		zlog_warn("%s: (S,G)=%s failure sending assert on interface %s", -			  __PRETTY_FUNCTION__, ch->sg_str, ch->interface->name); +			  __func__, ch->sg_str, ch->interface->name);  		return -1;  	} @@ -686,7 +682,7 @@ void assert_action_a4(struct pim_ifchannel *ch)  {  	if (pim_assert_cancel(ch)) {  		zlog_warn("%s: failure sending AssertCancel%s on interface %s", -			  __PRETTY_FUNCTION__, ch->sg_str, ch->interface->name); +			  __func__, ch->sg_str, ch->interface->name);  		/* log warning only */  	} @@ -696,7 +692,7 @@ void assert_action_a4(struct pim_ifchannel *ch)  		if (PIM_DEBUG_PIM_EVENTS)  			zlog_warn(  				"%s: channel%s not in PIM_IFASSERT_NOINFO state as expected", -				__PRETTY_FUNCTION__, ch->sg_str); +				__func__, ch->sg_str);  	}  } @@ -715,7 +711,7 @@ void assert_action_a5(struct pim_ifchannel *ch)  		if (PIM_DEBUG_PIM_EVENTS)  			zlog_warn(  				"%s: channel%s not in PIM_IFSSERT_NOINFO state as expected", -				__PRETTY_FUNCTION__, ch->sg_str); +				__func__, ch->sg_str);  	}  } @@ -747,6 +743,6 @@ static void assert_action_a6(struct pim_ifchannel *ch,  		if (PIM_DEBUG_PIM_EVENTS)  			zlog_warn(  				"%s: channel%s not in PIM_IFASSERT_I_AM_LOSER state as expected", -				__PRETTY_FUNCTION__, ch->sg_str); +				__func__, ch->sg_str);  	}  } diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c index 01a7980858..f5fc1eebf6 100644 --- a/pimd/pim_bfd.c +++ b/pimd/pim_bfd.c @@ -125,7 +125,7 @@ static void pim_bfd_reg_dereg_nbr(struct pim_neighbor *nbr, int command)  		char str[INET_ADDRSTRLEN];  		pim_inet4_dump("<bfd_nbr?>", nbr->source_addr, str,  			       sizeof(str)); -		zlog_debug("%s Nbr %s %s with BFD", __PRETTY_FUNCTION__, str, +		zlog_debug("%s Nbr %s %s with BFD", __func__, str,  			   bfd_get_command_dbg_str(command));  	} @@ -199,8 +199,8 @@ void pim_bfd_if_param_set(struct interface *ifp, uint32_t min_rx,  	if (pim_ifp->bfd_info) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: interface %s has bfd_info", -				   __PRETTY_FUNCTION__, ifp->name); +			zlog_debug("%s: interface %s has bfd_info", __func__, +				   ifp->name);  	}  	if (command)  		pim_bfd_reg_dereg_all_nbr(ifp, command); diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index e14b7e058d..91fbddf939 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -145,8 +145,7 @@ static struct bsgrp_node *pim_bsm_new_bsgrp_node(struct route_table *rt,  	rn = route_node_get(rt, grp);  	if (!rn) { -		zlog_warn("%s: route node creation failed", -			  __PRETTY_FUNCTION__); +		zlog_warn("%s: route node creation failed", __func__);  		return NULL;  	}  	bsgrp = XCALLOC(MTYPE_PIM_BSGRP_NODE, sizeof(struct bsgrp_node)); @@ -180,7 +179,7 @@ static int pim_on_bs_timer(struct thread *t)  	if (PIM_DEBUG_BSM)  		zlog_debug("%s: Bootstrap Timer expired for scope: %d", -			   __PRETTY_FUNCTION__, scope->sz_id); +			   __func__, scope->sz_id);  	/* Remove next hop tracking for the bsr */  	nht_p.family = AF_INET; @@ -189,7 +188,7 @@ static int pim_on_bs_timer(struct thread *t)  	if (PIM_DEBUG_BSM) {  		prefix2str(&nht_p, buf, sizeof(buf));  		zlog_debug("%s: Deregister BSR addr %s with Zebra NHT", -			   __PRETTY_FUNCTION__, buf); +			   __func__, buf);  	}  	pim_delete_tracked_nexthop(scope->pim, &nht_p, NULL, NULL,  				   is_bsr_tracking); @@ -209,8 +208,7 @@ static int pim_on_bs_timer(struct thread *t)  		bsgrp_node = (struct bsgrp_node *)rn->info;  		if (!bsgrp_node) {  			if (PIM_DEBUG_BSM) -				zlog_debug("%s: bsgrp_node is null", -					   __PRETTY_FUNCTION__); +				zlog_debug("%s: bsgrp_node is null", __func__);  			continue;  		}  		/* Give grace time for rp to continue for another hold time */ @@ -231,8 +229,8 @@ static int pim_on_bs_timer(struct thread *t)  static void pim_bs_timer_stop(struct bsm_scope *scope)  {  	if (PIM_DEBUG_BSM) -		zlog_debug("%s : BS timer being stopped of sz: %d", -			   __PRETTY_FUNCTION__, scope->sz_id); +		zlog_debug("%s : BS timer being stopped of sz: %d", __func__, +			   scope->sz_id);  	THREAD_OFF(scope->bs_timer);  } @@ -240,14 +238,14 @@ static void pim_bs_timer_start(struct bsm_scope *scope, int bs_timeout)  {  	if (!scope) {  		if (PIM_DEBUG_BSM) -			zlog_debug("%s : Invalid scope(NULL).", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s : Invalid scope(NULL).", __func__);  		return;  	}  	THREAD_OFF(scope->bs_timer);  	if (PIM_DEBUG_BSM) -		zlog_debug("%s : starting bs timer for scope %d with timeout %d secs", -			   __PRETTY_FUNCTION__, scope->sz_id, bs_timeout); +		zlog_debug( +			"%s : starting bs timer for scope %d with timeout %d secs", +			__func__, scope->sz_id, bs_timeout);  	thread_add_timer(router->master, pim_on_bs_timer, scope, bs_timeout,  			 &scope->bs_timer);  } @@ -376,8 +374,7 @@ static void pim_g2rp_timer_start(struct bsm_rpinfo *bsrp, int hold_time)  {  	if (!bsrp) {  		if (PIM_DEBUG_BSM) -			zlog_debug("%s : Invalid brsp(NULL).", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s : Invalid brsp(NULL).", __func__);  		return;  	}  	THREAD_OFF(bsrp->g2rp_timer); @@ -386,8 +383,7 @@ static void pim_g2rp_timer_start(struct bsm_rpinfo *bsrp, int hold_time)  		zlog_debug(  			"%s : starting g2rp timer for grp: %s - rp: %s with timeout  %d secs(Actual Hold time : %d secs)", -			__PRETTY_FUNCTION__, -			prefix2str(&bsrp->bsgrp_node->group, buf, 48), +			__func__, prefix2str(&bsrp->bsgrp_node->group, buf, 48),  			inet_ntoa(bsrp->rp_address), hold_time,  			bsrp->rp_holdtime);  	} @@ -411,7 +407,7 @@ static void pim_g2rp_timer_stop(struct bsm_rpinfo *bsrp)  		char buf[48];  		zlog_debug("%s : stopping g2rp timer for grp: %s - rp: %s", -			   __PRETTY_FUNCTION__, +			   __func__,  			   prefix2str(&bsrp->bsgrp_node->group, buf, 48),  			   inet_ntoa(bsrp->rp_address));  	} @@ -466,8 +462,7 @@ static void pim_instate_pend_list(struct bsgrp_node *bsgrp_node)  	if (!rn || (prefix_same(&rp_all->group, &bsgrp_node->group)  		    && pim_rpf_addr_is_inaddr_none(&rp_all->rp))) {  		if (PIM_DEBUG_BSM) -			zlog_debug("%s: Route node doesn't exist", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Route node doesn't exist", __func__);  		if (pend)  			pim_rp_new(pim, pend->rp_address, bsgrp_node->group,  				   NULL, RP_SRC_BSR); @@ -507,7 +502,7 @@ static void pim_instate_pend_list(struct bsgrp_node *bsgrp_node)  			if (PIM_DEBUG_BSM) {  				zlog_debug(  					"%s: Both bsrp and partial list are empty", -					__PRETTY_FUNCTION__); +					__func__);  			}  			pim_free_bsgrp_node(bsgrp_node->scope->bsrp_table,  					    &bsgrp_node->group); @@ -523,7 +518,7 @@ static void pim_instate_pend_list(struct bsgrp_node *bsgrp_node)  					    &bsgrp_node->group);  			if (PIM_DEBUG_BSM) {  				zlog_debug("%s:Pend List is null,del grp node", -					   __PRETTY_FUNCTION__); +					   __func__);  			}  			pim_free_bsgrp_data(bsgrp_node);  			return; @@ -540,7 +535,7 @@ static void pim_instate_pend_list(struct bsgrp_node *bsgrp_node)  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s: Partial list is empty, static rp exists", -					__PRETTY_FUNCTION__); +					__func__);  			pim_free_bsgrp_node(bsgrp_node->scope->bsrp_table,  					    &bsgrp_node->group);  			pim_free_bsgrp_data(bsgrp_node); @@ -587,8 +582,8 @@ static bool pim_bsr_rpf_check(struct pim_instance *pim, struct in_addr bsr,  			char bsr_str[INET_ADDRSTRLEN];  			pim_inet4_dump("<bsr?>", bsr, bsr_str, sizeof(bsr_str)); -			zlog_debug("%s : No route to BSR address %s", -				   __PRETTY_FUNCTION__, bsr_str); +			zlog_debug("%s : No route to BSR address %s", __func__, +				   bsr_str);  		}  		return false;  	} @@ -634,7 +629,7 @@ static void pim_bsm_update(struct pim_instance *pim, struct in_addr bsr,  				prefix2str(&nht_p, buf, sizeof(buf));  				zlog_debug(  					"%s: Deregister BSR addr %s with Zebra NHT", -					__PRETTY_FUNCTION__, buf); +					__func__, buf);  			}  			pim_delete_tracked_nexthop(pim, &nht_p, NULL, NULL,  						   is_bsr_tracking); @@ -645,7 +640,7 @@ static void pim_bsm_update(struct pim_instance *pim, struct in_addr bsr,  			prefix2str(&nht_p, buf, sizeof(buf));  			zlog_debug(  				"%s: NHT Register BSR addr %s with Zebra NHT", -				__PRETTY_FUNCTION__, buf); +				__func__, buf);  		}  		memset(&pnc, 0, sizeof(struct pim_nexthop_cache)); @@ -670,21 +665,21 @@ static bool pim_bsm_send_intf(uint8_t *buf, int len, struct interface *ifp,  	if (!pim_ifp) {  		if (PIM_DEBUG_BSM)  			zlog_debug("%s: Pim interface not available for %s", -				   __PRETTY_FUNCTION__, ifp->name); +				   __func__, ifp->name);  		return false;  	}  	if (pim_ifp->pim_sock_fd == -1) {  		if (PIM_DEBUG_BSM)  			zlog_debug("%s: Pim sock not available for %s", -				   __PRETTY_FUNCTION__, ifp->name); +				   __func__, ifp->name);  		return false;  	}  	if (pim_msg_send(pim_ifp->pim_sock_fd, pim_ifp->primary_address,  			 dst_addr, buf, len, ifp->name)) {  		zlog_warn("%s: Could not send BSM message on interface: %s", -			  __PRETTY_FUNCTION__, ifp->name); +			  __func__, ifp->name);  		return false;  	} @@ -715,11 +710,11 @@ static bool pim_bsm_frag_send(uint8_t *buf, uint32_t len, struct interface *ifp,  	if (pim_mtu < (PIM_MIN_BSM_LEN)) {  		zlog_warn(  			"%s: mtu(pim mtu: %d) size less than minimum bootstrap len", -			__PRETTY_FUNCTION__, pim_mtu); +			__func__, pim_mtu);  		if (PIM_DEBUG_BSM)  			zlog_debug(  				"%s: mtu (pim mtu:%d) less than minimum bootstrap len", -				__PRETTY_FUNCTION__, pim_mtu); +				__func__, pim_mtu);  		return false;  	} @@ -886,8 +881,7 @@ static void pim_bsm_fwd_whole_sz(struct pim_instance *pim, uint8_t *buf,  						dst_addr, no_fwd);  			if (PIM_DEBUG_BSM)  				zlog_debug("%s: pim_bsm_frag_send returned %s", -					   __PRETTY_FUNCTION__, -					   ret ? "TRUE" : "FALSE"); +					   __func__, ret ? "TRUE" : "FALSE");  		} else {  			pim_msg_build_header(buf, len, PIM_MSG_TYPE_BOOTSTRAP,  					     no_fwd); @@ -895,7 +889,7 @@ static void pim_bsm_fwd_whole_sz(struct pim_instance *pim, uint8_t *buf,  				if (PIM_DEBUG_BSM)  					zlog_debug(  						"%s: pim_bsm_send_intf returned false", -						__PRETTY_FUNCTION__); +						__func__);  			}  		}  	} @@ -997,7 +991,7 @@ struct bsgrp_node *pim_bsm_get_bsgrp_node(struct bsm_scope *scope,  	if (!rn) {  		if (PIM_DEBUG_BSM)  			zlog_debug("%s: Route node doesn't exist for the group", -				   __PRETTY_FUNCTION__); +				   __func__);  		return NULL;  	}  	bsgrp = rn->info; @@ -1063,12 +1057,12 @@ static bool pim_install_bsm_grp_rp(struct pim_instance *pim,  		if (PIM_DEBUG_BSM)  			zlog_debug(  				"%s, bs_rpinfo node added to the partial bs_rplist.\r\n", -				__PRETTY_FUNCTION__); +				__func__);  		return true;  	}  	if (PIM_DEBUG_BSM) -		zlog_debug("%s: list node not added\n", __PRETTY_FUNCTION__); +		zlog_debug("%s: list node not added\n", __func__);  	XFREE(MTYPE_PIM_BSRP_NODE, bsm_rpinfo);  	return false; @@ -1087,7 +1081,7 @@ static void pim_update_pending_rp_cnt(struct bsm_scope *sz,  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s,Received a new BSM ,so clear the pending bs_rpinfo list.\r\n", -					__PRETTY_FUNCTION__); +					__func__);  			list_delete_all_node(bsgrp->partial_bsrp_list);  			bsgrp->pend_rp_cnt = total_rp_count;  		} @@ -1114,7 +1108,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s: buflen received %d is less than the internal data structure of the packet would suggest", -					__PRETTY_FUNCTION__, buflen); +					__func__, buflen);  			return false;  		}  		/* Extract Group tlv from BSM */ @@ -1127,7 +1121,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  				       sizeof(grp_str));  			zlog_debug(  				"%s, Group %s  Rpcount:%d Fragment-Rp-count:%d\r\n", -				__PRETTY_FUNCTION__, grp_str, grpinfo.rp_count, +				__func__, grp_str, grpinfo.rp_count,  				grpinfo.frag_rp_count);  		} @@ -1142,7 +1136,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  					       grp_str, sizeof(grp_str));  				zlog_debug(  					"%s, Rp count is zero for group: %s\r\n", -					__PRETTY_FUNCTION__, grp_str); +					__func__, grp_str);  			}  			return false;  		} @@ -1150,8 +1144,9 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  		group.family = AF_INET;  		if (grpinfo.group.mask > IPV4_MAX_BITLEN) {  			if (PIM_DEBUG_BSM) -				zlog_debug("%s, v4 prefix length specified: %d is too long", -					   __PRETTY_FUNCTION__, grpinfo.group.mask); +				zlog_debug( +					"%s, v4 prefix length specified: %d is too long", +					__func__, grpinfo.group.mask);  			return false;  		}  		group.prefixlen = grpinfo.group.mask; @@ -1164,7 +1159,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s, Create new  BSM Group node.\r\n", -					__PRETTY_FUNCTION__); +					__func__);  			/* create a new node to be added to the tree. */  			bsgrp = pim_bsm_new_bsgrp_node(scope->bsrp_table, @@ -1173,7 +1168,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  			if (!bsgrp) {  				zlog_debug(  					"%s, Failed to get the BSM group node.\r\n", -					__PRETTY_FUNCTION__); +					__func__);  				continue;  			} @@ -1191,7 +1186,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  				if (PIM_DEBUG_BSM)  					zlog_debug(  						"%s, buflen received: %u is less than the internal data structure of the packet would suggest", -						__PRETTY_FUNCTION__, buflen); +						__func__, buflen);  				return false;  			} @@ -1208,8 +1203,8 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  					       rp_str, sizeof(rp_str));  				zlog_debug(  					"%s, Rp address - %s; pri:%d hold:%d\r\n", -					__PRETTY_FUNCTION__, rp_str, -					rpinfo.rp_pri, rpinfo.rp_holdtime); +					__func__, rp_str, rpinfo.rp_pri, +					rpinfo.rp_holdtime);  			}  			/* Call Install api to update grp-rp mappings */ @@ -1223,7 +1218,7 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf,  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s, Recvd all the rps for this group, so bsrp list with penidng rp list.", -					__PRETTY_FUNCTION__); +					__func__);  			/* replace the bsrp_list with pending list */  			pim_instate_pend_list(bsgrp);  		} @@ -1249,7 +1244,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  	if (!pim_ifp) {  		if (PIM_DEBUG_BSM)  			zlog_debug("%s: multicast not enabled on interface %s", -				   __PRETTY_FUNCTION__, ifp->name); +				   __func__, ifp->name);  		return -1;  	} @@ -1259,8 +1254,8 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  	/* Drop if bsm processing is disabled on interface */  	if (!pim_ifp->bsm_enable) { -		zlog_warn("%s: BSM not enabled on interface %s", -			  __PRETTY_FUNCTION__, ifp->name); +		zlog_warn("%s: BSM not enabled on interface %s", __func__, +			  ifp->name);  		pim_ifp->pim_ifstat_bsm_cfg_miss++;  		pim->bsm_dropped++;  		return -1; @@ -1268,8 +1263,9 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  	if (buf_size < (PIM_MSG_HEADER_LEN + sizeof(struct bsm_hdr))) {  		if (PIM_DEBUG_BSM) -			zlog_debug("%s: received buffer length of %d which is too small to properly decode", -				   __PRETTY_FUNCTION__, buf_size); +			zlog_debug( +				"%s: received buffer length of %d which is too small to properly decode", +				__func__, buf_size);  		return -1;  	} @@ -1291,7 +1287,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s : Administratively scoped range BSM received", -					__PRETTY_FUNCTION__); +					__func__);  			pim_ifp->pim_ifstat_bsm_invalid_sz++;  			pim->bsm_dropped++;  			return -1; @@ -1302,7 +1298,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  	if (!is_preferred_bsr(pim, bshdr->bsr_addr.addr, bshdr->bsr_prio)) {  		if (PIM_DEBUG_BSM)  			zlog_debug("%s : Received a non-preferred BSM", -				   __PRETTY_FUNCTION__); +				   __func__);  		pim->bsm_dropped++;  		return -1;  	} @@ -1316,7 +1312,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s : nofwd_bsm received on %s when accpt_nofwd_bsm false", -					__PRETTY_FUNCTION__, bsr_str); +					__func__, bsr_str);  			pim->bsm_dropped++;  			pim_ifp->pim_ifstat_ucast_bsm_cfg_miss++;  			return -1; @@ -1331,7 +1327,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  				if (PIM_DEBUG_BSM)  					zlog_debug(  						"%s : RPF check fail for BSR address %s", -						__PRETTY_FUNCTION__, bsr_str); +						__func__, bsr_str);  				pim->bsm_dropped++;  				return -1;  			} @@ -1345,7 +1341,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  			if (PIM_DEBUG_BSM)  				zlog_debug(  					"%s : Unicast BSM not enabled on interface %s", -					__PRETTY_FUNCTION__, ifp->name); +					__func__, ifp->name);  			pim_ifp->pim_ifstat_ucast_bsm_cfg_miss++;  			pim->bsm_dropped++;  			return -1; @@ -1354,15 +1350,14 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  	} else {  		if (PIM_DEBUG_BSM)  			zlog_debug("%s : Invalid destination address", -				   __PRETTY_FUNCTION__); +				   __func__);  		pim->bsm_dropped++;  		return -1;  	}  	if (empty_bsm) {  		if (PIM_DEBUG_BSM) -			zlog_debug("%s : Empty Pref BSM received", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s : Empty Pref BSM received", __func__);  	}  	/* Parse Update bsm rp table and install/uninstall rp if required */  	if (!pim_bsm_parse_install_g2rp( @@ -1371,8 +1366,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  		    (buf_size - PIM_BSM_HDR_LEN - PIM_MSG_HEADER_LEN),  		    frag_tag)) {  		if (PIM_DEBUG_BSM) { -			zlog_debug("%s, Parsing BSM failed.\r\n", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s, Parsing BSM failed.\r\n", __func__);  		}  		pim->bsm_dropped++;  		return -1; @@ -1385,7 +1379,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,  	if (pim_ifp->pim->global_scope.bsm_frag_tag != frag_tag) {  		if (PIM_DEBUG_BSM) {  			zlog_debug("%s: Current frag tag: %d Frag teg rcvd: %d", -				   __PRETTY_FUNCTION__, +				   __func__,  				   pim_ifp->pim->global_scope.bsm_frag_tag,  				   frag_tag);  		} diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 93af0b92b5..85ce41ef35 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -7415,7 +7415,7 @@ static void igmp_sock_query_interval_reconfig(struct igmp_sock *igmp)  		pim_inet4_dump("<ifaddr?>", igmp->ifaddr, ifaddr_str,  			       sizeof(ifaddr_str));  		zlog_debug("%s: Querier %s on %s reconfig query_interval=%d", -			   __PRETTY_FUNCTION__, ifaddr_str, ifp->name, +			   __func__, ifaddr_str, ifp->name,  			   pim_ifp->igmp_default_query_interval);  	} diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c index 34c5eb43bc..ecdb3a34a7 100644 --- a/pimd/pim_hello.c +++ b/pimd/pim_hello.c @@ -154,7 +154,7 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  	struct list *hello_option_addr_list = 0;  	if (PIM_DEBUG_PIM_HELLO) -		on_trace(__PRETTY_FUNCTION__, ifp, src_addr); +		on_trace(__func__, ifp, src_addr);  	pim_ifp = ifp->info;  	zassert(pim_ifp); @@ -180,8 +180,8 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_debug(  					"%s: short PIM hello TLV size=%d < min=%d from %s on interface %s", -					__PRETTY_FUNCTION__, remain, -					PIM_TLV_MIN_SIZE, src_str, ifp->name); +					__func__, remain, PIM_TLV_MIN_SIZE, +					src_str, ifp->name);  			}  			FREE_ADDR_LIST_THEN_RETURN(-1);  		} @@ -198,9 +198,9 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_debug(  					"%s: long PIM hello TLV type=%d length=%d > left=%td from %s on interface %s", -					__PRETTY_FUNCTION__, option_type, -					option_len, tlv_pastend - tlv_curr, -					src_str, ifp->name); +					__func__, option_type, option_len, +					tlv_pastend - tlv_curr, src_str, +					ifp->name);  			}  			FREE_ADDR_LIST_THEN_RETURN(-2);  		} @@ -211,8 +211,8 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  				       sizeof(src_str));  			zlog_debug(  				"%s: parse left_size=%d: PIM hello TLV type=%d length=%d from %s on %s", -				__PRETTY_FUNCTION__, remain, option_type, -				option_len, src_str, ifp->name); +				__func__, remain, option_type, option_len, +				src_str, ifp->name);  		}  		switch (option_type) { @@ -264,8 +264,8 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_debug(  					"%s: ignoring PIM hello dense-mode state refresh TLV option type=%d length=%d from %s on interface %s", -					__PRETTY_FUNCTION__, option_type, -					option_len, src_str, ifp->name); +					__func__, option_type, option_len, +					src_str, ifp->name);  			}  			break;  		default: @@ -275,8 +275,8 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_debug(  					"%s: ignoring unknown PIM hello TLV type=%d length=%d from %s on interface %s", -					__PRETTY_FUNCTION__, option_type, -					option_len, src_str, ifp->name); +					__func__, option_type, option_len, +					src_str, ifp->name);  			}  		} @@ -288,44 +288,38 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  	*/  	if (PIM_DEBUG_PIM_HELLO) { -		tlv_trace_uint16(__PRETTY_FUNCTION__, "holdtime", ifp->name, -				 src_addr, +		tlv_trace_uint16(__func__, "holdtime", ifp->name, src_addr,  				 PIM_OPTION_IS_SET(hello_options,  						   PIM_OPTION_MASK_HOLDTIME),  				 hello_option_holdtime);  		tlv_trace_uint16( -			__PRETTY_FUNCTION__, "propagation_delay", ifp->name, -			src_addr, +			__func__, "propagation_delay", ifp->name, src_addr,  			PIM_OPTION_IS_SET(hello_options,  					  PIM_OPTION_MASK_LAN_PRUNE_DELAY),  			hello_option_propagation_delay);  		tlv_trace_uint16( -			__PRETTY_FUNCTION__, "override_interval", ifp->name, -			src_addr, +			__func__, "override_interval", ifp->name, src_addr,  			PIM_OPTION_IS_SET(hello_options,  					  PIM_OPTION_MASK_LAN_PRUNE_DELAY),  			hello_option_override_interval);  		tlv_trace_bool( -			__PRETTY_FUNCTION__, "can_disable_join_suppression", -			ifp->name, src_addr, +			__func__, "can_disable_join_suppression", ifp->name, +			src_addr,  			PIM_OPTION_IS_SET(hello_options,  					  PIM_OPTION_MASK_LAN_PRUNE_DELAY),  			PIM_OPTION_IS_SET(  				hello_options,  				PIM_OPTION_MASK_CAN_DISABLE_JOIN_SUPPRESSION)); -		tlv_trace_uint32(__PRETTY_FUNCTION__, "dr_priority", ifp->name, -				 src_addr, +		tlv_trace_uint32(__func__, "dr_priority", ifp->name, src_addr,  				 PIM_OPTION_IS_SET(hello_options,  						   PIM_OPTION_MASK_DR_PRIORITY),  				 hello_option_dr_priority);  		tlv_trace_uint32_hex( -			__PRETTY_FUNCTION__, "generation_id", ifp->name, -			src_addr, +			__func__, "generation_id", ifp->name, src_addr,  			PIM_OPTION_IS_SET(hello_options,  					  PIM_OPTION_MASK_GENERATION_ID),  			hello_option_generation_id); -		tlv_trace_list(__PRETTY_FUNCTION__, "address_list", ifp->name, -			       src_addr, +		tlv_trace_list(__func__, "address_list", ifp->name, src_addr,  			       PIM_OPTION_IS_SET(hello_options,  						 PIM_OPTION_MASK_ADDRESS_LIST),  			       hello_option_addr_list); @@ -338,7 +332,7 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  				       sizeof(src_str));  			zlog_debug(  				"%s: PIM hello missing holdtime from %s on interface %s", -				__PRETTY_FUNCTION__, src_str, ifp->name); +				__func__, src_str, ifp->name);  		}  	} @@ -363,16 +357,16 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_warn(  					"%s: failure creating PIM neighbor %s on interface %s", -					__PRETTY_FUNCTION__, src_str, -					ifp->name); +					__func__, src_str, ifp->name);  			}  			FREE_ADDR_LIST_THEN_RETURN(-8);  		}  		/* Forward BSM if required */  		if (!pim_bsm_new_nbr_fwd(neigh, ifp)) {  			if (PIM_DEBUG_PIM_HELLO) -				zlog_debug("%s: forwarding bsm to new nbr failed", -					   __PRETTY_FUNCTION__); +				zlog_debug( +					"%s: forwarding bsm to new nbr failed", +					__func__);  		}  		/* actual addr list has been saved under neighbor */ @@ -396,8 +390,7 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_debug(  					"%s: GenId mismatch new=%08x old=%08x: replacing neighbor %s on %s", -					__PRETTY_FUNCTION__, -					hello_option_generation_id, +					__func__, hello_option_generation_id,  					neigh->generation_id, src_str,  					ifp->name);  			} @@ -422,16 +415,16 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,  						       sizeof(src_str));  					zlog_debug(  						"%s: failure re-creating PIM neighbor %s on interface %s", -						__PRETTY_FUNCTION__, src_str, -						ifp->name); +						__func__, src_str, ifp->name);  				}  				FREE_ADDR_LIST_THEN_RETURN(-9);  			}  			/* Forward BSM if required */  			if (!pim_bsm_new_nbr_fwd(neigh, ifp)) {  				if (PIM_DEBUG_PIM_HELLO) -					zlog_debug("%s: forwarding bsm to new nbr failed", -						   __PRETTY_FUNCTION__); +					zlog_debug( +						"%s: forwarding bsm to new nbr failed", +						__func__);  			}  			/* actual addr list is saved under neighbor */  			return 0; @@ -473,7 +466,7 @@ int pim_hello_build_tlv(struct interface *ifp, uint8_t *tlv_buf,  		if (PIM_DEBUG_PIM_HELLO) {  			zlog_debug(  				"%s: could not set PIM hello Holdtime option for interface %s", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		}  		return -1;  	} @@ -486,7 +479,7 @@ int pim_hello_build_tlv(struct interface *ifp, uint8_t *tlv_buf,  		if (PIM_DEBUG_PIM_HELLO) {  			zlog_debug(  				"%s: could not set PIM LAN Prune Delay option for interface %s", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		}  		return -1;  	} @@ -502,7 +495,7 @@ int pim_hello_build_tlv(struct interface *ifp, uint8_t *tlv_buf,  		if (PIM_DEBUG_PIM_HELLO) {  			zlog_debug(  				"%s: could not set PIM hello DR Priority option for interface %s", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		}  		return -2;  	} @@ -515,7 +508,7 @@ int pim_hello_build_tlv(struct interface *ifp, uint8_t *tlv_buf,  		if (PIM_DEBUG_PIM_HELLO) {  			zlog_debug(  				"%s: could not set PIM hello Generation ID option for interface %s", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		}  		return -3;  	} @@ -528,7 +521,7 @@ int pim_hello_build_tlv(struct interface *ifp, uint8_t *tlv_buf,  			if (PIM_DEBUG_PIM_HELLO) {  				zlog_debug(  					"%s: could not set PIM hello v4 Secondary Address List option for interface %s", -					__PRETTY_FUNCTION__, ifp->name); +					__func__, ifp->name);  			}  			return -4;  		} @@ -539,7 +532,7 @@ int pim_hello_build_tlv(struct interface *ifp, uint8_t *tlv_buf,  				if (PIM_DEBUG_PIM_HELLO) {  					zlog_debug(  						"%s: could not sent PIM hello v6 secondary Address List option for interface %s", -						__PRETTY_FUNCTION__, ifp->name); +						__func__, ifp->name);  				}  				return -4;  			} diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 8cc720c535..16eea1d6df 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -314,9 +314,9 @@ static int detect_primary_address_change(struct interface *ifp,  			       sizeof(new_prim_str));  		pim_inet4_dump("<old?>", pim_ifp->primary_address, old_prim_str,  			       sizeof(old_prim_str)); -		zlog_debug("%s: old=%s new=%s on interface %s: %s", -			   __PRETTY_FUNCTION__, old_prim_str, new_prim_str, -			   ifp->name, changed ? "changed" : "unchanged"); +		zlog_debug("%s: old=%s new=%s on interface %s: %s", __func__, +			   old_prim_str, new_prim_str, ifp->name, +			   changed ? "changed" : "unchanged");  	}  	if (changed) { @@ -487,8 +487,7 @@ int pim_update_source_set(struct interface *ifp, struct in_addr source)  	}  	pim_ifp->update_source = source; -	detect_address_change(ifp, 0 /* force_prim_as_any */, -			      __PRETTY_FUNCTION__); +	detect_address_change(ifp, 0 /* force_prim_as_any */, __func__);  	return PIM_SUCCESS;  } @@ -712,13 +711,13 @@ void pim_if_addr_del(struct connected *ifc, int force_prim_as_any)  		char buf[BUFSIZ];  		prefix2str(ifc->address, buf, BUFSIZ);  		zlog_debug("%s: %s ifindex=%d disconnected IP address %s %s", -			   __PRETTY_FUNCTION__, ifp->name, ifp->ifindex, buf, +			   __func__, ifp->name, ifp->ifindex, buf,  			   CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY)  				   ? "secondary"  				   : "primary");  	} -	detect_address_change(ifp, force_prim_as_any, __PRETTY_FUNCTION__); +	detect_address_change(ifp, force_prim_as_any, __func__);  	pim_if_addr_del_igmp(ifc);  	pim_if_addr_del_pim(ifc); @@ -947,14 +946,14 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term)  	if (pim_ifp->mroute_vif_index > 0) {  		zlog_warn("%s: vif_index=%d > 0 on interface %s ifindex=%d", -			  __PRETTY_FUNCTION__, pim_ifp->mroute_vif_index, -			  ifp->name, ifp->ifindex); +			  __func__, pim_ifp->mroute_vif_index, ifp->name, +			  ifp->ifindex);  		return -1;  	}  	if (ifp->ifindex < 0) { -		zlog_warn("%s: ifindex=%d < 1 on interface %s", -			  __PRETTY_FUNCTION__, ifp->ifindex, ifp->name); +		zlog_warn("%s: ifindex=%d < 1 on interface %s", __func__, +			  ifp->ifindex, ifp->name);  		return -2;  	} @@ -962,7 +961,7 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term)  	if (!ispimreg && !is_vxlan_term && PIM_INADDR_IS_ANY(ifaddr)) {  		zlog_warn(  			"%s: could not get address for interface %s ifindex=%d", -			__PRETTY_FUNCTION__, ifp->name, ifp->ifindex); +			__func__, ifp->name, ifp->ifindex);  		return -4;  	} @@ -971,7 +970,7 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term)  	if (pim_ifp->mroute_vif_index >= MAXVIFS) {  		zlog_warn(  			"%s: Attempting to configure more than MAXVIFS=%d on pim enabled interface %s", -			__PRETTY_FUNCTION__, MAXVIFS, ifp->name); +			__func__, MAXVIFS, ifp->name);  		return -3;  	} @@ -1001,8 +1000,8 @@ int pim_if_del_vif(struct interface *ifp)  	if (pim_ifp->mroute_vif_index < 1) {  		zlog_warn("%s: vif_index=%d < 1 on interface %s ifindex=%d", -			  __PRETTY_FUNCTION__, pim_ifp->mroute_vif_index, -			  ifp->name, ifp->ifindex); +			  __func__, pim_ifp->mroute_vif_index, ifp->name, +			  ifp->ifindex);  		return -1;  	} @@ -1223,8 +1222,8 @@ static int igmp_join_sock(const char *ifname, ifindex_t ifindex,  			       sizeof(source_str));  		zlog_warn(  			"%s: setsockopt(fd=%d) failure for IGMP group %s source %s ifindex %d on interface %s: errno=%d: %s", -			__PRETTY_FUNCTION__, join_fd, group_str, source_str, -			ifindex, ifname, errno, safe_strerror(errno)); +			__func__, join_fd, group_str, source_str, ifindex, +			ifname, errno, safe_strerror(errno));  		close(join_fd);  		return -2; @@ -1256,7 +1255,7 @@ static struct igmp_join *igmp_join_new(struct interface *ifp,  			       sizeof(source_str));  		zlog_warn(  			"%s: igmp_join_sock() failure for IGMP group %s source %s on interface %s", -			__PRETTY_FUNCTION__, group_str, source_str, ifp->name); +			__func__, group_str, source_str, ifp->name);  		return 0;  	} @@ -1308,7 +1307,7 @@ ferr_r pim_if_igmp_join_add(struct interface *ifp, struct in_addr group_addr,  			       sizeof(source_str));  		zlog_debug(  			"%s: issued static igmp join for channel (S,G)=(%s,%s) on interface %s", -			__PRETTY_FUNCTION__, source_str, group_str, ifp->name); +			__func__, source_str, group_str, ifp->name);  	}  	return ferr_ok(); @@ -1323,14 +1322,14 @@ int pim_if_igmp_join_del(struct interface *ifp, struct in_addr group_addr,  	pim_ifp = ifp->info;  	if (!pim_ifp) { -		zlog_warn("%s: multicast not enabled on interface %s", -			  __PRETTY_FUNCTION__, ifp->name); +		zlog_warn("%s: multicast not enabled on interface %s", __func__, +			  ifp->name);  		return -1;  	}  	if (!pim_ifp->igmp_join_list) { -		zlog_warn("%s: no IGMP join on interface %s", -			  __PRETTY_FUNCTION__, ifp->name); +		zlog_warn("%s: no IGMP join on interface %s", __func__, +			  ifp->name);  		return -2;  	} @@ -1344,7 +1343,7 @@ int pim_if_igmp_join_del(struct interface *ifp, struct in_addr group_addr,  			       sizeof(source_str));  		zlog_warn(  			"%s: could not find IGMP group %s source %s on interface %s", -			__PRETTY_FUNCTION__, group_str, source_str, ifp->name); +			__func__, group_str, source_str, ifp->name);  		return -3;  	} @@ -1357,8 +1356,8 @@ int pim_if_igmp_join_del(struct interface *ifp, struct in_addr group_addr,  			       sizeof(source_str));  		zlog_warn(  			"%s: failure closing sock_fd=%d for IGMP group %s source %s on interface %s: errno=%d: %s", -			__PRETTY_FUNCTION__, ij->sock_fd, group_str, source_str, -			ifp->name, errno, safe_strerror(errno)); +			__func__, ij->sock_fd, group_str, source_str, ifp->name, +			errno, safe_strerror(errno));  		/* warning only */  	}  	listnode_delete(pim_ifp->igmp_join_list, ij); @@ -1546,8 +1545,8 @@ int pim_ifp_create(struct interface *ifp)  	if (PIM_DEBUG_ZEBRA) {  		zlog_debug(  			"%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d", -			__PRETTY_FUNCTION__, ifp->name, ifp->ifindex, -			ifp->vrf_id, (long)ifp->flags, ifp->metric, ifp->mtu, +			__func__, ifp->name, ifp->ifindex, ifp->vrf_id, +			(long)ifp->flags, ifp->metric, ifp->mtu,  			if_is_operative(ifp));  	} @@ -1599,8 +1598,8 @@ int pim_ifp_up(struct interface *ifp)  	if (PIM_DEBUG_ZEBRA) {  		zlog_debug(  			"%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d", -			__PRETTY_FUNCTION__, ifp->name, ifp->ifindex, -			ifp->vrf_id, (long)ifp->flags, ifp->metric, ifp->mtu, +			__func__, ifp->name, ifp->ifindex, ifp->vrf_id, +			(long)ifp->flags, ifp->metric, ifp->mtu,  			if_is_operative(ifp));  	} @@ -1636,7 +1635,7 @@ int pim_ifp_up(struct interface *ifp)  				if (!master) {  					zlog_debug(  						"%s: Unable to find Master interface for %s", -						__PRETTY_FUNCTION__, vrf->name); +						__func__, vrf->name);  					return 0;  				}  				pim_zebra_interface_set_master(master, ifp); @@ -1651,8 +1650,8 @@ int pim_ifp_down(struct interface *ifp)  	if (PIM_DEBUG_ZEBRA) {  		zlog_debug(  			"%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d", -			__PRETTY_FUNCTION__, ifp->name, ifp->ifindex, -			ifp->vrf_id, (long)ifp->flags, ifp->metric, ifp->mtu, +			__func__, ifp->name, ifp->ifindex, ifp->vrf_id, +			(long)ifp->flags, ifp->metric, ifp->mtu,  			if_is_operative(ifp));  	} @@ -1687,8 +1686,8 @@ int pim_ifp_destroy(struct interface *ifp)  	if (PIM_DEBUG_ZEBRA) {  		zlog_debug(  			"%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d", -			__PRETTY_FUNCTION__, ifp->name, ifp->ifindex, -			ifp->vrf_id, (long)ifp->flags, ifp->metric, ifp->mtu, +			__func__, ifp->name, ifp->ifindex, ifp->vrf_id, +			(long)ifp->flags, ifp->metric, ifp->mtu,  			if_is_operative(ifp));  	} diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 2ea1f4e9a4..f3975a3879 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -231,8 +231,7 @@ void pim_ifchannel_delete_all(struct interface *ifp)  	while (!RB_EMPTY(pim_ifchannel_rb, &pim_ifp->ifchannel_rb)) {  		ch = RB_ROOT(pim_ifchannel_rb, &pim_ifp->ifchannel_rb); -		pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, -				ch, PIM_IFJOIN_NOINFO); +		pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_NOINFO);  		pim_ifchannel_delete(ch);  	}  } @@ -438,7 +437,7 @@ struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,  	if (!pim_ifp) {  		zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s", -			  __PRETTY_FUNCTION__, pim_str_sg_dump(sg), ifp->name); +			  __func__, pim_str_sg_dump(sg), ifp->name);  		return NULL;  	} @@ -459,7 +458,7 @@ static void ifmembership_set(struct pim_ifchannel *ch,  	if (PIM_DEBUG_PIM_EVENTS) {  		zlog_debug("%s: (S,G)=%s membership now is %s on interface %s", -			   __PRETTY_FUNCTION__, ch->sg_str, +			   __func__, ch->sg_str,  			   membership == PIM_IFMEMBERSHIP_INCLUDE ? "INCLUDE"  								  : "NOINFO",  			   ch->interface->name); @@ -564,8 +563,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,  	RB_INSERT(pim_ifchannel_rb, &pim_ifp->ifchannel_rb, ch); -	up = pim_upstream_add(pim_ifp->pim, sg, NULL, up_flags, -			      __PRETTY_FUNCTION__, ch); +	up = pim_upstream_add(pim_ifp->pim, sg, NULL, up_flags, __func__, ch);  	ch->upstream = up; @@ -591,7 +589,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,  		PIM_IF_FLAG_UNSET_ASSERT_TRACKING_DESIRED(ch->flags);  	if (PIM_DEBUG_PIM_TRACE) -		zlog_debug("%s: ifchannel %s is created ", __PRETTY_FUNCTION__, +		zlog_debug("%s: ifchannel %s is created ", __func__,  			   ch->sg_str);  	return ch; @@ -600,7 +598,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,  static void ifjoin_to_noinfo(struct pim_ifchannel *ch, bool ch_del)  {  	pim_forward_stop(ch, !ch_del); -	pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, ch, PIM_IFJOIN_NOINFO); +	pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_NOINFO);  	if (ch_del)  		delete_on_noinfo(ch);  } @@ -612,7 +610,7 @@ static int on_ifjoin_expiry_timer(struct thread *t)  	ch = THREAD_ARG(t);  	if (PIM_DEBUG_PIM_TRACE) -		zlog_debug("%s: ifchannel %s expiry timer", __PRETTY_FUNCTION__, +		zlog_debug("%s: ifchannel %s expiry timer", __func__,  			   ch->sg_str);  	ifjoin_to_noinfo(ch, true); @@ -633,7 +631,7 @@ static int on_ifjoin_prune_pending_timer(struct thread *t)  	if (PIM_DEBUG_PIM_TRACE)  		zlog_debug(  			"%s: IFCHANNEL%s %s Prune Pending Timer Popped", -			__PRETTY_FUNCTION__, pim_str_sg_dump(&ch->sg), +			__func__, pim_str_sg_dump(&ch->sg),  			pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->flags));  	if (ch->ifjoin_state == PIM_IFJOIN_PRUNE_PENDING) { @@ -695,8 +693,8 @@ static void check_recv_upstream(int is_join, struct interface *recv_ifp,  	if (pim_rpf_addr_is_inaddr_any(&up->rpf)) {  		/* RPF'(S,G) not found */ -		zlog_warn("%s %s: RPF'%s not found", __FILE__, -			  __PRETTY_FUNCTION__, up->sg_str); +		zlog_warn("%s %s: RPF'%s not found", __FILE__, __func__, +			  up->sg_str);  		return;  	} @@ -709,8 +707,8 @@ static void check_recv_upstream(int is_join, struct interface *recv_ifp,  			      sizeof(rpf_str));  		zlog_warn(  			"%s %s: (S,G)=%s upstream=%s not directed to RPF'(S,G)=%s on interface %s", -			__FILE__, __PRETTY_FUNCTION__, up->sg_str, up_str, -			rpf_str, recv_ifp->name); +			__FILE__, __func__, up->sg_str, up_str, rpf_str, +			recv_ifp->name);  		return;  	}  	/* upstream directed to RPF'(S,G) */ @@ -761,7 +759,7 @@ static int nonlocal_upstream(int is_join, struct interface *recv_ifp,  		char up_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str));  		zlog_warn("%s: recv %s (S,G)=%s to non-local upstream=%s on %s", -			  __PRETTY_FUNCTION__, is_join ? "join" : "prune", +			  __func__, is_join ? "join" : "prune",  			  pim_str_sg_dump(sg), up_str, recv_ifp->name);  	} @@ -778,8 +776,7 @@ static int nonlocal_upstream(int is_join, struct interface *recv_ifp,  static void pim_ifchannel_ifjoin_handler(struct pim_ifchannel *ch,  		struct pim_interface *pim_ifp)  { -	pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, ch, -			PIM_IFJOIN_JOIN); +	pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_JOIN);  	PIM_IF_FLAG_UNSET_S_G_RPT(ch->flags);  	/* check if the interface qualifies as an immediate  	 * OIF @@ -833,8 +830,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr,  		pim_inet4_dump("<neigh?>", neigh_addr, neigh_str,  			       sizeof(neigh_str));  		zlog_warn("%s: Assert Loser recv Join%s from %s on %s", -			  __PRETTY_FUNCTION__, ch->sg_str, neigh_str, -			  ifp->name); +			  __func__, ch->sg_str, neigh_str, ifp->name);  		assert_action_a5(ch);  	} @@ -844,8 +840,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr,  	switch (ch->ifjoin_state) {  	case PIM_IFJOIN_NOINFO: -		pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, ch, -					    PIM_IFJOIN_JOIN); +		pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_JOIN);  		if (pim_macro_chisin_oiflist(ch)) {  			pim_upstream_inherited_olist(pim_ifp->pim,  						     ch->upstream); @@ -861,7 +856,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr,  			 & PIM_UPSTREAM_FLAG_MASK_SRC_LHR)) {  			pim_upstream_ref(ch->upstream,  					 PIM_UPSTREAM_FLAG_MASK_SRC_LHR, -					 __PRETTY_FUNCTION__); +					 __func__);  			pim_upstream_keep_alive_timer_start(  				ch->upstream, pim_ifp->pim->keep_alive_time);  		} @@ -903,7 +898,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr,  		break;  	case PIM_IFJOIN_PRUNE:  		if (source_flags & PIM_ENCODE_RPT_BIT) -			pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, ch, +			pim_ifchannel_ifjoin_switch(__func__, ch,  						    PIM_IFJOIN_NOINFO);  		else  			pim_ifchannel_ifjoin_handler(ch, pim_ifp); @@ -912,7 +907,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr,  		THREAD_OFF(ch->t_ifjoin_prune_pending_timer);  		if (source_flags & PIM_ENCODE_RPT_BIT) {  			THREAD_OFF(ch->t_ifjoin_expiry_timer); -			pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, ch, +			pim_ifchannel_ifjoin_switch(__func__, ch,  						    PIM_IFJOIN_NOINFO);  		} else {  			pim_ifchannel_ifjoin_handler(ch, pim_ifp); @@ -948,8 +943,8 @@ void pim_ifchannel_prune(struct interface *ifp, struct in_addr upstream,  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug(  				"%s: Received prune with no relevant ifchannel %s%s state: %d", -				__PRETTY_FUNCTION__, ifp->name, -				pim_str_sg_dump(sg), source_flags); +				__func__, ifp->name, pim_str_sg_dump(sg), +				source_flags);  		return;  	} @@ -995,7 +990,7 @@ void pim_ifchannel_prune(struct interface *ifp, struct in_addr upstream,  	case PIM_IFJOIN_JOIN:  		THREAD_OFF(ch->t_ifjoin_expiry_timer); -		pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, ch, +		pim_ifchannel_ifjoin_switch(__func__, ch,  					    PIM_IFJOIN_PRUNE_PENDING);  		if (listcount(pim_ifp->pim_neighbor_list) > 1) @@ -1214,9 +1209,8 @@ void pim_ifchannel_update_could_assert(struct pim_ifchannel *ch)  		pim_inet4_dump("<src?>", ch->sg.src, src_str, sizeof(src_str));  		pim_inet4_dump("<grp?>", ch->sg.grp, grp_str, sizeof(grp_str));  		zlog_debug("%s: CouldAssert(%s,%s,%s) changed from %d to %d", -			   __PRETTY_FUNCTION__, src_str, grp_str, -			   ch->interface->name, old_couldassert, -			   new_couldassert); +			   __func__, src_str, grp_str, ch->interface->name, +			   old_couldassert, new_couldassert);  	}  	if (new_couldassert) { @@ -1263,8 +1257,7 @@ void pim_ifchannel_update_my_assert_metric(struct pim_ifchannel *ch)  			       new_addr_str, sizeof(new_addr_str));  		zlog_debug(  			"%s: my_assert_metric(%s,%s,%s) changed from %u,%u,%u,%s to %u,%u,%u,%s", -			__PRETTY_FUNCTION__, src_str, grp_str, -			ch->interface->name, +			__func__, src_str, grp_str, ch->interface->name,  			ch->ifassert_my_metric.rpt_bit_flag,  			ch->ifassert_my_metric.metric_preference,  			ch->ifassert_my_metric.route_metric, old_addr_str, @@ -1298,8 +1291,8 @@ void pim_ifchannel_update_assert_tracking_desired(struct pim_ifchannel *ch)  		pim_inet4_dump("<grp?>", ch->sg.grp, grp_str, sizeof(grp_str));  		zlog_debug(  			"%s: AssertTrackingDesired(%s,%s,%s) changed from %d to %d", -			__PRETTY_FUNCTION__, src_str, grp_str, -			ch->interface->name, old_atd, new_atd); +			__func__, src_str, grp_str, ch->interface->name, +			old_atd, new_atd);  	}  	if (new_atd) { diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index 39ef706f79..8d39d7e800 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -64,9 +64,8 @@ static int igmp_sock_open(struct in_addr ifaddr, struct interface *ifp,  		} else {  			zlog_warn(  				"%s %s: IGMP socket fd=%d interface %s: could not solve %s to group address: errno=%d: %s", -				__FILE__, __PRETTY_FUNCTION__, fd, -				inet_ntoa(ifaddr), PIM_ALL_ROUTERS, errno, -				safe_strerror(errno)); +				__FILE__, __func__, fd, inet_ntoa(ifaddr), +				PIM_ALL_ROUTERS, errno, safe_strerror(errno));  		}  	} @@ -81,7 +80,7 @@ static int igmp_sock_open(struct in_addr ifaddr, struct interface *ifp,  	} else {  		zlog_warn(  			"%s %s: IGMP socket fd=%d interface %s: could not solve %s to group address: errno=%d: %s", -			__FILE__, __PRETTY_FUNCTION__, fd, inet_ntoa(ifaddr), +			__FILE__, __func__, fd, inet_ntoa(ifaddr),  			PIM_ALL_SYSTEMS, errno, safe_strerror(errno));  	} @@ -92,7 +91,7 @@ static int igmp_sock_open(struct in_addr ifaddr, struct interface *ifp,  	} else {  		zlog_warn(  			"%s %s: IGMP socket fd=%d interface %s: could not solve %s to group address: errno=%d: %s", -			__FILE__, __PRETTY_FUNCTION__, fd, inet_ntoa(ifaddr), +			__FILE__, __func__, fd, inet_ntoa(ifaddr),  			PIM_ALL_IGMP_ROUTERS, errno, safe_strerror(errno));  	} @@ -119,8 +118,8 @@ static void igmp_sock_dump(array_t *igmp_sock_array)  		struct igmp_sock *igmp = array_get(igmp_sock_array, i);  		zlog_debug("%s %s: [%d/%d] igmp_addr=%s fd=%d", __FILE__, -			   __PRETTY_FUNCTION__, i, size, -			   inet_ntoa(igmp->ifaddr), igmp->fd); +			   __func__, i, size, inet_ntoa(igmp->ifaddr), +			   igmp->fd);  	}  }  #endif @@ -166,8 +165,7 @@ static int pim_igmp_other_querier_expire(struct thread *t)  		char ifaddr_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<ifaddr?>", igmp->ifaddr, ifaddr_str,  			       sizeof(ifaddr_str)); -		zlog_debug("%s: Querier %s resuming", __PRETTY_FUNCTION__, -			   ifaddr_str); +		zlog_debug("%s: Querier %s resuming", __func__, ifaddr_str);  	}  	/* @@ -419,7 +417,7 @@ static int igmp_v1_recv_report(struct igmp_sock *igmp, struct in_addr from,  	struct igmp_group *group;  	struct in_addr group_addr; -	on_trace(__PRETTY_FUNCTION__, igmp->interface, from); +	on_trace(__func__, igmp->interface, from);  	if (igmp->mtrace_only)  		return 0; @@ -435,8 +433,7 @@ static int igmp_v1_recv_report(struct igmp_sock *igmp, struct in_addr from,  	igmp->rx_stats.report_v1++;  	if (PIM_DEBUG_IGMP_TRACE) { -		zlog_warn("%s %s: FIXME WRITEME", __FILE__, -			  __PRETTY_FUNCTION__); +		zlog_warn("%s %s: FIXME WRITEME", __FILE__, __func__);  	}  	memcpy(&group_addr, igmp_msg + 4, sizeof(struct in_addr)); @@ -1014,9 +1011,8 @@ static int igmp_group_timer(struct thread *t)  		char group_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<group?>", group->group_addr, group_str,  			       sizeof(group_str)); -		zlog_debug("%s: Timer for group %s on interface %s", -			   __PRETTY_FUNCTION__, group_str, -			   group->group_igmp_sock->interface->name); +		zlog_debug("%s: Timer for group %s on interface %s", __func__, +			   group_str, group->group_igmp_sock->interface->name);  	}  	zassert(group->group_filtermode_isexcl); @@ -1108,7 +1104,7 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,  	if (!pim_is_group_224_4(group_addr)) {  		zlog_warn("%s: Group Specified is not part of 224.0.0.0/4", -			  __PRETTY_FUNCTION__); +			  __func__);  		return NULL;  	} @@ -1116,7 +1112,7 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,  		if (PIM_DEBUG_IGMP_TRACE)  			zlog_debug(  				"%s: Group specified %s is part of 224.0.0.0/24", -				__PRETTY_FUNCTION__, inet_ntoa(group_addr)); +				__func__, inet_ntoa(group_addr));  		return NULL;  	}  	/* diff --git a/pimd/pim_igmp_mtrace.c b/pimd/pim_igmp_mtrace.c index 309b8c1495..1cecd976cd 100644 --- a/pimd/pim_igmp_mtrace.c +++ b/pimd/pim_igmp_mtrace.c @@ -132,8 +132,8 @@ static bool mtrace_fwd_info(struct pim_instance *pim,  	if (!up->rpf.source_nexthop.interface) {  		if (PIM_DEBUG_TRACE) -			zlog_debug("%s: up %s RPF is not present", -			__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  		return false;  	} diff --git a/pimd/pim_igmpv2.c b/pimd/pim_igmpv2.c index 19c3768813..af598d040d 100644 --- a/pimd/pim_igmpv2.c +++ b/pimd/pim_igmpv2.c @@ -109,7 +109,7 @@ int igmp_v2_recv_report(struct igmp_sock *igmp, struct in_addr from,  	struct in_addr group_addr;  	char group_str[INET_ADDRSTRLEN]; -	on_trace(__PRETTY_FUNCTION__, igmp->interface, from); +	on_trace(__func__, igmp->interface, from);  	if (igmp->mtrace_only)  		return 0; @@ -158,7 +158,7 @@ int igmp_v2_recv_leave(struct igmp_sock *igmp, struct in_addr from,  	struct in_addr group_addr;  	char group_str[INET_ADDRSTRLEN]; -	on_trace(__PRETTY_FUNCTION__, igmp->interface, from); +	on_trace(__func__, igmp->interface, from);  	if (igmp->mtrace_only)  		return 0; diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 2d58340c8c..d63269da9f 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -126,7 +126,7 @@ static int igmp_source_timer(struct thread *t)  			       sizeof(source_str));  		zlog_debug(  			"%s: Source timer expired for group %s source %s on %s", -			__PRETTY_FUNCTION__, group_str, source_str, +			__func__, group_str, source_str,  			group->group_igmp_sock->interface->name);  	} @@ -332,8 +332,7 @@ void igmp_source_free(struct igmp_source *source)  static void source_channel_oil_detach(struct igmp_source *source)  {  	if (source->source_channel_oil) { -		pim_channel_oil_del(source->source_channel_oil, -				    __PRETTY_FUNCTION__); +		pim_channel_oil_del(source->source_channel_oil, __func__);  		source->source_channel_oil = NULL;  	}  } @@ -378,7 +377,7 @@ void igmp_source_delete(struct igmp_source *source)  			       sizeof(source_str));  		zlog_warn(  			"%s: forwarding=ON(!) IGMP source %s for group %s from socket %d interface %s", -			__PRETTY_FUNCTION__, source_str, group_str, +			__func__, source_str, group_str,  			group->group_igmp_sock->fd,  			group->group_igmp_sock->interface->name);  		/* warning only */ @@ -545,8 +544,8 @@ void igmpv3_report_isin(struct igmp_sock *igmp, struct in_addr from,  			struct in_addr group_addr, int num_sources,  			struct in_addr *sources)  { -	on_trace(__PRETTY_FUNCTION__, igmp->interface, from, group_addr, -		 num_sources, sources); +	on_trace(__func__, igmp->interface, from, group_addr, num_sources, +		 sources);  	allow(igmp, from, group_addr, num_sources, sources);  } @@ -654,8 +653,7 @@ void igmpv3_report_isex(struct igmp_sock *igmp, struct in_addr from,  	struct interface *ifp = igmp->interface;  	struct igmp_group *group; -	on_trace(__PRETTY_FUNCTION__, ifp, from, group_addr, num_sources, -		 sources); +	on_trace(__func__, ifp, from, group_addr, num_sources, sources);  	if (pim_is_group_filtered(ifp->info, &group_addr))  		return; @@ -774,8 +772,7 @@ void igmpv3_report_toin(struct igmp_sock *igmp, struct in_addr from,  	struct interface *ifp = igmp->interface;  	struct igmp_group *group; -	on_trace(__PRETTY_FUNCTION__, ifp, from, group_addr, num_sources, -		 sources); +	on_trace(__func__, ifp, from, group_addr, num_sources, sources);  	/*  	 * If the requested filter mode is INCLUDE *and* the requested source @@ -937,8 +934,7 @@ void igmpv3_report_toex(struct igmp_sock *igmp, struct in_addr from,  	struct interface *ifp = igmp->interface;  	struct igmp_group *group; -	on_trace(__PRETTY_FUNCTION__, ifp, from, group_addr, num_sources, -		 sources); +	on_trace(__func__, ifp, from, group_addr, num_sources, sources);  	/* non-existant group is created as INCLUDE {empty} */  	group = igmp_add_group_by_addr(igmp, group_addr); @@ -964,8 +960,8 @@ void igmpv3_report_allow(struct igmp_sock *igmp, struct in_addr from,  			 struct in_addr group_addr, int num_sources,  			 struct in_addr *sources)  { -	on_trace(__PRETTY_FUNCTION__, igmp->interface, from, group_addr, -		 num_sources, sources); +	on_trace(__func__, igmp->interface, from, group_addr, num_sources, +		 sources);  	allow(igmp, from, group_addr, num_sources, sources);  } @@ -1469,8 +1465,7 @@ void igmpv3_report_block(struct igmp_sock *igmp, struct in_addr from,  	struct interface *ifp = igmp->interface;  	struct igmp_group *group; -	on_trace(__PRETTY_FUNCTION__, ifp, from, group_addr, num_sources, -		 sources); +	on_trace(__func__, ifp, from, group_addr, num_sources, sources);  	/* non-existant group is created as INCLUDE {empty} */  	group = igmp_add_group_by_addr(igmp, group_addr); @@ -1524,7 +1519,7 @@ void igmp_group_timer_lower_to_lmqt(struct igmp_group *group)  			       sizeof(group_str));  		zlog_debug(  			"%s: group %s on %s: LMQC=%d LMQI=%d dsec LMQT=%d msec", -			__PRETTY_FUNCTION__, group_str, ifname, lmqc, lmqi_dsec, +			__func__, group_str, ifname, lmqc, lmqi_dsec,  			lmqt_msec);  	} @@ -1564,8 +1559,8 @@ void igmp_source_timer_lower_to_lmqt(struct igmp_source *source)  			       sizeof(source_str));  		zlog_debug(  			"%s: group %s source %s on %s: LMQC=%d LMQI=%d dsec LMQT=%d msec", -			__PRETTY_FUNCTION__, group_str, source_str, ifname, -			lmqc, lmqi_dsec, lmqt_msec); +			__func__, group_str, source_str, ifname, lmqc, +			lmqi_dsec, lmqt_msec);  	}  	igmp_source_timer_on(group, source, lmqt_msec); @@ -1593,8 +1588,7 @@ void igmp_v3_send_query(struct igmp_group *group, int fd, const char *ifname,  		flog_err(  			EC_LIB_DEVELOPMENT,  			"%s %s: unable to send: msg_size=%zd larger than query_buf_size=%d", -			__FILE__, __PRETTY_FUNCTION__, msg_size, -			query_buf_size); +			__FILE__, __func__, msg_size, query_buf_size);  		return;  	} @@ -1691,7 +1685,7 @@ void igmp_v3_send_query(struct igmp_group *group, int fd, const char *ifname,  				       sizeof(group_str));  			zlog_warn(  				"%s: to %s on %s: group=%s sources=%d: s_flag is clear for general query!", -				__PRETTY_FUNCTION__, dst_str, ifname, group_str, +				__func__, dst_str, ifname, group_str,  				num_sources);  		}  	} diff --git a/pimd/pim_instance.c b/pimd/pim_instance.c index 955ad14b01..347b0fc284 100644 --- a/pimd/pim_instance.c +++ b/pimd/pim_instance.c @@ -101,7 +101,7 @@ static struct pim_instance *pim_instance_init(struct vrf *vrf)  					 hash_name);  	if (PIM_DEBUG_ZEBRA) -		zlog_debug("%s: NHT rpf hash init ", __PRETTY_FUNCTION__); +		zlog_debug("%s: NHT rpf hash init ", __func__);  	pim->ssm_info = pim_ssm_init(); @@ -165,7 +165,7 @@ static int pim_vrf_enable(struct vrf *vrf)  {  	struct pim_instance *pim = (struct pim_instance *)vrf->info; -	zlog_debug("%s: for %s", __PRETTY_FUNCTION__, vrf->name); +	zlog_debug("%s: for %s", __func__, vrf->name);  	pim_mroute_socket_enable(pim); diff --git a/pimd/pim_join.c b/pimd/pim_join.c index fbb547c80e..f2cd04e453 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -64,7 +64,7 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,  			       sizeof(neigh_str));  		zlog_debug(  			"%s: join (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s", -			__PRETTY_FUNCTION__, pim_str_sg_dump(sg), +			__func__, pim_str_sg_dump(sg),  			!!(source_flags & PIM_RPT_BIT_MASK),  			!!(source_flags & PIM_WILDCARD_BIT_MASK), up_str,  			holdtime, neigh_str, ifp->name); @@ -84,8 +84,8 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,  		struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);  		if (!rp) { -			zlog_warn("%s: Lookup of RP failed for %pSG4", -				  __PRETTY_FUNCTION__, sg); +			zlog_warn("%s: Lookup of RP failed for %pSG4", __func__, +				  sg);  			return;  		}  		/* @@ -99,8 +99,9 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,  				       sizeof(received_rp));  			pim_inet4_dump("<local?>", rp->rpf_addr.u.prefix4,  				       local_rp, sizeof(local_rp)); -			zlog_warn("%s: Specified RP(%s) in join is different than our configured RP(%s)", -				  __PRETTY_FUNCTION__, received_rp, local_rp); +			zlog_warn( +				"%s: Specified RP(%s) in join is different than our configured RP(%s)", +				__func__, received_rp, local_rp);  			return;  		} @@ -126,7 +127,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,  			       sizeof(neigh_str));  		zlog_debug(  			"%s: prune (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s", -			__PRETTY_FUNCTION__, pim_str_sg_dump(sg), +			__func__, pim_str_sg_dump(sg),  			source_flags & PIM_RPT_BIT_MASK,  			source_flags & PIM_WILDCARD_BIT_MASK, up_str, holdtime,  			neigh_str, ifp->name); @@ -143,8 +144,9 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,  		if (!rp) {  			if (PIM_DEBUG_PIM_TRACE) -				zlog_debug("%s: RP for %pSG4 completely failed lookup", -					   __PRETTY_FUNCTION__, sg); +				zlog_debug( +					"%s: RP for %pSG4 completely failed lookup", +					__func__, sg);  			return;  		}  		// Ignoring Prune *,G's at the moment. @@ -184,7 +186,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,  		char src_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));  		zlog_warn("%s: pim_parse_addr_ucast() failure: from %s on %s", -			  __PRETTY_FUNCTION__, src_str, ifp->name); +			  __func__, src_str, ifp->name);  		return -1;  	}  	buf += addr_offset; @@ -195,9 +197,9 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,  	if (msg_upstream_addr.family != AF_INET) {  		char src_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); -		zlog_warn("%s: ignoring join/prune directed to unexpected addr family=%d from %s on %s", -			  __PRETTY_FUNCTION__, msg_upstream_addr.family, -			  src_str, ifp->name); +		zlog_warn( +			"%s: ignoring join/prune directed to unexpected addr family=%d from %s on %s", +			__func__, msg_upstream_addr.family, src_str, ifp->name);  		return -2;  	} @@ -207,7 +209,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,  		pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));  		zlog_warn(  			"%s: short join/prune message buffer for group list: size=%d minimum=%d from %s on %s", -			__PRETTY_FUNCTION__, remain, 4, src_str, ifp->name); +			__func__, remain, 4, src_str, ifp->name);  		return -4;  	} @@ -226,8 +228,8 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,  			       upstream_str, sizeof(upstream_str));  		zlog_debug(  			"%s: join/prune upstream=%s groups=%d holdtime=%d from %s on %s", -			__PRETTY_FUNCTION__, upstream_str, msg_num_groups, -			msg_holdtime, src_str, ifp->name); +			__func__, upstream_str, msg_num_groups, msg_holdtime, +			src_str, ifp->name);  	}  	/* Scan groups */ @@ -254,8 +256,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,  				       sizeof(src_str));  			zlog_warn(  				"%s: short join/prune buffer for source list: size=%d minimum=%d from %s on %s", -				__PRETTY_FUNCTION__, remain, 4, src_str, -				ifp->name); +				__func__, remain, 4, src_str, ifp->name);  			return -6;  		} @@ -276,7 +277,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,  				       sizeof(group_str));  			zlog_debug(  				"%s: join/prune upstream=%s group=%s/32 join_src=%d prune_src=%d from %s on %s", -				__PRETTY_FUNCTION__, upstream_str, group_str, +				__func__, upstream_str, group_str,  				msg_num_joined_sources, msg_num_pruned_sources,  				src_str, ifp->name);  		} @@ -345,8 +346,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,  					if (PIM_DEBUG_PIM_TRACE)  						zlog_debug(  							"%s: SGRpt flag is set, del inherit oif from up %s", -							__PRETTY_FUNCTION__, -							up->sg_str); +							__func__, up->sg_str);  					pim_channel_del_inherited_oif(  						up->channel_oil,  						starg_ch->interface, diff --git a/pimd/pim_macro.c b/pimd/pim_macro.c index 6691cc00d6..ea3e1a244f 100644 --- a/pimd/pim_macro.c +++ b/pimd/pim_macro.c @@ -113,8 +113,7 @@ int pim_macro_ch_lost_assert(const struct pim_ifchannel *ch)  	ifp = ch->interface;  	if (!ifp) { -		zlog_warn("%s: (S,G)=%s: null interface", __PRETTY_FUNCTION__, -			  ch->sg_str); +		zlog_warn("%s: (S,G)=%s: null interface", __func__, ch->sg_str);  		return 0; /* false */  	} @@ -125,7 +124,7 @@ int pim_macro_ch_lost_assert(const struct pim_ifchannel *ch)  	pim_ifp = ifp->info;  	if (!pim_ifp) {  		zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s", -			  __PRETTY_FUNCTION__, ch->sg_str, ifp->name); +			  __func__, ch->sg_str, ifp->name);  		return 0; /* false */  	} @@ -161,7 +160,7 @@ int pim_macro_chisin_pim_include(const struct pim_ifchannel *ch)  	if (!pim_ifp) {  		zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s", -			  __PRETTY_FUNCTION__, ch->sg_str, ch->interface->name); +			  __func__, ch->sg_str, ch->interface->name);  		return 0; /* false */  	} @@ -221,8 +220,7 @@ int pim_macro_ch_could_assert_eval(const struct pim_ifchannel *ch)  	ifp = ch->interface;  	if (!ifp) { -		zlog_warn("%s: (S,G)=%s: null interface", __PRETTY_FUNCTION__, -			  ch->sg_str); +		zlog_warn("%s: (S,G)=%s: null interface", __func__, ch->sg_str);  		return 0; /* false */  	} @@ -379,15 +377,14 @@ int pim_macro_assert_tracking_desired_eval(const struct pim_ifchannel *ch)  	ifp = ch->interface;  	if (!ifp) { -		zlog_warn("%s: (S,G)=%s: null interface", __PRETTY_FUNCTION__, -			  ch->sg_str); +		zlog_warn("%s: (S,G)=%s: null interface", __func__, ch->sg_str);  		return 0; /* false */  	}  	pim_ifp = ifp->info;  	if (!pim_ifp) {  		zlog_warn("%s: (S,G)=%s: multicast not enabled on interface %s", -			  __PRETTY_FUNCTION__, ch->sg_str, ch->interface->name); +			  __func__, ch->sg_str, ch->interface->name);  		return 0; /* false */  	} diff --git a/pimd/pim_mlag.c b/pimd/pim_mlag.c index 1c2f7c563d..cbde45abb8 100644 --- a/pimd/pim_mlag.c +++ b/pimd/pim_mlag.c @@ -186,13 +186,12 @@ static void pim_mlag_up_peer_add(struct mlag_mroute_add *msg)  		 * doesn't already exist.  		 */  		if (!PIM_UPSTREAM_FLAG_TEST_MLAG_PEER(up->flags)) -			pim_upstream_ref(up, -					PIM_UPSTREAM_FLAG_MASK_MLAG_PEER, -					__PRETTY_FUNCTION__); +			pim_upstream_ref(up, PIM_UPSTREAM_FLAG_MASK_MLAG_PEER, +					 __func__);  	} else {  		PIM_UPSTREAM_FLAG_SET_MLAG_PEER(flags); -		up = pim_upstream_add(pim, &sg, NULL /*iif*/, flags, -				__PRETTY_FUNCTION__, NULL /*if_ch*/); +		up = pim_upstream_add(pim, &sg, NULL /*iif*/, flags, __func__, +				      NULL /*if_ch*/);  		if (!up) {  			if (PIM_DEBUG_MLAG) @@ -218,7 +217,7 @@ static void pim_mlag_up_peer_deref(struct pim_instance *pim,  		return;  	PIM_UPSTREAM_FLAG_UNSET_MLAG_PEER(up->flags); -	up = pim_upstream_del(pim, up, __PRETTY_FUNCTION__); +	up = pim_upstream_del(pim, up, __func__);  	if (up)  		pim_mlag_up_df_role_elect(pim, up);  } @@ -306,7 +305,7 @@ static void pim_mlag_up_peer_del_all(void)  			 * This is the deletion of the reference added  			 * above  			 */ -			pim_upstream_del(pim, up, __PRETTY_FUNCTION__); +			pim_upstream_del(pim, up, __func__);  		}  	} diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 4afd05ab76..36b066735c 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -168,7 +168,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE_DETAIL)  			zlog_debug(  				"%s: Interface is not configured correctly to handle incoming packet: Could be !pim_ifp, !SM, !RP", -				__PRETTY_FUNCTION__); +				__func__);  		return 0;  	} @@ -181,7 +181,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE_DETAIL)  			zlog_debug(  				"%s: Received incoming packet that doesn't originate on our seg", -				__PRETTY_FUNCTION__); +				__func__);  		return 0;  	} @@ -191,8 +191,9 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,  	if (!(PIM_I_am_DR(pim_ifp))) {  		if (PIM_DEBUG_MROUTE_DETAIL) -			zlog_debug("%s: Interface is not the DR blackholing incoming traffic for %s", -				   __PRETTY_FUNCTION__, pim_str_sg_dump(&sg)); +			zlog_debug( +				"%s: Interface is not the DR blackholing incoming traffic for %s", +				__func__, pim_str_sg_dump(&sg));  		/*  		 * We are not the DR, but we are still receiving packets @@ -205,15 +206,14 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,  		 * this for future reference.  		 */  		up = pim_upstream_find_or_add( -			&sg, ifp, PIM_UPSTREAM_FLAG_MASK_SRC_NOCACHE, -			__PRETTY_FUNCTION__); -		pim_upstream_mroute_add(up->channel_oil, __PRETTY_FUNCTION__); +			&sg, ifp, PIM_UPSTREAM_FLAG_MASK_SRC_NOCACHE, __func__); +		pim_upstream_mroute_add(up->channel_oil, __func__);  		return 0;  	}  	up = pim_upstream_find_or_add(&sg, ifp, PIM_UPSTREAM_FLAG_MASK_FHR, -				      __PRETTY_FUNCTION__); +				      __func__);  	/*  	 * I moved this debug till after the actual add because @@ -221,7 +221,7 @@ static int pim_mroute_msg_nocache(int fd, struct interface *ifp,  	 */  	if (PIM_DEBUG_MROUTE) {  		zlog_debug("%s: Adding a Route %s for WHOLEPKT consumption", -			   __PRETTY_FUNCTION__, up->sg_str); +			   __func__, up->sg_str);  	}  	PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags); @@ -265,13 +265,12 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,  		if (up && PIM_UPSTREAM_FLAG_TEST_CAN_BE_LHR(up->flags)) {  			up = pim_upstream_add(pim_ifp->pim, &sg, ifp,  					      PIM_UPSTREAM_FLAG_MASK_SRC_LHR, -					      __PRETTY_FUNCTION__, NULL); +					      __func__, NULL);  			if (!up) {  				if (PIM_DEBUG_MROUTE)  					zlog_debug(  						"%s: Unable to create upstream information for %s", -						__PRETTY_FUNCTION__, -						pim_str_sg_dump(&sg)); +						__func__, pim_str_sg_dump(&sg));  				return 0;  			}  			pim_upstream_keep_alive_timer_start( @@ -281,21 +280,21 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,  			if (PIM_DEBUG_MROUTE)  				zlog_debug("%s: Creating %s upstream on LHR", -					   __PRETTY_FUNCTION__, up->sg_str); +					   __func__, up->sg_str);  			return 0;  		}  		if (PIM_DEBUG_MROUTE_DETAIL) {  			zlog_debug(  				"%s: Unable to find upstream channel WHOLEPKT%s", -				__PRETTY_FUNCTION__, pim_str_sg_dump(&sg)); +				__func__, pim_str_sg_dump(&sg));  		}  		return 0;  	}  	if (!up->rpf.source_nexthop.interface) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: up %s RPF is not present", -				__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  		return 0;  	} @@ -306,8 +305,7 @@ static int pim_mroute_msg_wholepkt(int fd, struct interface *ifp,  	if ((pim_rpf_addr_is_inaddr_none(rpg)) || (!pim_ifp)  	    || (!(PIM_I_am_DR(pim_ifp)))) {  		if (PIM_DEBUG_MROUTE) { -			zlog_debug("%s: Failed Check send packet", -				   __PRETTY_FUNCTION__); +			zlog_debug("%s: Failed Check send packet", __func__);  		}  		return 0;  	} @@ -365,8 +363,7 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE)  			zlog_debug(  				"%s: WRONGVIF (S,G)=%s could not find input interface for input_vif_index=%d", -				__PRETTY_FUNCTION__, pim_str_sg_dump(&sg), -				msg->im_vif); +				__func__, pim_str_sg_dump(&sg), msg->im_vif);  		return -1;  	} @@ -375,8 +372,7 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE)  			zlog_debug(  				"%s: WRONGVIF (S,G)=%s multicast not enabled on interface %s", -				__PRETTY_FUNCTION__, pim_str_sg_dump(&sg), -				ifp->name); +				__func__, pim_str_sg_dump(&sg), ifp->name);  		return -2;  	} @@ -386,8 +382,7 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE)  			zlog_debug(  				"%s: WRONGVIF (S,G)=%s could not find channel on interface %s", -				__PRETTY_FUNCTION__, pim_str_sg_dump(&sg), -				ifp->name); +				__func__, pim_str_sg_dump(&sg), ifp->name);  		star_g.src.s_addr = INADDR_ANY;  		ch = pim_ifchannel_find(ifp, &star_g); @@ -395,8 +390,8 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,  			if (PIM_DEBUG_MROUTE)  				zlog_debug(  					"%s: WRONGVIF (*,G)=%s could not find channel on interface %s", -					__PRETTY_FUNCTION__, -					pim_str_sg_dump(&star_g), ifp->name); +					__func__, pim_str_sg_dump(&star_g), +					ifp->name);  			return -3;  		}  	} @@ -419,7 +414,7 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE) {  			zlog_debug(  				"%s: WRONGVIF (S,G)=%s channel is not on Assert NoInfo state for interface %s", -				__PRETTY_FUNCTION__, ch->sg_str, ifp->name); +				__func__, ch->sg_str, ifp->name);  		}  		return -4;  	} @@ -428,7 +423,7 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE) {  			zlog_debug(  				"%s: WRONGVIF (S,G)=%s interface %s is not downstream for channel", -				__PRETTY_FUNCTION__, ch->sg_str, ifp->name); +				__func__, ch->sg_str, ifp->name);  		}  		return -5;  	} @@ -437,7 +432,7 @@ static int pim_mroute_msg_wrongvif(int fd, struct interface *ifp,  		if (PIM_DEBUG_MROUTE) {  			zlog_debug(  				"%s: WRONGVIF (S,G)=%s assert_action_a1 failure on interface %s", -				__PRETTY_FUNCTION__, ch->sg_str, ifp->name); +				__func__, ch->sg_str, ifp->name);  		}  		return -6;  	} @@ -521,7 +516,7 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,  			pim_upstream_inherited_olist(pim_ifp->pim, up);  			if (!up->channel_oil->installed)  				pim_upstream_mroute_add(up->channel_oil, -					       __PRETTY_FUNCTION__); +							__func__);  		} else {  			if (I_am_RP(pim_ifp->pim, up->sg.grp)) {  				if (pim_nexthop_lookup(pim_ifp->pim, &source, @@ -544,8 +539,8 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,  	pim_ifp = ifp->info;  	if (pim_if_connected_to_source(ifp, sg.src)) {  		up = pim_upstream_add(pim_ifp->pim, &sg, ifp, -				      PIM_UPSTREAM_FLAG_MASK_FHR, -				      __PRETTY_FUNCTION__, NULL); +				      PIM_UPSTREAM_FLAG_MASK_FHR, __func__, +				      NULL);  		if (!up) {  			if (PIM_DEBUG_MROUTE)  				zlog_debug( @@ -567,10 +562,9 @@ static int pim_mroute_msg_wrvifwhole(int fd, struct interface *ifp,  	} else {  		up = pim_upstream_add(pim_ifp->pim, &sg, ifp,  				      PIM_UPSTREAM_FLAG_MASK_SRC_NOCACHE, -				      __PRETTY_FUNCTION__, NULL); +				      __func__, NULL);  		if (!up->channel_oil->installed) -			pim_upstream_mroute_add(up->channel_oil, -					__PRETTY_FUNCTION__); +			pim_upstream_mroute_add(up->channel_oil, __func__);  	}  	return 0; @@ -621,8 +615,8 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,  			zlog_debug(  				"%s(%s): igmp kernel upcall on %s(%p) for %s -> %s", -				__PRETTY_FUNCTION__, pim->vrf->name, ifp->name, -				igmp, ip_src_str, ip_dst_str); +				__func__, pim->vrf->name, ifp->name, igmp, +				ip_src_str, ip_dst_str);  		}  		if (igmp)  			pim_igmp_packet(igmp, (char *)buf, buf_size); @@ -635,8 +629,8 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,  				       sizeof(grp_str));  			zlog_debug(  				"%s: no kernel upcall proto=%d src: %s dst: %s msg_size=%d", -				__PRETTY_FUNCTION__, ip_hdr->ip_p, src_str, -				grp_str, buf_size); +				__func__, ip_hdr->ip_p, src_str, grp_str, +				buf_size);  		}  	} else { @@ -653,8 +647,7 @@ static int pim_mroute_msg(struct pim_instance *pim, const char *buf,  				       sizeof(grp_str));  			zlog_debug(  				"%s: pim kernel upcall %s type=%d ip_p=%d from fd=%d for (S,G)=(%s,%s) on %s vifi=%d  size=%d", -				__PRETTY_FUNCTION__, -				igmpmsgtype2str[msg->im_msgtype], +				__func__, igmpmsgtype2str[msg->im_msgtype],  				msg->im_msgtype, ip_hdr->ip_p,  				pim->mroute_socket, src_str, grp_str, ifp->name,  				msg->im_vif, buf_size); @@ -706,9 +699,10 @@ static int mroute_read(struct thread *t)  			if (errno == EWOULDBLOCK || errno == EAGAIN)  				break; -			zlog_warn("%s: failure reading rd=%d: fd=%d: errno=%d: %s", -				  __PRETTY_FUNCTION__, rd, pim->mroute_socket, -				  errno, safe_strerror(errno)); +			zlog_warn( +				"%s: failure reading rd=%d: fd=%d: errno=%d: %s", +				__func__, rd, pim->mroute_socket, errno, +				safe_strerror(errno));  			goto done;  		} @@ -815,7 +809,7 @@ int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr,  	int err;  	if (PIM_DEBUG_MROUTE) -		zlog_debug("%s: Add Vif %d (%s[%s])", __PRETTY_FUNCTION__, +		zlog_debug("%s: Add Vif %d (%s[%s])", __func__,  			   pim_ifp->mroute_vif_index, ifp->name,  			   pim_ifp->pim->vrf->name); @@ -827,7 +821,7 @@ int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr,  	if (ifaddr.s_addr == INADDR_ANY) {  		zlog_warn(  			"%s: unnumbered interfaces are not supported on this platform", -			__PRETTY_FUNCTION__); +			__func__);  		return -1;  	}  	memcpy(&vc.vifc_lcl_addr, &ifaddr, sizeof(vc.vifc_lcl_addr)); @@ -853,9 +847,8 @@ int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr,  		zlog_warn(  			"%s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_VIF,vif_index=%d,ifaddr=%s,flag=%d): errno=%d: %s", -			__PRETTY_FUNCTION__, pim_ifp->pim->mroute_socket, -			ifp->ifindex, ifaddr_str, flags, errno, -			safe_strerror(errno)); +			__func__, pim_ifp->pim->mroute_socket, ifp->ifindex, +			ifaddr_str, flags, errno, safe_strerror(errno));  		return -2;  	} @@ -869,7 +862,7 @@ int pim_mroute_del_vif(struct interface *ifp)  	int err;  	if (PIM_DEBUG_MROUTE) -		zlog_debug("%s: Del Vif %d (%s[%s])", __PRETTY_FUNCTION__, +		zlog_debug("%s: Del Vif %d (%s[%s])", __func__,  			   pim_ifp->mroute_vif_index, ifp->name,  			   pim_ifp->pim->vrf->name); @@ -881,9 +874,8 @@ int pim_mroute_del_vif(struct interface *ifp)  	if (err) {  		zlog_warn(  			"%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_DEL_VIF,vif_index=%d): errno=%d: %s", -			__FILE__, __PRETTY_FUNCTION__, -			pim_ifp->pim->mroute_socket, pim_ifp->mroute_vif_index, -			errno, safe_strerror(errno)); +			__FILE__, __func__, pim_ifp->pim->mroute_socket, +			pim_ifp->mroute_vif_index, errno, safe_strerror(errno));  		return -2;  	} @@ -1003,15 +995,15 @@ static int pim_mroute_add(struct channel_oil *c_oil, const char *name)  	if (err) {  		zlog_warn(  			"%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_MFC): errno=%d: %s", -			__FILE__, __PRETTY_FUNCTION__, pim->mroute_socket, -			errno, safe_strerror(errno)); +			__FILE__, __func__, pim->mroute_socket, errno, +			safe_strerror(errno));  		return -2;  	}  	if (PIM_DEBUG_MROUTE) {  		char buf[1000]; -		zlog_debug("%s(%s), vrf %s Added Route: %s", -			   __PRETTY_FUNCTION__, name, pim->vrf->name, +		zlog_debug("%s(%s), vrf %s Added Route: %s", __func__, name, +			   pim->vrf->name,  			   pim_channel_oil_dump(c_oil, buf, sizeof(buf)));  	} @@ -1170,8 +1162,7 @@ int pim_mroute_del(struct channel_oil *c_oil, const char *name)  			char buf[1000];  			zlog_debug(  				"%s %s: vifi %d for route is %s not installed, do not need to send del req. ", -				__FILE__, __PRETTY_FUNCTION__, -				c_oil->oil.mfcc_parent, +				__FILE__, __func__, c_oil->oil.mfcc_parent,  				pim_channel_oil_dump(c_oil, buf, sizeof(buf)));  		}  		return -2; @@ -1183,16 +1174,15 @@ int pim_mroute_del(struct channel_oil *c_oil, const char *name)  		if (PIM_DEBUG_MROUTE)  			zlog_warn(  				"%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_DEL_MFC): errno=%d: %s", -				__FILE__, __PRETTY_FUNCTION__, -				pim->mroute_socket, errno, +				__FILE__, __func__, pim->mroute_socket, errno,  				safe_strerror(errno));  		return -2;  	}  	if (PIM_DEBUG_MROUTE) {  		char buf[1000]; -		zlog_debug("%s(%s), vrf %s Deleted Route: %s", -			   __PRETTY_FUNCTION__, name, pim->vrf->name, +		zlog_debug("%s(%s), vrf %s Deleted Route: %s", __func__, name, +			   pim->vrf->name,  			   pim_channel_oil_dump(c_oil, buf, sizeof(buf)));  	} diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index 27af9473bb..63d34e859c 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -126,7 +126,7 @@ static void pim_msdp_sa_upstream_del(struct pim_msdp_sa *sa)  	if (PIM_UPSTREAM_FLAG_TEST_SRC_MSDP(up->flags)) {  		PIM_UPSTREAM_FLAG_UNSET_SRC_MSDP(up->flags);  		sa->flags |= PIM_MSDP_SAF_UP_DEL_IN_PROG; -		up = pim_upstream_del(sa->pim, up, __PRETTY_FUNCTION__); +		up = pim_upstream_del(sa->pim, up, __func__);  		/* re-eval joinDesired; clearing peer-msdp-sa flag can  		 * cause JD to change  		 */ @@ -210,8 +210,7 @@ static void pim_msdp_sa_upstream_update(struct pim_msdp_sa *sa,  	/* RFC3618: "RP triggers a (S, G) join event towards the data source  	 * as if a JP message was rxed addressed to the RP itself." */  	up = pim_upstream_add(sa->pim, &sa->sg, NULL /* iif */, -			      PIM_UPSTREAM_FLAG_MASK_SRC_MSDP, -			      __PRETTY_FUNCTION__, NULL); +			      PIM_UPSTREAM_FLAG_MASK_SRC_MSDP, __func__, NULL);  	sa->up = up;  	if (up) { diff --git a/pimd/pim_msdp_socket.c b/pimd/pim_msdp_socket.c index 22eb8bc7b4..50489ca88c 100644 --- a/pimd/pim_msdp_socket.c +++ b/pimd/pim_msdp_socket.c @@ -243,13 +243,13 @@ int pim_msdp_sock_connect(struct pim_msdp_peer *mp)  		if (!ifp) {  			flog_err(EC_LIB_INTERFACE,  				 "%s: Unable to lookup vrf interface: %s", -				 __PRETTY_FUNCTION__, mp->pim->vrf->name); +				 __func__, mp->pim->vrf->name);  			return -1;  		}  		if (pim_socket_bind(mp->fd, ifp)) {  			flog_err_sys(EC_LIB_SOCKET,  				     "%s: Unable to bind to socket: %s", -				     __PRETTY_FUNCTION__, safe_strerror(errno)); +				     __func__, safe_strerror(errno));  			close(mp->fd);  			mp->fd = -1;  			return -1; diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 3f2aaf2bbe..ec40beec7f 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -133,8 +133,7 @@ int pim_if_dr_election(struct interface *ifp)  			pim_inet4_dump("<new_dr?>", pim_ifp->pim_dr_addr,  				       dr_new_str, sizeof(dr_new_str));  			zlog_debug("%s: DR was %s now is %s on interface %s", -				   __PRETTY_FUNCTION__, dr_old_str, dr_new_str, -				   ifp->name); +				   __func__, dr_old_str, dr_new_str, ifp->name);  		}  		pim_ifp->pim_dr_election_last = @@ -251,7 +250,7 @@ void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime)  		pim_inet4_dump("<src?>", neigh->source_addr, src_str,  			       sizeof(src_str));  		zlog_debug("%s: starting %u sec timer for neighbor %s on %s", -			   __PRETTY_FUNCTION__, neigh->holdtime, src_str, +			   __func__, neigh->holdtime, src_str,  			   neigh->interface->name);  	} @@ -269,7 +268,7 @@ static int on_neighbor_jp_timer(struct thread *t)  		pim_inet4_dump("<src?>", neigh->source_addr, src_str,  			       sizeof(src_str));  		zlog_debug("%s:Sending JP Agg to %s on %s with %d groups", -			   __PRETTY_FUNCTION__, src_str, neigh->interface->name, +			   __func__, src_str, neigh->interface->name,  			   neigh->upstream_jp_agg->count);  	} @@ -338,7 +337,7 @@ pim_neighbor_new(struct interface *ifp, struct in_addr source_addr,  	if (PIM_DEBUG_PIM_EVENTS) {  		zlog_debug("%s: creating PIM neighbor %s on interface %s", -			   __PRETTY_FUNCTION__, src_str, ifp->name); +			   __func__, src_str, ifp->name);  	}  	zlog_info("PIM NEIGHBOR UP: neighbor %s on interface %s", src_str, @@ -502,7 +501,7 @@ pim_neighbor_add(struct interface *ifp, struct in_addr source_addr,  	if (PIM_DEBUG_PIM_TRACE_DETAIL) {  		char str[INET_ADDRSTRLEN];  		pim_inet4_dump("<nht_nbr?>", source_addr, str, sizeof(str)); -		zlog_debug("%s: neighbor %s added ", __PRETTY_FUNCTION__, str); +		zlog_debug("%s: neighbor %s added ", __func__, str);  	}  	/*  	  RFC 4601: 4.3.2.  DR Election @@ -657,7 +656,7 @@ void pim_neighbor_delete(struct interface *ifp, struct pim_neighbor *neigh,  	if (PIM_DEBUG_PIM_TRACE) {  		zlog_debug("%s: deleting PIM neighbor %s on interface %s", -			   __PRETTY_FUNCTION__, src_str, ifp->name); +			   __func__, src_str, ifp->name);  	}  	// De-Register PIM Neighbor with BFD @@ -793,7 +792,7 @@ void pim_neighbor_update(struct pim_neighbor *neigh,  #ifdef DUMP_PREFIX_LIST  	zlog_debug(  		"%s: DUMP_PREFIX_LIST old_prefix_list=%x old_size=%d new_prefix_list=%x new_size=%d", -		__PRETTY_FUNCTION__, (unsigned)neigh->prefix_list, +		__func__, (unsigned)neigh->prefix_list,  		neigh->prefix_list ? (int)listcount(neigh->prefix_list) : -1,  		(unsigned)addr_list,  		addr_list ? (int)listcount(addr_list) : -1); @@ -804,7 +803,7 @@ void pim_neighbor_update(struct pim_neighbor *neigh,  			flog_err(  				EC_LIB_DEVELOPMENT,  				"%s: internal error: trying to replace same prefix list=%p", -				__PRETTY_FUNCTION__, (void *)addr_list); +				__func__, (void *)addr_list);  		}  	} else {  		/* Delete existing secondary address list */ diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index dd94918b69..289f2a2eda 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -61,7 +61,7 @@ void pim_sendmsg_zebra_rnh(struct pim_instance *pim, struct zclient *zclient,  		prefix2str(p, buf, sizeof(buf));  		zlog_debug(  			"%s: NHT %sregistered addr %s(%s) with Zebra ret:%d ", -			__PRETTY_FUNCTION__, +			__func__,  			(command == ZEBRA_NEXTHOP_REGISTER) ? " " : "de", buf,  			pim->vrf->name, ret);  	} @@ -145,7 +145,7 @@ int pim_find_or_track_nexthop(struct pim_instance *pim, struct prefix *addr,  			prefix2str(addr, buf, sizeof(buf));  			zlog_debug(  				"%s: NHT cache and zebra notification added for %s(%s)", -				__PRETTY_FUNCTION__, buf, pim->vrf->name); +				__func__, buf, pim->vrf->name);  		}  	} @@ -220,7 +220,7 @@ void pim_delete_tracked_nexthop(struct pim_instance *pim, struct prefix *addr,  			prefix2str(addr, buf, sizeof buf);  			zlog_debug(  				"%s: NHT %s(%s) rp_list count:%d upstream count:%ld", -				__PRETTY_FUNCTION__, buf, pim->vrf->name, +				__func__, buf, pim->vrf->name,  				pnc->rp_list->count, pnc->upstream_hash->count);  		} @@ -267,7 +267,7 @@ bool pim_nexthop_match(struct pim_instance *pim, struct in_addr addr,  		pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));  		zlog_warn(  			"%s %s: could not find nexthop ifindex for address %s", -			__FILE__, __PRETTY_FUNCTION__, addr_str); +			__FILE__, __func__, addr_str);  		return false;  	} @@ -283,8 +283,8 @@ bool pim_nexthop_match(struct pim_instance *pim, struct in_addr addr,  					       sizeof(addr_str));  				zlog_debug(  					"%s %s: could not find interface for ifindex %d (address %s)", -					__FILE__, __PRETTY_FUNCTION__, -					first_ifindex, addr_str); +					__FILE__, __func__, first_ifindex, +					addr_str);  			}  			i++;  			continue; @@ -298,8 +298,8 @@ bool pim_nexthop_match(struct pim_instance *pim, struct in_addr addr,  					       sizeof(addr_str));  				zlog_debug(  					"%s: multicast not enabled on input interface %s (ifindex=%d, RPF for source %s)", -					__PRETTY_FUNCTION__, ifp->name, -					first_ifindex, addr_str); +					__func__, ifp->name, first_ifindex, +					addr_str);  			}  			i++;  			continue; @@ -361,9 +361,8 @@ bool pim_nexthop_match_nht_cache(struct pim_instance *pim, struct in_addr addr,  					       sizeof(addr_str));  				zlog_debug(  					"%s %s: could not find interface for ifindex %d (address %s(%s))", -					__FILE__, __PRETTY_FUNCTION__, -					first_ifindex, addr_str, -					pim->vrf->name); +					__FILE__, __func__, first_ifindex, +					addr_str, pim->vrf->name);  			}  			nh_iter++;  			continue; @@ -376,9 +375,8 @@ bool pim_nexthop_match_nht_cache(struct pim_instance *pim, struct in_addr addr,  					       sizeof(addr_str));  				zlog_debug(  					"%s: multicast not enabled on input interface %s(%s) (ifindex=%d, RPF for source %s)", -					__PRETTY_FUNCTION__, ifp->name, -					pim->vrf->name, first_ifindex, -					addr_str); +					__func__, ifp->name, pim->vrf->name, +					first_ifindex, addr_str);  			}  			nh_iter++;  			continue; @@ -390,7 +388,7 @@ bool pim_nexthop_match_nht_cache(struct pim_instance *pim, struct in_addr addr,  				if (PIM_DEBUG_PIM_NHT)  					zlog_debug(  						"%s: pim nbr not found on input interface %s(%s)", -						__PRETTY_FUNCTION__, ifp->name, +						__func__, ifp->name,  						pim->vrf->name);  				nh_iter++;  				continue; @@ -460,12 +458,15 @@ static int pim_update_upstream_nh_helper(struct hash_bucket *bucket, void *arg)  	if (PIM_DEBUG_PIM_NHT) { -		zlog_debug("%s: NHT upstream %s(%s) old ifp %s new ifp %s", -			__PRETTY_FUNCTION__, up->sg_str, pim->vrf->name, -			old.source_nexthop.interface -			? old.source_nexthop.interface->name : "Unknown", -			up->rpf.source_nexthop.interface -			? up->rpf.source_nexthop.interface->name : "Unknown"); +		zlog_debug( +			"%s: NHT upstream %s(%s) old ifp %s new ifp %s", +			__func__, up->sg_str, pim->vrf->name, +			old.source_nexthop.interface ? old.source_nexthop +							       .interface->name +						     : "Unknown", +			up->rpf.source_nexthop.interface ? up->rpf.source_nexthop +								   .interface->name +							 : "Unknown");  	}  	return HASHWALK_CONTINUE; @@ -559,7 +560,7 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim,  					if (PIM_DEBUG_PIM_NHT)  						zlog_debug(  							"%s: current nexthop does not have nbr ", -							__PRETTY_FUNCTION__); +							__func__);  				} else {  					/* update metric even if the upstream  					 * neighbor stays unchanged @@ -581,9 +582,8 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim,  							       sizeof(grp_str));  						zlog_debug(  							"%s: (%s,%s)(%s) current nexthop %s is valid, skipping new path selection", -							__PRETTY_FUNCTION__, -							src_str, grp_str, -							pim->vrf->name, +							__func__, src_str, +							grp_str, pim->vrf->name,  							nexthop->interface->name);  					}  					return 1; @@ -633,9 +633,8 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim,  					       addr_str, sizeof(addr_str));  				zlog_debug(  					"%s %s: could not find interface for ifindex %d (address %s(%s))", -					__FILE__, __PRETTY_FUNCTION__, -					first_ifindex, addr_str, -					pim->vrf->name); +					__FILE__, __func__, first_ifindex, +					addr_str, pim->vrf->name);  			}  			if (nh_iter == mod_val)  				mod_val++; // Select nexthpath @@ -649,9 +648,8 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim,  					       addr_str, sizeof(addr_str));  				zlog_debug(  					"%s: multicast not enabled on input interface %s(%s) (ifindex=%d, RPF for source %s)", -					__PRETTY_FUNCTION__, ifp->name, -					pim->vrf->name, first_ifindex, -					addr_str); +					__func__, ifp->name, pim->vrf->name, +					first_ifindex, addr_str);  			}  			if (nh_iter == mod_val)  				mod_val++; // Select nexthpath @@ -666,7 +664,7 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim,  				if (PIM_DEBUG_PIM_NHT)  					zlog_debug(  						"%s: pim nbr not found on input interface %s(%s)", -						__PRETTY_FUNCTION__, ifp->name, +						__func__, ifp->name,  						pim->vrf->name);  				if (nh_iter == mod_val)  					mod_val++; // Select nexthpath @@ -701,9 +699,9 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim,  					buf, sizeof(buf));  				zlog_debug(  					"%s: (%s,%s)(%s) selected nhop interface %s addr %s mod_val %u iter %d ecmp %d", -					__PRETTY_FUNCTION__, buf2, buf3, -					pim->vrf->name, ifp->name, buf, mod_val, -					nh_iter, pim->ecmp_enable); +					__func__, buf2, buf3, pim->vrf->name, +					ifp->name, buf, mod_val, nh_iter, +					pim->ecmp_enable);  			}  		}  		nh_iter++; @@ -740,7 +738,7 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)  		if (PIM_DEBUG_PIM_NHT)  			zlog_debug(  				"%s: Decode of nexthop update from zebra failed", -				__PRETTY_FUNCTION__); +				__func__);  		return 0;  	} @@ -753,7 +751,7 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)  				prefix2str(&rpf.rpf_addr, buf, sizeof(buf));  				zlog_debug(  					"%s: Skipping NHT update, addr %s is not in local cached DB.", -					__PRETTY_FUNCTION__, buf); +					__func__, buf);  			}  			return 0;  		} @@ -810,8 +808,7 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)  					char buf[NEXTHOP_STRLEN];  					zlog_debug(  						"%s: could not find interface for ifindex %d(%s) (addr %s)", -						__PRETTY_FUNCTION__, -						nexthop->ifindex, +						__func__, nexthop->ifindex,  						pim->vrf->name,  						nexthop2str(nexthop, buf,  							    sizeof(buf))); @@ -826,8 +823,7 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)  				prefix2str(&nhr.prefix, p_str, sizeof(p_str));  				zlog_debug(  					"%s: NHT addr %s(%s) %d-nhop via %s(%s) type %d distance:%u metric:%u ", -					__PRETTY_FUNCTION__, p_str, -					pim->vrf->name, i + 1, +					__func__, p_str, pim->vrf->name, i + 1,  					inet_ntoa(nexthop->gate.ipv4),  					ifp->name, nexthop->type, nhr.distance,  					nhr.metric); @@ -847,7 +843,7 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)  					zlog_debug(  						"%s: multicast not enabled on input interface %s(%s) (ifindex=%d, addr %s)", -						__PRETTY_FUNCTION__, ifp->name, +						__func__, ifp->name,  						pim->vrf->name,  						nexthop->ifindex,  						nexthop2str(nexthop, buf, @@ -886,9 +882,9 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)  		prefix2str(&nhr.prefix, buf, sizeof(buf));  		zlog_debug(  			"%s: NHT Update for %s(%s) num_nh %d num_pim_nh %d vrf:%u up %ld rp %d", -			__PRETTY_FUNCTION__, buf, pim->vrf->name, -			nhr.nexthop_num, pnc->nexthop_num, vrf_id, -			pnc->upstream_hash->count, listcount(pnc->rp_list)); +			__func__, buf, pim->vrf->name, nhr.nexthop_num, +			pnc->nexthop_num, vrf_id, pnc->upstream_hash->count, +			listcount(pnc->rp_list));  	}  	pim_rpf_set_refresh_time(pim); @@ -922,7 +918,7 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,  		pim_inet4_dump("<addr?>", src->u.prefix4, addr_str,  			       sizeof(addr_str));  		zlog_debug("%s: Looking up: %s(%s), last lookup time: %lld", -			   __PRETTY_FUNCTION__, addr_str, pim->vrf->name, +			   __func__, addr_str, pim->vrf->name,  			   nexthop->last_lookup_time);  	} @@ -947,7 +943,7 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,  		if (PIM_DEBUG_PIM_NHT)  			zlog_warn(  				"%s: could not find nexthop ifindex for address %s(%s)", -				__PRETTY_FUNCTION__, addr_str, pim->vrf->name); +				__func__, addr_str, pim->vrf->name);  		return 0;  	} @@ -984,8 +980,8 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,  		hash_val = pim_compute_ecmp_hash(src, grp);  		mod_val = hash_val % consider;  		if (PIM_DEBUG_PIM_NHT_DETAIL) -			zlog_debug("%s: hash_val %u mod_val %u", -				   __PRETTY_FUNCTION__, hash_val, mod_val); +			zlog_debug("%s: hash_val %u mod_val %u", __func__, +				   hash_val, mod_val);  	}  	i = 0; @@ -997,9 +993,8 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,  			if (PIM_DEBUG_PIM_NHT)  				zlog_debug(  					"%s %s: could not find interface for ifindex %d (address %s(%s))", -					__FILE__, __PRETTY_FUNCTION__, -					first_ifindex, addr_str, -					pim->vrf->name); +					__FILE__, __func__, first_ifindex, +					addr_str, pim->vrf->name);  			if (i == mod_val)  				mod_val++;  			i++; @@ -1010,9 +1005,8 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,  			if (PIM_DEBUG_PIM_NHT)  				zlog_debug(  					"%s: multicast not enabled on input interface %s(%s) (ifindex=%d, RPF for source %s)", -					__PRETTY_FUNCTION__, ifp->name, -					pim->vrf->name, first_ifindex, -					addr_str); +					__func__, ifp->name, pim->vrf->name, +					first_ifindex, addr_str);  			if (i == mod_val)  				mod_val++;  			i++; @@ -1031,7 +1025,7 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,  				if (PIM_DEBUG_PIM_NHT)  					zlog_debug(  						"%s: NBR not found on input interface %s(%s) (RPF for source %s)", -						__PRETTY_FUNCTION__, ifp->name, +						__func__, ifp->name,  						pim->vrf->name, addr_str);  				continue;  			} @@ -1046,8 +1040,8 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,  					      nexthop_str, sizeof(nexthop_str));  				zlog_debug(  					"%s: found nhop %s for addr %s interface %s(%s) metric %d dist %d", -					__PRETTY_FUNCTION__, nexthop_str, -					addr_str, ifp->name, pim->vrf->name, +					__func__, nexthop_str, addr_str, +					ifp->name, pim->vrf->name,  					nexthop_tab[i].route_metric,  					nexthop_tab[i].protocol_distance);  			} @@ -1090,7 +1084,7 @@ int pim_ecmp_fib_lookup_if_vif_index(struct pim_instance *pim,  		if (PIM_DEBUG_PIM_NHT)  			zlog_debug(  				"%s: could not find nexthop ifindex for address %s(%s)", -				__PRETTY_FUNCTION__, addr_str, pim->vrf->name); +				__func__, addr_str, pim->vrf->name);  		return -1;  	} @@ -1098,8 +1092,7 @@ int pim_ecmp_fib_lookup_if_vif_index(struct pim_instance *pim,  	if (PIM_DEBUG_PIM_NHT)  		zlog_debug(  			"%s: found nexthop ifindex=%d (interface %s(%s)) for address %s", -			__PRETTY_FUNCTION__, ifindex, -			ifindex2ifname(ifindex, pim->vrf_id), +			__func__, ifindex, ifindex2ifname(ifindex, pim->vrf_id),  			pim->vrf->name, addr_str);  	vif_index = pim_if_find_vifindex_by_ifindex(pim, ifindex); @@ -1108,8 +1101,7 @@ int pim_ecmp_fib_lookup_if_vif_index(struct pim_instance *pim,  		if (PIM_DEBUG_PIM_NHT) {  			zlog_debug(  				"%s: low vif_index=%d(%s) < 1 nexthop for address %s", -				__PRETTY_FUNCTION__, vif_index, pim->vrf->name, -				addr_str); +				__func__, vif_index, pim->vrf->name, addr_str);  		}  		return -2;  	} diff --git a/pimd/pim_oil.c b/pimd/pim_oil.c index 598988f88f..0618308ba8 100644 --- a/pimd/pim_oil.c +++ b/pimd/pim_oil.c @@ -149,8 +149,7 @@ struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,  		if (PIM_DEBUG_MROUTE)  			zlog_debug(  				"%s(%s): Existing oil for %pSG4 Ref Count: %d (Post Increment)", -				__PRETTY_FUNCTION__, name, sg, -				c_oil->oil_ref_count); +				__func__, name, sg, c_oil->oil_ref_count);  		return c_oil;  	} @@ -183,7 +182,7 @@ struct channel_oil *pim_channel_oil_del(struct channel_oil *c_oil,  		zlog_debug(  			"%s(%s): Del oil for %pSG4, Ref Count: %d (Predecrement)", -			__PRETTY_FUNCTION__, name, &sg, c_oil->oil_ref_count); +			__func__, name, &sg, c_oil->oil_ref_count);  	}  	--c_oil->oil_ref_count; @@ -244,7 +243,7 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif,  				       sizeof(source_str));  			zlog_debug(  				"%s %s: no existing protocol mask %u(%u) for requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)", -				__FILE__, __PRETTY_FUNCTION__, proto_mask, +				__FILE__, __func__, proto_mask,  				channel_oil  					->oif_flags[pim_ifp->mroute_vif_index],  				oif->name, pim_ifp->mroute_vif_index, @@ -270,7 +269,7 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif,  				       sizeof(source_str));  			zlog_debug(  				"%s %s: other protocol masks remain for requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)", -				__FILE__, __PRETTY_FUNCTION__, oif->name, +				__FILE__, __func__, oif->name,  				pim_ifp->mroute_vif_index,  				channel_oil->oil  					.mfcc_ttls[pim_ifp->mroute_vif_index], @@ -283,7 +282,7 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif,  	/* clear mute; will be re-evaluated when the OIF becomes valid again */  	channel_oil->oif_flags[pim_ifp->mroute_vif_index] &= ~PIM_OIF_FLAG_MUTE; -	if (pim_upstream_mroute_add(channel_oil, __PRETTY_FUNCTION__)) { +	if (pim_upstream_mroute_add(channel_oil, __func__)) {  		if (PIM_DEBUG_MROUTE) {  			char group_str[INET_ADDRSTRLEN];  			char source_str[INET_ADDRSTRLEN]; @@ -295,7 +294,7 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif,  				       sizeof(source_str));  			zlog_debug(  				"%s %s: could not remove output interface %s (vif_index=%d) for channel (S,G)=(%s,%s)", -				__FILE__, __PRETTY_FUNCTION__, oif->name, +				__FILE__, __func__, oif->name,  				pim_ifp->mroute_vif_index, source_str,  				group_str);  		} @@ -313,8 +312,8 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif,  			       source_str, sizeof(source_str));  		zlog_debug(  			"%s(%s): (S,G)=(%s,%s): proto_mask=%u IIF:%d OIF=%s vif_index=%d", -			__PRETTY_FUNCTION__, caller, source_str, group_str, -			proto_mask, channel_oil->oil.mfcc_parent, oif->name, +			__func__, caller, source_str, group_str, proto_mask, +			channel_oil->oil.mfcc_parent, oif->name,  			pim_ifp->mroute_vif_index);  	} @@ -405,7 +404,7 @@ void pim_channel_update_oif_mute(struct channel_oil *c_oil,  		c_oil->oif_flags[pim_ifp->mroute_vif_index] &=  			~PIM_OIF_FLAG_MUTE; -	pim_upstream_mroute_add(c_oil, __PRETTY_FUNCTION__); +	pim_upstream_mroute_add(c_oil, __func__);  }  /* pim_upstream has been set or cleared on the c_oil. re-eval mute state @@ -455,8 +454,8 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,  				       sizeof(source_str));  			zlog_debug(  				"%s %s: existing protocol mask %u requested OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)", -				__FILE__, __PRETTY_FUNCTION__, proto_mask, -				oif->name, pim_ifp->mroute_vif_index, +				__FILE__, __func__, proto_mask, oif->name, +				pim_ifp->mroute_vif_index,  				channel_oil->oil  					.mfcc_ttls[pim_ifp->mroute_vif_index],  				source_str, group_str); @@ -489,9 +488,8 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,  					       source_str, sizeof(source_str));  				zlog_warn(  					"%s %s: new protocol mask %u requested nonexistent OIF %s (vif_index=%d, min_ttl=%d) for channel (S,G)=(%s,%s)", -					__FILE__, __PRETTY_FUNCTION__, -					proto_mask, oif->name, -					pim_ifp->mroute_vif_index, +					__FILE__, __func__, proto_mask, +					oif->name, pim_ifp->mroute_vif_index,  					channel_oil->oil.mfcc_ttls  						[pim_ifp->mroute_vif_index],  					source_str, group_str); @@ -515,7 +513,7 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,  				       sizeof(source_str));  			zlog_debug(  				"%s %s: interface %s (vif_index=%d) is existing output for channel (S,G)=(%s,%s)", -				__FILE__, __PRETTY_FUNCTION__, oif->name, +				__FILE__, __func__, oif->name,  				pim_ifp->mroute_vif_index, source_str,  				group_str);  		} @@ -541,7 +539,7 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,  	 * valid to get installed in kernel.  	 */  	if (channel_oil->oil.mfcc_parent != MAXVIFS) { -		if (pim_upstream_mroute_add(channel_oil, __PRETTY_FUNCTION__)) { +		if (pim_upstream_mroute_add(channel_oil, __func__)) {  			if (PIM_DEBUG_MROUTE) {  				char group_str[INET_ADDRSTRLEN];  				char source_str[INET_ADDRSTRLEN]; @@ -552,10 +550,10 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,  				      channel_oil->oil.mfcc_origin, source_str,  				      sizeof(source_str));  				zlog_debug( -				    "%s %s: could not add output interface %s (vif_index=%d) for channel (S,G)=(%s,%s)", -				    __FILE__, __PRETTY_FUNCTION__, oif->name, -				    pim_ifp->mroute_vif_index, source_str, -				    group_str); +					"%s %s: could not add output interface %s (vif_index=%d) for channel (S,G)=(%s,%s)", +					__FILE__, __func__, oif->name, +					pim_ifp->mroute_vif_index, source_str, +					group_str);  			}  			channel_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index] @@ -578,8 +576,8 @@ int pim_channel_add_oif(struct channel_oil *channel_oil, struct interface *oif,  			       source_str, sizeof(source_str));  		zlog_debug(  			"%s(%s): (S,G)=(%s,%s): proto_mask=%u OIF=%s vif_index=%d: DONE", -			__PRETTY_FUNCTION__, caller, source_str, group_str, -			proto_mask, oif->name, pim_ifp->mroute_vif_index); +			__func__, caller, source_str, group_str, proto_mask, +			oif->name, pim_ifp->mroute_vif_index);  	}  	return 0; diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index b367aa21f4..8d7a921cf4 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -119,7 +119,7 @@ void pim_sock_delete(struct interface *ifp, const char *delete_message)  	if (!ifp->info) {  		flog_err(EC_PIM_CONFIG,  			 "%s: %s: but PIM not enabled on interface %s (!)", -			 __PRETTY_FUNCTION__, delete_message, ifp->name); +			 __func__, delete_message, ifp->name);  		return;  	} @@ -233,7 +233,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)  			ifp->name, ip_hdr->ip_ttl, header->ver, pim_msg_len,  			checksum);  		if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { -			pim_pkt_dump(__PRETTY_FUNCTION__, pim_msg, pim_msg_len); +			pim_pkt_dump(__func__, pim_msg, pim_msg_len);  		}  	} @@ -258,8 +258,8 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)  			if (PIM_DEBUG_PIM_PACKETS)  				zlog_debug(  					"%s %s: non-hello PIM message type=%d from non-neighbor %s on %s", -					__FILE__, __PRETTY_FUNCTION__, -					header->type, src_str, ifp->name); +					__FILE__, __func__, header->type, +					src_str, ifp->name);  			return -1;  		}  		pim_neighbor_timer_reset(neigh, neigh->holdtime); @@ -273,8 +273,8 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)  			if (PIM_DEBUG_PIM_PACKETS)  				zlog_debug(  					"%s %s: non-hello PIM message type=%d from non-neighbor %s on %s", -					__FILE__, __PRETTY_FUNCTION__, -					header->type, src_str, ifp->name); +					__FILE__, __func__, header->type, +					src_str, ifp->name);  			return -1;  		}  		pim_neighbor_timer_reset(neigh, neigh->holdtime); @@ -347,15 +347,15 @@ static int pim_sock_read(struct thread *t)  			if (PIM_DEBUG_PIM_PACKETS)  				zlog_debug(  					"%s: Received incoming pim packet on interface(%s:%d) not yet configured for pim", -					__PRETTY_FUNCTION__, -					ifp ? ifp->name : "Unknown", ifindex); +					__func__, ifp ? ifp->name : "Unknown", +					ifindex);  			goto done;  		}  		int fail = pim_pim_packet(ifp, buf, len);  		if (fail) {  			if (PIM_DEBUG_PIM_PACKETS)  				zlog_debug("%s: pim_pim_packet() return=%d", -					   __PRETTY_FUNCTION__, fail); +					   __func__, fail);  			goto done;  		} @@ -519,8 +519,8 @@ static int pim_msg_send_frame(int fd, char *buf, size_t len,  					       sizeof(dst_str));  				zlog_warn(  					"%s: sendto() failure to %s: fd=%d msg_size=%zd: errno=%d: %s", -					__PRETTY_FUNCTION__, dst_str, fd, len, -					errno, safe_strerror(errno)); +					__func__, dst_str, fd, len, errno, +					safe_strerror(errno));  			}  			return -1;  		} @@ -588,9 +588,8 @@ int pim_msg_send(int fd, struct in_addr src, struct in_addr dst,  	if (PIM_DEBUG_PIM_PACKETS) {  		char dst_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<dst?>", dst, dst_str, sizeof(dst_str)); -		zlog_debug("%s: to %s on %s: msg_size=%d checksum=%x", -			   __PRETTY_FUNCTION__, dst_str, ifname, pim_msg_size, -			   header->checksum); +		zlog_debug("%s: to %s on %s: msg_size=%d checksum=%x", __func__, +			   dst_str, ifname, pim_msg_size, header->checksum);  	}  	memset(&to, 0, sizeof(to)); @@ -599,7 +598,7 @@ int pim_msg_send(int fd, struct in_addr src, struct in_addr dst,  	tolen = sizeof(to);  	if (PIM_DEBUG_PIM_PACKETDUMP_SEND) { -		pim_pkt_dump(__PRETTY_FUNCTION__, pim_msg, pim_msg_size); +		pim_pkt_dump(__func__, pim_msg, pim_msg_size);  	}  	pim_msg_send_frame(fd, (char *)buffer, sendlen, (struct sockaddr *)&to, @@ -622,7 +621,7 @@ static int hello_send(struct interface *ifp, uint16_t holdtime)  			       sizeof(dst_str));  		zlog_debug(  			"%s: to %s on %s: holdt=%u prop_d=%u overr_i=%u dis_join_supp=%d dr_prio=%u gen_id=%08x addrs=%d", -			__PRETTY_FUNCTION__, dst_str, ifp->name, holdtime, +			__func__, dst_str, ifp->name, holdtime,  			pim_ifp->pim_propagation_delay_msec,  			pim_ifp->pim_override_interval_msec,  			PIM_IF_TEST_PIM_CAN_DISABLE_JOIN_SUPRESSION( @@ -655,7 +654,7 @@ static int hello_send(struct interface *ifp, uint16_t holdtime)  		if (PIM_DEBUG_PIM_HELLO) {  			zlog_debug(  				"%s: could not send PIM message on interface %s", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		}  		return -2;  	} diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 27b3b1d9d6..19baecb9c2 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -99,7 +99,7 @@ void pim_register_stop_send(struct interface *ifp, struct prefix_sg *sg,  	pinfo = (struct pim_interface *)ifp->info;  	if (!pinfo) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: No pinfo!", __PRETTY_FUNCTION__); +			zlog_debug("%s: No pinfo!", __func__);  		return;  	}  	if (pim_msg_send(pinfo->pim_sock_fd, src, originator, buffer, @@ -107,7 +107,7 @@ void pim_register_stop_send(struct interface *ifp, struct prefix_sg *sg,  		if (PIM_DEBUG_PIM_TRACE) {  			zlog_debug(  				"%s: could not send PIM register stop message on interface %s", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		}  	}  	++pinfo->pim_ifstat_reg_stop_send; @@ -179,7 +179,7 @@ void pim_register_send(const uint8_t *buf, int buf_size, struct in_addr src,  	if (!ifp) {  		if (PIM_DEBUG_PIM_REG)  			zlog_debug("%s: No interface to transmit register on", -				   __PRETTY_FUNCTION__); +				   __func__);  		return;  	}  	pinfo = (struct pim_interface *)ifp->info; @@ -187,7 +187,7 @@ void pim_register_send(const uint8_t *buf, int buf_size, struct in_addr src,  		if (PIM_DEBUG_PIM_REG)  			zlog_debug(  				"%s: Interface: %s not configured for pim to trasmit on!\n", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		return;  	} @@ -196,8 +196,8 @@ void pim_register_send(const uint8_t *buf, int buf_size, struct in_addr src,  		strlcpy(rp_str, inet_ntoa(rpg->rpf_addr.u.prefix4),  			sizeof(rp_str));  		zlog_debug("%s: Sending %s %sRegister Packet to %s on %s", -			   __PRETTY_FUNCTION__, up->sg_str, -			   null_register ? "NULL " : "", rp_str, ifp->name); +			   __func__, up->sg_str, null_register ? "NULL " : "", +			   rp_str, ifp->name);  	}  	memset(buffer, 0, 10000); @@ -217,7 +217,7 @@ void pim_register_send(const uint8_t *buf, int buf_size, struct in_addr src,  		if (PIM_DEBUG_PIM_TRACE) {  			zlog_debug(  				"%s: could not send PIM register message on interface %s", -				__PRETTY_FUNCTION__, ifp->name); +				__func__, ifp->name);  		}  		return;  	} @@ -235,7 +235,7 @@ void pim_null_register_send(struct pim_upstream *up)  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug(  				"%s: Cannot send null-register for %s no valid iif", -				__PRETTY_FUNCTION__, up->sg_str); +				__func__, up->sg_str);  		return;  	} @@ -244,7 +244,7 @@ void pim_null_register_send(struct pim_upstream *up)  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug(  				"%s: Cannot send null-register for %s no RPF to the RP", -				__PRETTY_FUNCTION__, up->sg_str); +				__func__, up->sg_str);  		return;  	} @@ -263,7 +263,7 @@ void pim_null_register_send(struct pim_upstream *up)  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug(  					"%s: Cannot send null-register for %s vxlan-aa PIP unavailable", -					__PRETTY_FUNCTION__, up->sg_str); +					__func__, up->sg_str);  			return;  		}  	} @@ -419,8 +419,8 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,  		if (!upstream) {  			upstream = pim_upstream_add(  				pim_ifp->pim, &sg, ifp, -				PIM_UPSTREAM_FLAG_MASK_SRC_STREAM, -				__PRETTY_FUNCTION__, NULL); +				PIM_UPSTREAM_FLAG_MASK_SRC_STREAM, __func__, +				NULL);  			if (!upstream) {  				zlog_warn("Failure to create upstream state");  				return 1; diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 2db39bac4b..55b7db6a5c 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -351,8 +351,7 @@ void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up)  	if (PIM_DEBUG_PIM_TRACE)  		zlog_debug("%s: pim upstream update for  old upstream %s", -			   __PRETTY_FUNCTION__, -			   inet_ntoa(old_upstream_addr)); +			   __func__, inet_ntoa(old_upstream_addr));  	if (old_upstream_addr.s_addr == new_upstream_addr.s_addr)  		return; @@ -371,8 +370,9 @@ void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up)  			char buf[PREFIX2STR_BUFFER];  			prefix2str(&nht_p, buf, sizeof(buf)); -			zlog_debug("%s: Deregister upstream %s addr %s with Zebra NHT", -				   __PRETTY_FUNCTION__, up->sg_str, buf); +			zlog_debug( +				"%s: Deregister upstream %s addr %s with Zebra NHT", +				__func__, up->sg_str, buf);  		}  		pim_delete_tracked_nexthop(pim, &nht_p, up, NULL, false);  	} @@ -384,7 +384,7 @@ void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up)  	rpf_result = pim_rpf_update(pim, up, &old_rpf, __func__);  	if (rpf_result == PIM_RPF_FAILURE) -		pim_mroute_del(up->channel_oil, __PRETTY_FUNCTION__); +		pim_mroute_del(up->channel_oil, __func__);  	/* update kernel multicast forwarding cache (MFC) */  	if (up->rpf.source_nexthop.interface && up->channel_oil) @@ -744,8 +744,8 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,  	}  	if (PIM_DEBUG_PIM_TRACE) -		zlog_debug("%s: Delete RP %s for the group %s", -			   __PRETTY_FUNCTION__, rp_str, grp_str); +		zlog_debug("%s: Delete RP %s for the group %s", __func__, +			   rp_str, grp_str);  	/* While static RP is getting deleted, we need to check if dynamic RP  	 * present for the same group in BSM RP table, then install the dynamic @@ -764,9 +764,9 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,  						       sizeof(bsrp_str)))  						sprintf(bsrp_str, "<bsrp?>"); -					zlog_debug("%s: BSM RP %s found for the group %s", -						   __PRETTY_FUNCTION__, -						   bsrp_str, grp_str); +					zlog_debug( +						"%s: BSM RP %s found for the group %s", +						__func__, bsrp_str, grp_str);  				}  				return pim_rp_change(pim, bsrp->rp_address,  						     group, RP_SRC_BSR); @@ -775,7 +775,7 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug(  					"%s: BSM RP not found for the group %s", -					__PRETTY_FUNCTION__, grp_str); +					__func__, grp_str);  		}  	} @@ -786,8 +786,8 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,  	if (PIM_DEBUG_PIM_NHT_RP) {  		char buf[PREFIX2STR_BUFFER];  		prefix2str(&nht_p, buf, sizeof(buf)); -		zlog_debug("%s: Deregister RP addr %s with Zebra ", -			   __PRETTY_FUNCTION__, buf); +		zlog_debug("%s: Deregister RP addr %s with Zebra ", __func__, +			   buf);  	}  	pim_delete_tracked_nexthop(pim, &nht_p, NULL, rp_info, false); @@ -836,7 +836,7 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,  				zlog_debug(  					"%s:Found for Freeing: %p for rp_info: %p(%s) Lock: %d", -					__PRETTY_FUNCTION__, rn, rp_info, +					__func__, rn, rp_info,  					prefix2str(&rp_info->group, buf,  						   sizeof(buf)),  					rn->lock); @@ -924,7 +924,7 @@ int pim_rp_change(struct pim_instance *pim, struct in_addr new_rp_addr,  			prefix2str(&nht_p, buf, sizeof(buf));  			zlog_debug("%s: Deregister RP addr %s with Zebra ", -				   __PRETTY_FUNCTION__, buf); +				   __func__, buf);  		}  		pim_delete_tracked_nexthop(pim, &nht_p, NULL, rp_info, false);  	} @@ -962,7 +962,7 @@ int pim_rp_change(struct pim_instance *pim, struct in_addr new_rp_addr,  		prefix2str(&nht_p, buf, sizeof(buf));  		prefix2str(&rp_info->group, buf1, sizeof(buf1));  		zlog_debug("%s: NHT Register RP addr %s grp %s with Zebra ", -			   __PRETTY_FUNCTION__, buf, buf1); +			   __func__, buf, buf1);  	}  	pim_find_or_track_nexthop(pim, &nht_p, NULL, rp_info, false, NULL); @@ -1146,7 +1146,7 @@ struct pim_rpf *pim_rp_g(struct pim_instance *pim, struct in_addr group)  			prefix2str(&rp_info->group, buf1, sizeof(buf1));  			zlog_debug(  				"%s: NHT Register RP addr %s grp %s with Zebra", -				__PRETTY_FUNCTION__, buf, buf1); +				__func__, buf, buf1);  		}  		pim_find_or_track_nexthop(pim, &nht_p, NULL, rp_info, false,  					  NULL); @@ -1185,7 +1185,7 @@ int pim_rp_set_upstream_addr(struct pim_instance *pim, struct in_addr *up,  			 && (source.s_addr == INADDR_ANY))) {  		if (PIM_DEBUG_PIM_NHT_RP)  			zlog_debug("%s: Received a (*,G) with no RP configured", -				   __PRETTY_FUNCTION__); +				   __func__);  		up->s_addr = INADDR_ANY;  		return 0;  	} diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c index b27374e302..010ec7d745 100644 --- a/pimd/pim_rpf.c +++ b/pimd/pim_rpf.c @@ -45,7 +45,7 @@ void pim_rpf_set_refresh_time(struct pim_instance *pim)  	pim->last_route_change_time = pim_time_monotonic_usec();  	if (PIM_DEBUG_PIM_TRACE)  		zlog_debug("%s: vrf(%s) New last route change time: %" PRId64, -			   __PRETTY_FUNCTION__, pim->vrf->name, +			   __func__, pim->vrf->name,  			   pim->last_route_change_time);  } @@ -78,9 +78,9 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,  			pim_addr_dump("<nexthop?>", &nexthop->mrib_nexthop_addr,  				      nexthop_str, sizeof(nexthop_str));  			zlog_debug( -				"%s: Using last lookup for %s at %lld, %" PRId64 " addr %s", -				__PRETTY_FUNCTION__, addr_str, -				nexthop->last_lookup_time, +				"%s: Using last lookup for %s at %lld, %" PRId64 +				" addr %s", +				__func__, addr_str, nexthop->last_lookup_time,  				pim->last_route_change_time, nexthop_str);  		}  		pim->nexthop_lookups_avoided++; @@ -92,8 +92,7 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,  				       sizeof(addr_str));  			zlog_debug(  				"%s: Looking up: %s, last lookup time: %lld, %" PRId64, -				__PRETTY_FUNCTION__, addr_str, -				nexthop->last_lookup_time, +				__func__, addr_str, nexthop->last_lookup_time,  				pim->last_route_change_time);  		}  	} @@ -107,7 +106,7 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,  		pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));  		zlog_warn(  			"%s %s: could not find nexthop ifindex for address %s", -			__FILE__, __PRETTY_FUNCTION__, addr_str); +			__FILE__, __func__, addr_str);  		return false;  	} @@ -122,8 +121,8 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,  					       sizeof(addr_str));  				zlog_debug(  					"%s %s: could not find interface for ifindex %d (address %s)", -					__FILE__, __PRETTY_FUNCTION__, -					first_ifindex, addr_str); +					__FILE__, __func__, first_ifindex, +					addr_str);  			}  			i++;  			continue; @@ -136,8 +135,8 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,  					       sizeof(addr_str));  				zlog_debug(  					"%s: multicast not enabled on input interface %s (ifindex=%d, RPF for source %s)", -					__PRETTY_FUNCTION__, ifp->name, -					first_ifindex, addr_str); +					__func__, ifp->name, first_ifindex, +					addr_str);  			}  			i++;  		} else if (neighbor_needed @@ -166,8 +165,8 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,  				       sizeof(addr_str));  			zlog_debug(  				"%s %s: found nexthop %s for address %s: interface %s ifindex=%d metric=%d pref=%d", -				__FILE__, __PRETTY_FUNCTION__, nexthop_str, -				addr_str, ifp->name, first_ifindex, +				__FILE__, __func__, nexthop_str, addr_str, +				ifp->name, first_ifindex,  				nexthop_tab[i].route_metric,  				nexthop_tab[i].protocol_distance);  		} @@ -383,7 +382,7 @@ static struct in_addr pim_rpf_find_rpf_addr(struct pim_upstream *up)  	if (!up->rpf.source_nexthop.interface) {  		zlog_warn("%s: missing RPF interface for upstream (S,G)=%s", -			  __PRETTY_FUNCTION__, up->sg_str); +			  __func__, up->sg_str);  		rpf_addr.s_addr = PIM_NET_INADDR_ANY;  		return rpf_addr; @@ -415,7 +414,7 @@ int pim_rpf_addr_is_inaddr_none(struct pim_rpf *rpf)  	case AF_INET:  		return rpf->rpf_addr.u.prefix4.s_addr == INADDR_NONE;  	case AF_INET6: -		zlog_warn("%s: v6 Unimplmeneted", __PRETTY_FUNCTION__); +		zlog_warn("%s: v6 Unimplmeneted", __func__);  		return 1;  	default:  		return 0; @@ -430,7 +429,7 @@ int pim_rpf_addr_is_inaddr_any(struct pim_rpf *rpf)  	case AF_INET:  		return rpf->rpf_addr.u.prefix4.s_addr == INADDR_ANY;  	case AF_INET6: -		zlog_warn("%s: v6 Unimplmented", __PRETTY_FUNCTION__); +		zlog_warn("%s: v6 Unimplmented", __func__);  		return 1;  	default:  		return 0; diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 7f03e18389..177dab05ca 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -153,7 +153,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp,  		flog_err(  			EC_LIB_DEVELOPMENT,  			"%s %s: Missing IP_PKTINFO and IP_RECVDSTADDR: unable to get dst addr from recvmsg()", -			__FILE__, __PRETTY_FUNCTION__); +			__FILE__, __func__);  		close(fd);  		return PIM_SOCK_ERR_DSTADDR;  #endif @@ -231,8 +231,8 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp,  	}  	if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf))) -		zlog_warn("%s: Failure to set buffer size to %d", -			  __PRETTY_FUNCTION__, rcvbuf); +		zlog_warn("%s: Failure to set buffer size to %d", __func__, +			  rcvbuf);  	{  		long flags; diff --git a/pimd/pim_ssm.c b/pimd/pim_ssm.c index 6a70a73b45..8d3e04f5da 100644 --- a/pimd/pim_ssm.c +++ b/pimd/pim_ssm.c @@ -75,7 +75,7 @@ static int pim_is_grp_standard_ssm(struct prefix *group)  		if (!str2prefix(PIM_SSM_STANDARD_RANGE, &group_ssm))  			flog_err(EC_LIB_DEVELOPMENT,  				 "%s: Failure to Read Group Address: %s", -				 __PRETTY_FUNCTION__, PIM_SSM_STANDARD_RANGE); +				 __func__, PIM_SSM_STANDARD_RANGE);  		first = 0;  	} diff --git a/pimd/pim_ssmpingd.c b/pimd/pim_ssmpingd.c index 17bc375c12..f4d3547b3f 100644 --- a/pimd/pim_ssmpingd.c +++ b/pimd/pim_ssmpingd.c @@ -85,7 +85,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  	if (fd < 0) {  		flog_err_sys(EC_LIB_SOCKET,  			     "%s: could not create socket: errno=%d: %s", -			     __PRETTY_FUNCTION__, errno, safe_strerror(errno)); +			     __func__, errno, safe_strerror(errno));  		return -1;  	} @@ -98,8 +98,8 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  		pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));  		zlog_warn(  			"%s: bind(fd=%d,addr=%s,port=%d,len=%zu) failure: errno=%d: %s", -			__PRETTY_FUNCTION__, fd, addr_str, port, -			sizeof(sockaddr), errno, safe_strerror(errno)); +			__func__, fd, addr_str, port, sizeof(sockaddr), errno, +			safe_strerror(errno));  		close(fd);  		return -1;  	} @@ -112,8 +112,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  		if (setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &opt, sizeof(opt))) {  			zlog_warn(  				"%s: could not set IP_PKTINFO on socket fd=%d: errno=%d: %s", -				__PRETTY_FUNCTION__, fd, errno, -				safe_strerror(errno)); +				__func__, fd, errno, safe_strerror(errno));  		}  #elif defined(HAVE_IP_RECVDSTADDR)  		/* BSD IP_RECVDSTADDR */ @@ -122,14 +121,13 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  			       sizeof(opt))) {  			zlog_warn(  				"%s: could not set IP_RECVDSTADDR on socket fd=%d: errno=%d: %s", -				__PRETTY_FUNCTION__, fd, errno, -				safe_strerror(errno)); +				__func__, fd, errno, safe_strerror(errno));  		}  #else  		flog_err(  			EC_LIB_DEVELOPMENT,  			"%s %s: missing IP_PKTINFO and IP_RECVDSTADDR: unable to get dst addr from recvmsg()", -			__FILE__, __PRETTY_FUNCTION__); +			__FILE__, __func__);  		close(fd);  		return -1;  #endif @@ -141,8 +139,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  			       sizeof(reuse))) {  			zlog_warn(  				"%s: could not set Reuse Address Option on socket fd=%d: errno=%d: %s", -				__PRETTY_FUNCTION__, fd, errno, -				safe_strerror(errno)); +				__func__, fd, errno, safe_strerror(errno));  			close(fd);  			return -1;  		} @@ -152,8 +149,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  		       sizeof(mttl))) {  		zlog_warn(  			"%s: could not set multicast TTL=%d on socket fd=%d: errno=%d: %s", -			__PRETTY_FUNCTION__, mttl, fd, errno, -			safe_strerror(errno)); +			__func__, mttl, fd, errno, safe_strerror(errno));  		close(fd);  		return -1;  	} @@ -161,7 +157,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  	if (setsockopt_ipv4_multicast_loop(fd, 0)) {  		zlog_warn(  			"%s: could not disable Multicast Loopback Option on socket fd=%d: errno=%d: %s", -			__PRETTY_FUNCTION__, fd, errno, safe_strerror(errno)); +			__func__, fd, errno, safe_strerror(errno));  		close(fd);  		return PIM_SOCK_ERR_LOOP;  	} @@ -170,7 +166,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  		       sizeof(addr))) {  		zlog_warn(  			"%s: could not set Outgoing Interface Option on socket fd=%d: errno=%d: %s", -			__PRETTY_FUNCTION__, fd, errno, safe_strerror(errno)); +			__func__, fd, errno, safe_strerror(errno));  		close(fd);  		return -1;  	} @@ -182,8 +178,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  		if (flags < 0) {  			zlog_warn(  				"%s: could not get fcntl(F_GETFL,O_NONBLOCK) on socket fd=%d: errno=%d: %s", -				__PRETTY_FUNCTION__, fd, errno, -				safe_strerror(errno)); +				__func__, fd, errno, safe_strerror(errno));  			close(fd);  			return -1;  		} @@ -191,8 +186,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl)  		if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {  			zlog_warn(  				"%s: could not set fcntl(F_SETFL,O_NONBLOCK) on socket fd=%d: errno=%d: %s", -				__PRETTY_FUNCTION__, fd, errno, -				safe_strerror(errno)); +				__func__, fd, errno, safe_strerror(errno));  			close(fd);  			return -1;  		} @@ -213,7 +207,7 @@ static void ssmpingd_delete(struct ssmpingd_sock *ss)  			       sizeof(source_str));  		zlog_warn(  			"%s: failure closing ssmpingd sock_fd=%d for source %s: errno=%d: %s", -			__PRETTY_FUNCTION__, ss->sock_fd, source_str, errno, +			__func__, ss->sock_fd, source_str, errno,  			safe_strerror(errno));  		/* warning only */  	} @@ -236,12 +230,12 @@ static void ssmpingd_sendto(struct ssmpingd_sock *ss, const uint8_t *buf,  		if (sent < 0) {  			zlog_warn(  				"%s: sendto() failure to %s,%d: fd=%d len=%d: errno=%d: %s", -				__PRETTY_FUNCTION__, to_str, ntohs(to.sin_port), +				__func__, to_str, ntohs(to.sin_port),  				ss->sock_fd, len, errno, safe_strerror(errno));  		} else {  			zlog_warn(  				"%s: sendto() partial to %s,%d: fd=%d len=%d: sent=%d", -				__PRETTY_FUNCTION__, to_str, ntohs(to.sin_port), +				__func__, to_str, ntohs(to.sin_port),  				ss->sock_fd, len, sent);  		}  	} @@ -268,7 +262,7 @@ static int ssmpingd_read_msg(struct ssmpingd_sock *ss)  			       sizeof(source_str));  		zlog_warn(  			"%s: failure receiving ssmping for source %s on fd=%d: errno=%d: %s", -			__PRETTY_FUNCTION__, source_str, ss->sock_fd, errno, +			__func__, source_str, ss->sock_fd, errno,  			safe_strerror(errno));  		return -1;  	} @@ -286,8 +280,8 @@ static int ssmpingd_read_msg(struct ssmpingd_sock *ss)  		pim_inet4_dump("<to?>", to.sin_addr, to_str, sizeof(to_str));  		zlog_warn(  			"%s: bad ssmping type=%d from %s,%d to %s,%d on interface %s ifindex=%d fd=%d src=%s", -			__PRETTY_FUNCTION__, buf[0], from_str, -			ntohs(from.sin_port), to_str, ntohs(to.sin_port), +			__func__, buf[0], from_str, ntohs(from.sin_port), +			to_str, ntohs(to.sin_port),  			ifp ? ifp->name : "<iface?>", ifindex, ss->sock_fd,  			source_str);  		return 0; @@ -304,10 +298,9 @@ static int ssmpingd_read_msg(struct ssmpingd_sock *ss)  		pim_inet4_dump("<to?>", to.sin_addr, to_str, sizeof(to_str));  		zlog_debug(  			"%s: recv ssmping from %s,%d to %s,%d on interface %s ifindex=%d fd=%d src=%s", -			__PRETTY_FUNCTION__, from_str, ntohs(from.sin_port), -			to_str, ntohs(to.sin_port), -			ifp ? ifp->name : "<iface?>", ifindex, ss->sock_fd, -			source_str); +			__func__, from_str, ntohs(from.sin_port), to_str, +			ntohs(to.sin_port), ifp ? ifp->name : "<iface?>", +			ifindex, ss->sock_fd, source_str);  	}  	buf[0] = PIM_SSMPINGD_REPLY; @@ -361,7 +354,7 @@ static struct ssmpingd_sock *ssmpingd_new(struct pim_instance *pim,  		pim_inet4_dump("<src?>", source_addr, source_str,  			       sizeof(source_str));  		zlog_warn("%s: ssmpingd_socket() failure for source %s", -			  __PRETTY_FUNCTION__, source_str); +			  __func__, source_str);  		return 0;  	} @@ -395,8 +388,8 @@ int pim_ssmpingd_start(struct pim_instance *pim, struct in_addr source_addr)  		char source_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", source_addr, source_str,  			       sizeof(source_str)); -		zlog_info("%s: starting ssmpingd for source %s", -			  __PRETTY_FUNCTION__, source_str); +		zlog_info("%s: starting ssmpingd for source %s", __func__, +			  source_str);  	}  	ss = ssmpingd_new(pim, source_addr); @@ -404,8 +397,8 @@ int pim_ssmpingd_start(struct pim_instance *pim, struct in_addr source_addr)  		char source_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", source_addr, source_str,  			       sizeof(source_str)); -		zlog_warn("%s: ssmpingd_new() failure for source %s", -			  __PRETTY_FUNCTION__, source_str); +		zlog_warn("%s: ssmpingd_new() failure for source %s", __func__, +			  source_str);  		return -1;  	} @@ -421,8 +414,8 @@ int pim_ssmpingd_stop(struct pim_instance *pim, struct in_addr source_addr)  		char source_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", source_addr, source_str,  			       sizeof(source_str)); -		zlog_warn("%s: could not find ssmpingd for source %s", -			  __PRETTY_FUNCTION__, source_str); +		zlog_warn("%s: could not find ssmpingd for source %s", __func__, +			  source_str);  		return -1;  	} @@ -430,8 +423,8 @@ int pim_ssmpingd_stop(struct pim_instance *pim, struct in_addr source_addr)  		char source_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<src?>", source_addr, source_str,  			       sizeof(source_str)); -		zlog_info("%s: stopping ssmpingd for source %s", -			  __PRETTY_FUNCTION__, source_str); +		zlog_info("%s: stopping ssmpingd for source %s", __func__, +			  source_str);  	}  	ssmpingd_delete(ss); diff --git a/pimd/pim_time.c b/pimd/pim_time.c index f12f767537..9878fcf6b4 100644 --- a/pimd/pim_time.c +++ b/pimd/pim_time.c @@ -37,7 +37,7 @@ static int gettime_monotonic(struct timeval *tv)  	if (result) {  		flog_err_sys(EC_LIB_SYSTEM_CALL,  			     "%s: gettimeofday() failure: errno=%d: %s", -			     __PRETTY_FUNCTION__, errno, safe_strerror(errno)); +			     __func__, errno, safe_strerror(errno));  	}  	return result; @@ -54,7 +54,7 @@ int64_t pim_time_monotonic_sec(void)  	if (gettime_monotonic(&now_tv)) {  		flog_err_sys(EC_LIB_SYSTEM_CALL,  			     "%s: gettime_monotonic() failure: errno=%d: %s", -			     __PRETTY_FUNCTION__, errno, safe_strerror(errno)); +			     __func__, errno, safe_strerror(errno));  		return -1;  	} @@ -73,7 +73,7 @@ int64_t pim_time_monotonic_dsec(void)  	if (gettime_monotonic(&now_tv)) {  		flog_err_sys(EC_LIB_SYSTEM_CALL,  			     "%s: gettime_monotonic() failure: errno=%d: %s", -			     __PRETTY_FUNCTION__, errno, safe_strerror(errno)); +			     __func__, errno, safe_strerror(errno));  		return -1;  	} @@ -91,7 +91,7 @@ int64_t pim_time_monotonic_usec(void)  	if (gettime_monotonic(&now_tv)) {  		flog_err_sys(EC_LIB_SYSTEM_CALL,  			     "%s: gettime_monotonic() failure: errno=%d: %s", -			     __PRETTY_FUNCTION__, errno, safe_strerror(errno)); +			     __func__, errno, safe_strerror(errno));  		return -1;  	} diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c index 5faa499276..7b27211edc 100644 --- a/pimd/pim_tlv.c +++ b/pimd/pim_tlv.c @@ -257,7 +257,7 @@ uint8_t *pim_tlv_append_addrlist_ucast(uint8_t *buf, const uint8_t *buf_pastend,  	if (PIM_DEBUG_PIM_TRACE_DETAIL) {  		zlog_debug(  			"%s: number of encoded secondary unicast IPv4 addresses: %zu", -			__PRETTY_FUNCTION__, option_len / uel); +			__func__, option_len / uel);  	}  	if (option_len < 1) { @@ -340,15 +340,15 @@ int pim_tlv_parse_holdtime(const char *ifname, struct in_addr src_addr,  {  	const char *label = "holdtime"; -	if (check_tlv_length(__PRETTY_FUNCTION__, label, ifname, src_addr, +	if (check_tlv_length(__func__, label, ifname, src_addr,  			     sizeof(uint16_t), option_len)) {  		return -1;  	} -	check_tlv_redefinition_uint16( -		__PRETTY_FUNCTION__, label, ifname, src_addr, *hello_options, -		PIM_OPTION_MASK_HOLDTIME, PIM_TLV_GET_HOLDTIME(tlv_curr), -		*hello_option_holdtime); +	check_tlv_redefinition_uint16(__func__, label, ifname, src_addr, +				      *hello_options, PIM_OPTION_MASK_HOLDTIME, +				      PIM_TLV_GET_HOLDTIME(tlv_curr), +				      *hello_option_holdtime);  	PIM_OPTION_SET(*hello_options, PIM_OPTION_MASK_HOLDTIME); @@ -363,13 +363,13 @@ int pim_tlv_parse_lan_prune_delay(const char *ifname, struct in_addr src_addr,  				  uint16_t *hello_option_override_interval,  				  uint16_t option_len, const uint8_t *tlv_curr)  { -	if (check_tlv_length(__PRETTY_FUNCTION__, "lan_prune_delay", ifname, -			     src_addr, sizeof(uint32_t), option_len)) { +	if (check_tlv_length(__func__, "lan_prune_delay", ifname, src_addr, +			     sizeof(uint32_t), option_len)) {  		return -1;  	} -	check_tlv_redefinition_uint16(__PRETTY_FUNCTION__, "propagation_delay", -				      ifname, src_addr, *hello_options, +	check_tlv_redefinition_uint16(__func__, "propagation_delay", ifname, +				      src_addr, *hello_options,  				      PIM_OPTION_MASK_LAN_PRUNE_DELAY,  				      PIM_TLV_GET_PROPAGATION_DELAY(tlv_curr),  				      *hello_option_propagation_delay); @@ -400,13 +400,13 @@ int pim_tlv_parse_dr_priority(const char *ifname, struct in_addr src_addr,  {  	const char *label = "dr_priority"; -	if (check_tlv_length(__PRETTY_FUNCTION__, label, ifname, src_addr, +	if (check_tlv_length(__func__, label, ifname, src_addr,  			     sizeof(uint32_t), option_len)) {  		return -1;  	}  	check_tlv_redefinition_uint32( -		__PRETTY_FUNCTION__, label, ifname, src_addr, *hello_options, +		__func__, label, ifname, src_addr, *hello_options,  		PIM_OPTION_MASK_DR_PRIORITY, PIM_TLV_GET_DR_PRIORITY(tlv_curr),  		*hello_option_dr_priority); @@ -424,13 +424,13 @@ int pim_tlv_parse_generation_id(const char *ifname, struct in_addr src_addr,  {  	const char *label = "generation_id"; -	if (check_tlv_length(__PRETTY_FUNCTION__, label, ifname, src_addr, +	if (check_tlv_length(__func__, label, ifname, src_addr,  			     sizeof(uint32_t), option_len)) {  		return -1;  	} -	check_tlv_redefinition_uint32_hex(__PRETTY_FUNCTION__, label, ifname, -					  src_addr, *hello_options, +	check_tlv_redefinition_uint32_hex(__func__, label, ifname, src_addr, +					  *hello_options,  					  PIM_OPTION_MASK_GENERATION_ID,  					  PIM_TLV_GET_GENERATION_ID(tlv_curr),  					  *hello_option_generation_id); @@ -453,7 +453,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)  	if (buf_size < ucast_encoding_min_len) {  		zlog_warn(  			"%s: unicast address encoding overflow: left=%d needed=%d", -			__PRETTY_FUNCTION__, buf_size, ucast_encoding_min_len); +			__func__, buf_size, ucast_encoding_min_len);  		return -1;  	} @@ -465,7 +465,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)  	if (type) {  		zlog_warn("%s: unknown unicast address encoding type=%d", -			  __PRETTY_FUNCTION__, type); +			  __func__, type);  		return -2;  	} @@ -474,7 +474,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)  		if ((addr + sizeof(struct in_addr)) > pastend) {  			zlog_warn(  				"%s: IPv4 unicast address overflow: left=%zd needed=%zu", -				__PRETTY_FUNCTION__, pastend - addr, +				__func__, pastend - addr,  				sizeof(struct in_addr));  			return -3;  		} @@ -490,7 +490,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)  		if ((addr + sizeof(struct in6_addr)) > pastend) {  			zlog_warn(  				"%s: IPv6 unicast address overflow: left=%zd needed %zu", -				__PRETTY_FUNCTION__, pastend - addr, +				__func__, pastend - addr,  				sizeof(struct in6_addr));  			return -3;  		} @@ -503,7 +503,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)  		break;  	default: {  		zlog_warn("%s: unknown unicast address encoding family=%d from", -			  __PRETTY_FUNCTION__, family); +			  __func__, family);  		return -4;  	}  	} @@ -524,7 +524,7 @@ int pim_parse_addr_group(struct prefix_sg *sg, const uint8_t *buf, int buf_size)  	if (buf_size < grp_encoding_min_len) {  		zlog_warn(  			"%s: group address encoding overflow: left=%d needed=%d", -			__PRETTY_FUNCTION__, buf_size, grp_encoding_min_len); +			__func__, buf_size, grp_encoding_min_len);  		return -1;  	} @@ -542,14 +542,14 @@ int pim_parse_addr_group(struct prefix_sg *sg, const uint8_t *buf, int buf_size)  		if (type) {  			zlog_warn(  				"%s: unknown group address encoding type=%d from", -				__PRETTY_FUNCTION__, type); +				__func__, type);  			return -2;  		}  		if ((addr + sizeof(struct in_addr)) > pastend) {  			zlog_warn(  				"%s: IPv4 group address overflow: left=%zd needed=%zu from", -				__PRETTY_FUNCTION__, pastend - addr, +				__func__, pastend - addr,  				sizeof(struct in_addr));  			return -3;  		} @@ -562,7 +562,7 @@ int pim_parse_addr_group(struct prefix_sg *sg, const uint8_t *buf, int buf_size)  	default: {  		zlog_warn(  			"%s: unknown group address encoding family=%d mask_len=%d from", -			__PRETTY_FUNCTION__, family, mask_len); +			__func__, family, mask_len);  		return -4;  	}  	} @@ -584,7 +584,7 @@ int pim_parse_addr_source(struct prefix_sg *sg, uint8_t *flags,  	if (buf_size < src_encoding_min_len) {  		zlog_warn(  			"%s: source address encoding overflow: left=%d needed=%d", -			__PRETTY_FUNCTION__, buf_size, src_encoding_min_len); +			__func__, buf_size, src_encoding_min_len);  		return -1;  	} @@ -599,8 +599,7 @@ int pim_parse_addr_source(struct prefix_sg *sg, uint8_t *flags,  	if (type) {  		zlog_warn(  			"%s: unknown source address encoding type=%d: %02x%02x%02x%02x", -			__PRETTY_FUNCTION__, type, buf[0], buf[1], buf[2], -			buf[3]); +			__func__, type, buf[0], buf[1], buf[2], buf[3]);  		return -2;  	} @@ -609,7 +608,7 @@ int pim_parse_addr_source(struct prefix_sg *sg, uint8_t *flags,  		if ((addr + sizeof(struct in_addr)) > pastend) {  			zlog_warn(  				"%s: IPv4 source address overflow: left=%zd needed=%zu", -				__PRETTY_FUNCTION__, pastend - addr, +				__func__, pastend - addr,  				sizeof(struct in_addr));  			return -3;  		} @@ -630,7 +629,7 @@ int pim_parse_addr_source(struct prefix_sg *sg, uint8_t *flags,  		*/  		if (mask_len != 32) {  			zlog_warn("%s: IPv4 bad source address mask: %d", -				  __PRETTY_FUNCTION__, mask_len); +				  __func__, mask_len);  			return -4;  		} @@ -640,8 +639,7 @@ int pim_parse_addr_source(struct prefix_sg *sg, uint8_t *flags,  	default: {  		zlog_warn(  			"%s: unknown source address encoding family=%d: %02x%02x%02x%02x", -			__PRETTY_FUNCTION__, family, buf[0], buf[1], buf[2], -			buf[3]); +			__func__, family, buf[0], buf[1], buf[2], buf[3]);  		return -5;  	}  	} @@ -686,7 +684,7 @@ int pim_tlv_parse_addr_list(const char *ifname, struct in_addr src_addr,  				       sizeof(src_str));  			zlog_warn(  				"%s: pim_parse_addr_ucast() failure: from %s on %s", -				__PRETTY_FUNCTION__, src_str, ifname); +				__func__, src_str, ifname);  			FREE_ADDR_LIST(*hello_option_addr_list);  			return -1;  		} @@ -706,10 +704,10 @@ int pim_tlv_parse_addr_list(const char *ifname, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_debug(  					"%s: PIM hello TLV option: list_old_size=%d IPv4 address %s from %s on %s", -					__PRETTY_FUNCTION__, +					__func__,  					*hello_option_addr_list  						? ((int)listcount( -							  *hello_option_addr_list)) +							*hello_option_addr_list))  						: -1,  					addr_str, src_str, ifname);  			} break; @@ -721,10 +719,10 @@ int pim_tlv_parse_addr_list(const char *ifname, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_debug(  					"%s: PIM hello TLV option: list_old_size=%d UNKNOWN address family from %s on %s", -					__PRETTY_FUNCTION__, +					__func__,  					*hello_option_addr_list  						? ((int)listcount( -							  *hello_option_addr_list)) +							*hello_option_addr_list))  						: -1,  					src_str, ifname);  			} @@ -742,7 +740,7 @@ int pim_tlv_parse_addr_list(const char *ifname, struct in_addr src_addr,  					       sizeof(src_str));  				zlog_warn(  					"%s: ignoring primary address in secondary list from %s on %s", -					__PRETTY_FUNCTION__, src_str, ifname); +					__func__, src_str, ifname);  				continue;  			}  		} diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 940b5a33ce..ef65f097ad 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -76,8 +76,7 @@ static void pim_upstream_remove_children(struct pim_instance *pim,  		listnode_delete(up->sources, child);  		if (PIM_UPSTREAM_FLAG_TEST_SRC_LHR(child->flags)) {  			PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(child->flags); -			child = pim_upstream_del(pim, child, -						 __PRETTY_FUNCTION__); +			child = pim_upstream_del(pim, child, __func__);  		}  		if (child) {  			child->parent = NULL; @@ -272,8 +271,8 @@ void pim_upstream_send_join(struct pim_upstream *up)  {  	if (!up->rpf.source_nexthop.interface) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: up %s RPF is not present", -				__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  		return;  	} @@ -281,13 +280,13 @@ void pim_upstream_send_join(struct pim_upstream *up)  		char rpf_str[PREFIX_STRLEN];  		pim_addr_dump("<rpf?>", &up->rpf.rpf_addr, rpf_str,  			      sizeof(rpf_str)); -		zlog_debug("%s: RPF'%s=%s(%s) for Interface %s", -			   __PRETTY_FUNCTION__, up->sg_str, rpf_str, +		zlog_debug("%s: RPF'%s=%s(%s) for Interface %s", __func__, +			   up->sg_str, rpf_str,  			   pim_upstream_state2str(up->join_state),  			   up->rpf.source_nexthop.interface->name);  		if (pim_rpf_addr_is_inaddr_any(&up->rpf)) {  			zlog_debug("%s: can't send join upstream: RPF'%s=%s", -				   __PRETTY_FUNCTION__, up->sg_str, rpf_str); +				   __func__, up->sg_str, rpf_str);  			/* warning only */  		}  	} @@ -304,8 +303,8 @@ static int on_join_timer(struct thread *t)  	if (!up->rpf.source_nexthop.interface) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: up %s RPF is not present", -			__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  		return 0;  	} @@ -355,8 +354,7 @@ void join_timer_start(struct pim_upstream *up)  		if (PIM_DEBUG_PIM_EVENTS) {  			zlog_debug(  				"%s: starting %d sec timer for upstream (S,G)=%s", -				__PRETTY_FUNCTION__, router->t_periodic, -				up->sg_str); +				__func__, router->t_periodic, up->sg_str);  		}  	} @@ -389,7 +387,7 @@ static void pim_upstream_join_timer_restart_msec(struct pim_upstream *up,  {  	if (PIM_DEBUG_PIM_EVENTS) {  		zlog_debug("%s: restarting %d msec timer for upstream (S,G)=%s", -			   __PRETTY_FUNCTION__, interval_msec, up->sg_str); +			   __func__, interval_msec, up->sg_str);  	}  	THREAD_OFF(up->t_join_timer); @@ -405,8 +403,8 @@ void pim_upstream_join_suppress(struct pim_upstream *up,  	if (!up->rpf.source_nexthop.interface) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: up %s RPF is not present", -				__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  		return;  	} @@ -421,7 +419,7 @@ void pim_upstream_join_suppress(struct pim_upstream *up,  		pim_inet4_dump("<rpf?>", rpf_addr, rpf_str, sizeof(rpf_str));  		zlog_debug(  			"%s %s: detected Join%s to RPF'(S,G)=%s: join_timer=%ld msec t_joinsuppress=%ld msec", -			__FILE__, __PRETTY_FUNCTION__, up->sg_str, rpf_str, +			__FILE__, __func__, up->sg_str, rpf_str,  			join_timer_remain_msec, t_joinsuppress_msec);  	} @@ -429,7 +427,7 @@ void pim_upstream_join_suppress(struct pim_upstream *up,  		if (PIM_DEBUG_PIM_TRACE) {  			zlog_debug(  				"%s %s: suppressing Join(S,G)=%s for %ld msec", -				__FILE__, __PRETTY_FUNCTION__, up->sg_str, +				__FILE__, __func__, up->sg_str,  				t_joinsuppress_msec);  		} @@ -445,8 +443,8 @@ void pim_upstream_join_timer_decrease_to_t_override(const char *debug_label,  	if (!up->rpf.source_nexthop.interface) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: up %s RPF is not present", -				__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  		return;  	} @@ -518,8 +516,8 @@ static int pim_upstream_could_register(struct pim_upstream *up)  		pim_ifp = up->rpf.source_nexthop.interface->info;  	else {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: up %s RPF is not present", -				   __PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  	}  	if (pim_ifp && PIM_I_am_DR(pim_ifp) @@ -655,21 +653,21 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,  	if (up->upstream_addr.s_addr == INADDR_ANY) {  		if (PIM_DEBUG_PIM_EVENTS) -			zlog_debug("%s: RPF not configured for %s", -				__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: RPF not configured for %s", __func__, +				   up->sg_str);  		return;  	}  	if (!up->rpf.source_nexthop.interface)  {  		if (PIM_DEBUG_PIM_EVENTS) -			zlog_debug("%s: RP not reachable for %s", -				__PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: RP not reachable for %s", __func__, +				   up->sg_str);  		return;  	}  	if (PIM_DEBUG_PIM_EVENTS) {  		zlog_debug("%s: PIM_UPSTREAM_%s: (S,G) old: %s new: %s", -			   __PRETTY_FUNCTION__, up->sg_str, +			   __func__, up->sg_str,  			   pim_upstream_state2str(up->join_state),  			   pim_upstream_state2str(new_state));  	} @@ -816,7 +814,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,  				      sg->grp)) {  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug("%s: Received a (*,G) with no RP configured", -				   __PRETTY_FUNCTION__); +				   __func__);  	}  	up->parent = pim_upstream_find_parent(pim, up); @@ -837,8 +835,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,  	up->join_state = PIM_UPSTREAM_NOTJOINED;  	up->reg_state = PIM_REG_NOINFO;  	up->state_transition = pim_time_monotonic_sec(); -	up->channel_oil = -		pim_channel_oil_add(pim, &up->sg, __PRETTY_FUNCTION__); +	up->channel_oil = pim_channel_oil_add(pim, &up->sg, __func__);  	up->sptbit = PIM_UPSTREAM_SPTBIT_FALSE;  	up->rpf.source_nexthop.interface = NULL; @@ -878,7 +875,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug(  					"%s: Attempting to create upstream(%s), Unable to RPF for source", -					__PRETTY_FUNCTION__, up->sg_str); +					__func__, up->sg_str);  		}  		if (up->rpf.source_nexthop.interface) { @@ -910,8 +907,8 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,  	if (PIM_DEBUG_PIM_TRACE) {  		zlog_debug(  			"%s: Created Upstream %s upstream_addr %s ref count %d increment", -			__PRETTY_FUNCTION__, up->sg_str, -			inet_ntoa(up->upstream_addr), up->ref_count); +			__func__, up->sg_str, inet_ntoa(up->upstream_addr), +			up->ref_count);  	}  	return up; @@ -995,8 +992,7 @@ void pim_upstream_ref(struct pim_upstream *up, int flags, const char *name)  	++up->ref_count;  	if (PIM_DEBUG_PIM_TRACE)  		zlog_debug("%s(%s): upstream %s ref count %d increment", -			   __PRETTY_FUNCTION__, name, up->sg_str, -			   up->ref_count); +			   __func__, name, up->sg_str, up->ref_count);  }  struct pim_upstream *pim_upstream_add(struct pim_instance *pim, @@ -1021,14 +1017,13 @@ struct pim_upstream *pim_upstream_add(struct pim_instance *pim,  			char buf[PREFIX2STR_BUFFER];  			prefix2str(&up->rpf.rpf_addr, buf, sizeof(buf));  			zlog_debug("%s(%s): %s, iif %s (%s) found: %d: ref_count: %d", -		   __PRETTY_FUNCTION__, name, +		   __func__, name,  		   up->sg_str, buf, up->rpf.source_nexthop.interface ?                     up->rpf.source_nexthop.interface->name : "Unknown" ,  		   found, up->ref_count);  		} else -			zlog_debug("%s(%s): (%s) failure to create", -				   __PRETTY_FUNCTION__, name, -				   pim_str_sg_dump(sg)); +			zlog_debug("%s(%s): (%s) failure to create", __func__, +				   name, pim_str_sg_dump(sg));  	}  	return up; @@ -1232,8 +1227,7 @@ void pim_upstream_rpf_genid_changed(struct pim_instance *pim,  				      sizeof(rpf_addr_str));  			zlog_debug(  				"%s: matching neigh=%s against upstream (S,G)=%s[%s] joined=%d rpf_addr=%s", -				__PRETTY_FUNCTION__, neigh_str, up->sg_str, -				pim->vrf->name, +				__func__, neigh_str, up->sg_str, pim->vrf->name,  				up->join_state == PIM_UPSTREAM_JOINED,  				rpf_addr_str);  		} @@ -1409,13 +1403,13 @@ struct pim_upstream *pim_upstream_keep_alive_timer_proc(  		PIM_UPSTREAM_FLAG_UNSET_SRC_STREAM(up->flags);  		/* Return if upstream entry got deleted.*/ -		if (!pim_upstream_del(pim, up, __PRETTY_FUNCTION__)) +		if (!pim_upstream_del(pim, up, __func__))  			return NULL;  	}  	if (PIM_UPSTREAM_FLAG_TEST_SRC_NOCACHE(up->flags)) {  		PIM_UPSTREAM_FLAG_UNSET_SRC_NOCACHE(up->flags); -		if (!pim_upstream_del(pim, up, __PRETTY_FUNCTION__)) +		if (!pim_upstream_del(pim, up, __func__))  			return NULL;  	} @@ -1427,7 +1421,7 @@ struct pim_upstream *pim_upstream_keep_alive_timer_proc(  		struct pim_upstream *parent = up->parent;  		PIM_UPSTREAM_FLAG_UNSET_SRC_LHR(up->flags); -		up = pim_upstream_del(pim, up, __PRETTY_FUNCTION__); +		up = pim_upstream_del(pim, up, __func__);  		if (parent) {  			pim_jp_agg_single_upstream_send(&parent->rpf, parent, @@ -1559,7 +1553,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug(  				"%s: Incoming Interface: %s is different than RPF_interface(S) %s", -				__PRETTY_FUNCTION__, incoming->name, +				__func__, incoming->name,  				up->rpf.source_nexthop.interface->name);  		return;  	} @@ -1567,8 +1561,8 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,  	// AND JoinDesired(S,G) == true  	if (!pim_upstream_evaluate_join_desired(up->channel_oil->pim, up)) {  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: %s Join is not Desired", -				   __PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: %s Join is not Desired", __func__, +				   up->sg_str);  		return;  	} @@ -1577,7 +1571,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,  				       up->sg.src)) {  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug("%s: %s is directly connected to the source", -				   __PRETTY_FUNCTION__, up->sg_str); +				   __func__, up->sg_str);  		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;  		return;  	} @@ -1591,7 +1585,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug(  				"%s: %s RPF_interface(S) != RPF_interface(RP(G))", -				__PRETTY_FUNCTION__, up->sg_str); +				__func__, up->sg_str);  		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;  		pim_jp_agg_single_upstream_send(&starup->rpf, starup, true); @@ -1603,7 +1597,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,  	    && pim_upstream_empty_inherited_olist(up)) {  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug("%s: %s OR inherited_olist(S,G,rpt) == NULL", -				   __PRETTY_FUNCTION__, up->sg_str); +				   __func__, up->sg_str);  		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;  		return;  	} @@ -1613,7 +1607,7 @@ void pim_upstream_set_sptbit(struct pim_upstream *up,  	if (up->parent && pim_rpf_is_same(&up->rpf, &up->parent->rpf)) {  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug("%s: %s RPF'(S,G) is the same as RPF'(*,G)", -				   __PRETTY_FUNCTION__, up->sg_str); +				   __func__, up->sg_str);  		up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;  		return;  	} @@ -1665,8 +1659,9 @@ static int pim_upstream_register_stop_timer(struct thread *t)  	if (PIM_DEBUG_PIM_TRACE) {  		char state_str[PIM_REG_STATE_STR_LEN];  		zlog_debug("%s: (S,G)=%s[%s] upstream register stop timer %s", -			   __PRETTY_FUNCTION__, up->sg_str, pim->vrf->name, -			   pim_reg_state2str(up->reg_state, state_str, sizeof(state_str))); +			   __func__, up->sg_str, pim->vrf->name, +			   pim_reg_state2str(up->reg_state, state_str, +					     sizeof(state_str)));  	}  	switch (up->reg_state) { @@ -1683,7 +1678,7 @@ static int pim_upstream_register_stop_timer(struct thread *t)  		if (!up->rpf.source_nexthop.interface) {  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug("%s: up %s RPF is not present", -					__PRETTY_FUNCTION__, up->sg_str); +					   __func__, up->sg_str);  			return 0;  		} @@ -1692,7 +1687,7 @@ static int pim_upstream_register_stop_timer(struct thread *t)  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug(  					"%s: Interface: %s is not configured for pim", -					__PRETTY_FUNCTION__, +					__func__,  					up->rpf.source_nexthop.interface->name);  			return 0;  		} @@ -1705,7 +1700,7 @@ static int pim_upstream_register_stop_timer(struct thread *t)  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug(  					"%s: Stop sending the register, because I am the RP and we haven't seen a packet in a while", -					__PRETTY_FUNCTION__); +					__func__);  			return 0;  		}  		pim_null_register_send(up); @@ -1735,7 +1730,7 @@ void pim_upstream_start_register_stop_timer(struct pim_upstream *up,  	if (PIM_DEBUG_PIM_TRACE) {  		zlog_debug(  			"%s: (S,G)=%s Starting upstream register stop timer %d", -			__PRETTY_FUNCTION__, up->sg_str, time); +			__func__, up->sg_str, time);  	}  	thread_add_timer(router->master, pim_upstream_register_stop_timer, up,  			 time, &up->t_rs_timer); @@ -1751,8 +1746,8 @@ int pim_upstream_inherited_olist_decide(struct pim_instance *pim,  	if (!up->rpf.source_nexthop.interface)  		if (PIM_DEBUG_PIM_TRACE) -			zlog_debug("%s: up %s RPF is not present", -				   __PRETTY_FUNCTION__, up->sg_str); +			zlog_debug("%s: up %s RPF is not present", __func__, +				   up->sg_str);  	FOR_ALL_INTERFACES (pim->vrf, ifp) {  		if (!ifp->info) @@ -1843,8 +1838,8 @@ void pim_upstream_find_new_rpf(struct pim_instance *pim)  		if (up->upstream_addr.s_addr == INADDR_ANY) {  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug( -				    "%s: RP not configured for Upstream %s", -				    __PRETTY_FUNCTION__, up->sg_str); +					"%s: RP not configured for Upstream %s", +					__func__, up->sg_str);  			continue;  		} @@ -1852,7 +1847,7 @@ void pim_upstream_find_new_rpf(struct pim_instance *pim)  			if (PIM_DEBUG_PIM_TRACE)  				zlog_debug(  					"%s: Upstream %s without a path to send join, checking", -					__PRETTY_FUNCTION__, up->sg_str); +					__func__, up->sg_str);  			old.source_nexthop.interface =  				up->rpf.source_nexthop.interface;  			rpf_result = pim_rpf_update(pim, up, &old, __func__); @@ -1880,7 +1875,7 @@ void pim_upstream_terminate(struct pim_instance *pim)  	struct pim_upstream *up;  	while ((up = rb_pim_upstream_first(&pim->upstream_head))) { -		pim_upstream_del(pim, up, __PRETTY_FUNCTION__); +		pim_upstream_del(pim, up, __func__);  	}  	rb_pim_upstream_fini(&pim->upstream_head); @@ -1960,8 +1955,7 @@ static void pim_upstream_sg_running(void *arg)  	if (!up->channel_oil->installed) {  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug("%s: %s%s is not installed in mroute", -				   __PRETTY_FUNCTION__, up->sg_str, -				   pim->vrf->name); +				   __func__, up->sg_str, pim->vrf->name);  		return;  	} @@ -1977,8 +1971,7 @@ static void pim_upstream_sg_running(void *arg)  		if (PIM_DEBUG_PIM_TRACE)  			zlog_debug(  				"%s: Handling unscanned inherited_olist for %s[%s]", -				__PRETTY_FUNCTION__, up->sg_str, -				pim->vrf->name); +				__func__, up->sg_str, pim->vrf->name);  		pim_upstream_inherited_olist_decide(pim, up);  		up->channel_oil->oil_inherited_rescan = 0;  	} @@ -1990,7 +1983,7 @@ static void pim_upstream_sg_running(void *arg)  		if (PIM_DEBUG_PIM_TRACE) {  			zlog_debug(  				"%s[%s]: %s old packet count is equal or lastused is greater than 30, (%ld,%ld,%lld)", -				__PRETTY_FUNCTION__, up->sg_str, pim->vrf->name, +				__func__, up->sg_str, pim->vrf->name,  				up->channel_oil->cc.oldpktcnt,  				up->channel_oil->cc.pktcnt,  				up->channel_oil->cc.lastused / 100); @@ -2007,9 +2000,8 @@ static void pim_upstream_sg_running(void *arg)  					"source reference created on kat restart %s[%s]",  					up->sg_str, pim->vrf->name); -			pim_upstream_ref(up, -					PIM_UPSTREAM_FLAG_MASK_SRC_STREAM, -					__PRETTY_FUNCTION__); +			pim_upstream_ref(up, PIM_UPSTREAM_FLAG_MASK_SRC_STREAM, +					 __func__);  			PIM_UPSTREAM_FLAG_SET_SRC_STREAM(up->flags);  			pim_upstream_fhr_kat_start(up);  		} diff --git a/pimd/pim_vxlan.c b/pimd/pim_vxlan.c index b21ff56ce1..93e2f00f90 100644 --- a/pimd/pim_vxlan.c +++ b/pimd/pim_vxlan.c @@ -239,8 +239,7 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg)  			 * origination mroutes active sources but just in  			 * case  			 */ -			up = pim_upstream_del(vxlan_sg->pim, up, -				__PRETTY_FUNCTION__); +			up = pim_upstream_del(vxlan_sg->pim, up, __func__);  		}  		/* if there are other references register the source  		 * for nht @@ -344,7 +343,7 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)  		}  		/* We are acting FHR; clear out use_rpt setting if any */  		pim_upstream_update_use_rpt(up, false /*update_mroute*/); -		pim_upstream_ref(up, flags, __PRETTY_FUNCTION__); +		pim_upstream_ref(up, flags, __func__);  		vxlan_sg->up = up;  		pim_vxlan_orig_mr_up_iif_update(vxlan_sg);  		/* mute pimreg on origination mroutes */ @@ -353,8 +352,7 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)  					pim->regiface->info);  	} else {  		up = pim_upstream_add(vxlan_sg->pim, &vxlan_sg->sg, -				vxlan_sg->iif, flags, -				__PRETTY_FUNCTION__, NULL); +				      vxlan_sg->iif, flags, __func__, NULL);  		vxlan_sg->up = up;  	} @@ -614,9 +612,8 @@ static void pim_vxlan_term_mr_up_add(struct pim_vxlan_sg *vxlan_sg)  	/* enable MLAG designated-forwarder election on termination mroutes */  	PIM_UPSTREAM_FLAG_SET_MLAG_VXLAN(flags); -	up = pim_upstream_add(vxlan_sg->pim, &vxlan_sg->sg, -			NULL /* iif */, flags, -			__PRETTY_FUNCTION__, NULL); +	up = pim_upstream_add(vxlan_sg->pim, &vxlan_sg->sg, NULL /* iif */, +			      flags, __func__, NULL);  	vxlan_sg->up = up;  	if (!up) { @@ -648,8 +645,7 @@ static void pim_vxlan_term_mr_up_del(struct pim_vxlan_sg *vxlan_sg)  		up->flags &= ~(PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM |  			PIM_UPSTREAM_FLAG_MASK_MLAG_VXLAN);  		pim_mlag_up_local_del(vxlan_sg->pim, up); -		pim_upstream_del(vxlan_sg->pim, up, -				__PRETTY_FUNCTION__); +		pim_upstream_del(vxlan_sg->pim, up, __func__);  	}  } @@ -881,9 +877,8 @@ static void pim_vxlan_set_default_iif(struct pim_instance *pim,  	old_iif = pim->vxlan.default_iif;  	if (PIM_DEBUG_VXLAN)  		zlog_debug("%s: vxlan default iif changed from %s to %s", -			__PRETTY_FUNCTION__, -			old_iif ? old_iif->name : "-", -			ifp ? ifp->name : "-"); +			   __func__, old_iif ? old_iif->name : "-", +			   ifp ? ifp->name : "-");  	old_iif = pim_vxlan_orig_mr_iif_get(pim);  	pim->vxlan.default_iif = ifp; @@ -892,9 +887,9 @@ static void pim_vxlan_set_default_iif(struct pim_instance *pim,  		return;  	if (PIM_DEBUG_VXLAN) -		zlog_debug("%s: vxlan orig iif changed from %s to %s", -			__PRETTY_FUNCTION__, old_iif ? old_iif->name : "-", -			ifp ? ifp->name : "-"); +		zlog_debug("%s: vxlan orig iif changed from %s to %s", __func__, +			   old_iif ? old_iif->name : "-", +			   ifp ? ifp->name : "-");  	/* add/del upstream entries for the existing vxlan SG when the  	 * interface becomes available @@ -973,8 +968,8 @@ static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,  	old_iif = pim->vxlan.peerlink_rif;  	if (PIM_DEBUG_VXLAN)  		zlog_debug("%s: vxlan peerlink_rif changed from %s to %s", -			__PRETTY_FUNCTION__, old_iif ? old_iif->name : "-", -			ifp ? ifp->name : "-"); +			   __func__, old_iif ? old_iif->name : "-", +			   ifp ? ifp->name : "-");  	old_iif = pim_vxlan_orig_mr_iif_get(pim);  	old_oif = pim_vxlan_orig_mr_oif_get(pim); @@ -984,9 +979,8 @@ static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,  	if (old_iif != new_iif) {  		if (PIM_DEBUG_VXLAN)  			zlog_debug("%s: vxlan orig iif changed from %s to %s", -				__PRETTY_FUNCTION__, -				old_iif ? old_iif->name : "-", -				new_iif ? new_iif->name : "-"); +				   __func__, old_iif ? old_iif->name : "-", +				   new_iif ? new_iif->name : "-");  		/* add/del upstream entries for the existing vxlan SG when the  		 * interface becomes available @@ -1001,9 +995,8 @@ static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,  	if (old_oif != new_oif) {  		if (PIM_DEBUG_VXLAN)  			zlog_debug("%s: vxlan orig oif changed from %s to %s", -				__PRETTY_FUNCTION__, -				old_oif ? old_oif->name : "-", -				new_oif ? new_oif->name : "-"); +				   __func__, old_oif ? old_oif->name : "-", +				   new_oif ? new_oif->name : "-");  		if (pim->vxlan.sg_hash)  			hash_iterate(pim->vxlan.sg_hash,  					pim_vxlan_sg_peerlink_oif_update, diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index baa6216df2..13d6a2eea8 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -75,9 +75,8 @@ static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)  		return 0;  	if (PIM_DEBUG_ZEBRA) -		zlog_debug("%s: %s updating from %u to %u", -			   __PRETTY_FUNCTION__, -			   ifp->name, vrf_id, new_vrf_id); +		zlog_debug("%s: %s updating from %u to %u", __func__, ifp->name, +			   vrf_id, new_vrf_id);  	if_update_to_new_vrf(ifp, new_vrf_id); @@ -135,8 +134,7 @@ static int pim_zebra_if_address_add(ZAPI_CALLBACK_ARGS)  		char buf[BUFSIZ];  		prefix2str(p, buf, BUFSIZ);  		zlog_debug("%s: %s(%u) connected IP address %s flags %u %s", -			   __PRETTY_FUNCTION__, c->ifp->name, vrf_id, buf, -			   c->flags, +			   __func__, c->ifp->name, vrf_id, buf, c->flags,  			   CHECK_FLAG(c->flags, ZEBRA_IFA_SECONDARY)  				   ? "secondary"  				   : "primary"); @@ -161,7 +159,7 @@ static int pim_zebra_if_address_add(ZAPI_CALLBACK_ARGS)  				zlog_warn(  					"%s: %s : forcing secondary flag on %s", -					__PRETTY_FUNCTION__, c->ifp->name, buf); +					__func__, c->ifp->name, buf);  			}  			SET_FLAG(c->flags, ZEBRA_IFA_SECONDARY);  		} @@ -218,8 +216,7 @@ static int pim_zebra_if_address_del(ZAPI_CALLBACK_ARGS)  			prefix2str(p, buf, BUFSIZ);  			zlog_debug(  				"%s: %s(%u) disconnected IP address %s flags %u %s", -				__PRETTY_FUNCTION__, c->ifp->name, vrf_id, buf, -				c->flags, +				__func__, c->ifp->name, vrf_id, buf, c->flags,  				CHECK_FLAG(c->flags, ZEBRA_IFA_SECONDARY)  					? "secondary"  					: "primary"); @@ -291,7 +288,7 @@ void pim_zebra_upstream_rpf_changed(struct pim_instance *pim,  			 */  			if (!up->channel_oil->installed)  				pim_upstream_mroute_add(up->channel_oil, -					__PRETTY_FUNCTION__); +							__func__);  			/*  			 * RFC 4601: 4.5.7.  Sending (S,G) @@ -329,8 +326,7 @@ void pim_zebra_upstream_rpf_changed(struct pim_instance *pim,  			pim_jp_agg_switch_interface(old, &up->rpf, up);  		if (!up->channel_oil->installed) -			pim_upstream_mroute_add(up->channel_oil, -					__PRETTY_FUNCTION__); +			pim_upstream_mroute_add(up->channel_oil, __func__);  	}  	/* FIXME can join_desired actually be changed by pim_rpf_update() @@ -430,7 +426,7 @@ void sched_rpf_cache_refresh(struct pim_instance *pim)  	/* Start refresh timer */  	if (PIM_DEBUG_ZEBRA) { -		zlog_debug("%s: triggering %ld msec timer", __PRETTY_FUNCTION__, +		zlog_debug("%s: triggering %ld msec timer", __func__,  			   router->rpf_cache_refresh_delay_msec);  	} @@ -475,8 +471,7 @@ void pim_zebra_init(void)  	zclient_init(zclient, ZEBRA_ROUTE_PIM, 0, &pimd_privs);  	if (PIM_DEBUG_PIM_TRACE) { -		zlog_notice("%s: zclient socket initialized", -			    __PRETTY_FUNCTION__); +		zlog_notice("%s: zclient socket initialized", __func__);  	}  	zclient_lookup_new(); @@ -493,8 +488,7 @@ void igmp_anysource_forward_start(struct pim_instance *pim,  	source = source_new(group, src_addr);  	if (!source) { -		zlog_warn("%s: Failure to create * source", -			  __PRETTY_FUNCTION__); +		zlog_warn("%s: Failure to create * source", __func__);  		return;  	} @@ -604,8 +598,8 @@ void igmp_source_forward_start(struct pim_instance *pim,  	if (PIM_DEBUG_IGMP_TRACE) {  		zlog_debug( -			"%s: (S,G)=%s igmp_sock=%d oif=%s fwd=%d", -			__PRETTY_FUNCTION__, pim_str_sg_dump(&sg), +			"%s: (S,G)=%s igmp_sock=%d oif=%s fwd=%d", __func__, +			pim_str_sg_dump(&sg),  			source->source_group->group_igmp_sock->fd,  			source->source_group->group_igmp_sock->interface->name,  			IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); @@ -621,11 +615,10 @@ void igmp_source_forward_start(struct pim_instance *pim,  	pim_oif = group->group_igmp_sock->interface->info;  	if (!pim_oif) {  		if (PIM_DEBUG_IGMP_TRACE) { -			zlog_debug( -				   "%s: multicast not enabled on oif=%s ?", -				   __PRETTY_FUNCTION__, +			zlog_debug("%s: multicast not enabled on oif=%s ?", +				   __func__,  				   source->source_group->group_igmp_sock -				   ->interface->name); +					   ->interface->name);  		}  		return;  	} @@ -639,8 +632,8 @@ void igmp_source_forward_start(struct pim_instance *pim,  		if (!pim_rp_set_upstream_addr(pim, &vif_source,  					      source->source_addr, sg.grp)) {  			/*Create a dummy channel oil */ -			source->source_channel_oil = pim_channel_oil_add( -				pim, &sg, __PRETTY_FUNCTION__); +			source->source_channel_oil = +				pim_channel_oil_add(pim, &sg, __func__);  		}  		else { @@ -672,10 +665,10 @@ void igmp_source_forward_start(struct pim_instance *pim,  				pim_inet4_dump("<source?>", vif_source, buf2,  					       sizeof(buf2)); -				zlog_debug("%s: NHT %s vif_source %s vif_index:%d ", -					__PRETTY_FUNCTION__, -					pim_str_sg_dump(&sg), -					buf2, input_iface_vif_index); +				zlog_debug( +					"%s: NHT %s vif_source %s vif_index:%d ", +					__func__, pim_str_sg_dump(&sg), buf2, +					input_iface_vif_index);  			}  			if (input_iface_vif_index < 1) { @@ -685,14 +678,11 @@ void igmp_source_forward_start(struct pim_instance *pim,  						source->source_addr,  						source_str, sizeof(source_str));  					zlog_debug( -					    "%s %s: could not find input interface for source %s", -					    __FILE__, __PRETTY_FUNCTION__, -					    source_str); +						"%s %s: could not find input interface for source %s", +						__FILE__, __func__, source_str);  				}  				source->source_channel_oil = -					pim_channel_oil_add( -						pim, &sg, -						__PRETTY_FUNCTION__); +					pim_channel_oil_add(pim, &sg, __func__);  			}  			else { @@ -710,30 +700,28 @@ void igmp_source_forward_start(struct pim_instance *pim,  					 */  					if (PIM_DEBUG_IGMP_TRACE) {  						zlog_debug( -						    "%s: ignoring request for looped MFC entry (S,G)=%s: igmp_sock=%d oif=%s vif_index=%d", -						    __PRETTY_FUNCTION__, -						    pim_str_sg_dump(&sg), -						    source->source_group -						    ->group_igmp_sock->fd, -						    source->source_group -						    ->group_igmp_sock -						    ->interface->name, -						    input_iface_vif_index); +							"%s: ignoring request for looped MFC entry (S,G)=%s: igmp_sock=%d oif=%s vif_index=%d", +							__func__, +							pim_str_sg_dump(&sg), +							source->source_group +								->group_igmp_sock +								->fd, +							source->source_group +								->group_igmp_sock +								->interface->name, +							input_iface_vif_index);  					}  					return;  				}  				source->source_channel_oil = -					pim_channel_oil_add( -						pim, &sg, -						__PRETTY_FUNCTION__); +					pim_channel_oil_add(pim, &sg, __func__);  				if (!source->source_channel_oil) {  					if (PIM_DEBUG_IGMP_TRACE) {  						zlog_debug( -						    "%s %s: could not create OIL for channel (S,G)=%s", -						    __FILE__, -						    __PRETTY_FUNCTION__, -						    pim_str_sg_dump(&sg)); +							"%s %s: could not create OIL for channel (S,G)=%s", +							__FILE__, __func__, +							pim_str_sg_dump(&sg));  					}  					return;  				} @@ -754,10 +742,10 @@ void igmp_source_forward_start(struct pim_instance *pim,  		}  	} else {  		if (PIM_DEBUG_IGMP_TRACE) -			zlog_debug("%s: %s was received on %s interface but we are not DR for that interface", -				   __PRETTY_FUNCTION__, -				   pim_str_sg_dump(&sg), -				   group->group_igmp_sock->interface->name); +			zlog_debug( +				"%s: %s was received on %s interface but we are not DR for that interface", +				__func__, pim_str_sg_dump(&sg), +				group->group_igmp_sock->interface->name);  		return;  	} @@ -770,7 +758,7 @@ void igmp_source_forward_start(struct pim_instance *pim,  						false /*is_vxlan*/)) {  		if (PIM_DEBUG_MROUTE)  			zlog_warn("%s: Failure to add local membership for %s", -				  __PRETTY_FUNCTION__, pim_str_sg_dump(&sg)); +				  __func__, pim_str_sg_dump(&sg));  		pim_channel_del_oif(source->source_channel_oil,  				    group->group_igmp_sock->interface, @@ -797,8 +785,8 @@ void igmp_source_forward_stop(struct igmp_source *source)  	if (PIM_DEBUG_IGMP_TRACE) {  		zlog_debug( -			"%s: (S,G)=%s igmp_sock=%d oif=%s fwd=%d", -			__PRETTY_FUNCTION__, pim_str_sg_dump(&sg), +			"%s: (S,G)=%s igmp_sock=%d oif=%s fwd=%d", __func__, +			pim_str_sg_dump(&sg),  			source->source_group->group_igmp_sock->fd,  			source->source_group->group_igmp_sock->interface->name,  			IGMP_SOURCE_TEST_FORWARDING(source->source_flags)); @@ -861,7 +849,7 @@ void pim_forward_start(struct pim_ifchannel *ch)  			       sizeof(group_str));  		pim_inet4_dump("<upstream?>", up->upstream_addr, upstream_str,  			       sizeof(upstream_str)); -		zlog_debug("%s: (S,G)=(%s,%s) oif=%s (%s)", __PRETTY_FUNCTION__, +		zlog_debug("%s: (S,G)=(%s,%s) oif=%s (%s)", __func__,  			   source_str, group_str, ch->interface->name,  			   inet_ntoa(up->upstream_addr));  	} @@ -879,7 +867,7 @@ void pim_forward_stop(struct pim_ifchannel *ch, bool install_it)  	if (PIM_DEBUG_PIM_TRACE) {  		zlog_debug("%s: (S,G)=%s oif=%s install_it: %d installed: %d", -			   __PRETTY_FUNCTION__, ch->sg_str, ch->interface->name, +			   __func__, ch->sg_str, ch->interface->name,  			   install_it, up->channel_oil->installed);  	} @@ -895,7 +883,7 @@ void pim_forward_stop(struct pim_ifchannel *ch, bool install_it)  				    PIM_OIF_FLAG_PROTO_PIM, __func__);  	if (install_it && !up->channel_oil->installed) -		pim_upstream_mroute_add(up->channel_oil, __PRETTY_FUNCTION__); +		pim_upstream_mroute_add(up->channel_oil, __func__);  }  void pim_zebra_zclient_update(struct vty *vty) diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index 0454c0d69e..fc486f4998 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -56,7 +56,7 @@ static int zclient_lookup_connect(struct thread *t)  	if (zclient_socket_connect(zlookup) < 0) {  		++zlookup->fail;  		zlog_warn("%s: failure connecting zclient socket: failures=%d", -			  __PRETTY_FUNCTION__, zlookup->fail); +			  __func__, zlookup->fail);  	} else {  		zlookup->fail = 0; /* reset counter on connection */  	} @@ -79,7 +79,7 @@ static void zclient_lookup_sched(struct zclient *zlookup, int delay)  			 &zlookup->t_connect);  	zlog_notice("%s: zclient lookup connection scheduled for %d seconds", -		    __PRETTY_FUNCTION__, delay); +		    __func__, delay);  }  /* Schedule connection for now. */ @@ -89,7 +89,7 @@ static void zclient_lookup_sched_now(struct zclient *zlookup)  			 &zlookup->t_connect);  	zlog_notice("%s: zclient lookup immediate connection scheduled", -		    __PRETTY_FUNCTION__); +		    __func__);  }  /* Schedule reconnection, if needed. */ @@ -128,7 +128,7 @@ void zclient_lookup_new(void)  	zlookup = zclient_new(router->master, &zclient_options_default);  	if (!zlookup) {  		flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_new() failure", -			 __PRETTY_FUNCTION__); +			 __func__);  		return;  	} @@ -138,8 +138,7 @@ void zclient_lookup_new(void)  	zclient_lookup_sched_now(zlookup); -	zlog_notice("%s: zclient lookup socket initialized", -		    __PRETTY_FUNCTION__); +	zlog_notice("%s: zclient lookup socket initialized", __func__);  }  static int zclient_read_nexthop(struct pim_instance *pim, @@ -163,7 +162,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,  	if (PIM_DEBUG_PIM_NHT_DETAIL) {  		char addr_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str)); -		zlog_debug("%s: addr=%s(%s)", __PRETTY_FUNCTION__, addr_str, +		zlog_debug("%s: addr=%s(%s)", __func__, addr_str,  			   pim->vrf->name);  	} @@ -175,8 +174,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,  					  &version, &vrf_id, &command);  		if (err < 0) {  			flog_err(EC_LIB_ZAPI_MISSMATCH, -				 "%s: zclient_read_header() failed", -				 __PRETTY_FUNCTION__); +				 "%s: zclient_read_header() failed", __func__);  			zclient_lookup_failed(zlookup);  			return -1;  		} @@ -198,8 +196,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,  		pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));  		pim_inet4_dump("<raddr?>", raddr, raddr_str, sizeof(raddr_str));  		zlog_warn("%s: address mismatch: addr=%s(%s) raddr=%s", -			  __PRETTY_FUNCTION__, addr_str, pim->vrf->name, -			  raddr_str); +			  __func__, addr_str, pim->vrf->name, raddr_str);  		/* warning only */  	} @@ -228,8 +225,8 @@ static int zclient_read_nexthop(struct pim_instance *pim,  				       sizeof(addr_str));  			zlog_warn(  				"%s: found too many nexthop ifindexes (%d > %d) for address %s(%s)", -				__PRETTY_FUNCTION__, (num_ifindex + 1), -				tab_size, addr_str, pim->vrf->name); +				__func__, (num_ifindex + 1), tab_size, addr_str, +				pim->vrf->name);  			return num_ifindex;  		}  		nexthop_tab[num_ifindex].protocol_distance = distance; @@ -304,8 +301,8 @@ static int zclient_read_nexthop(struct pim_instance *pim,  					       sizeof(addr_str));  				zlog_warn(  					"%s: found non-ifindex nexthop type=%d for address %s(%s)", -					__PRETTY_FUNCTION__, nexthop_type, -					addr_str, pim->vrf->name); +					__func__, nexthop_type, addr_str, +					pim->vrf->name);  			}  			break;  		} @@ -324,7 +321,7 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim,  	if (PIM_DEBUG_PIM_NHT_DETAIL) {  		char addr_str[INET_ADDRSTRLEN];  		pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str)); -		zlog_debug("%s: addr=%s(%s)", __PRETTY_FUNCTION__, addr_str, +		zlog_debug("%s: addr=%s(%s)", __func__, addr_str,  			   pim->vrf->name);  	} @@ -332,7 +329,7 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim,  	if (zlookup->sock < 0) {  		flog_err(EC_LIB_ZAPI_SOCKET,  			 "%s: zclient lookup socket is not connected", -			 __PRETTY_FUNCTION__); +			 __func__);  		zclient_lookup_failed(zlookup);  		return -1;  	} @@ -340,7 +337,7 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim,  	if (pim->vrf->vrf_id == VRF_UNKNOWN) {  		zlog_notice(  			"%s: VRF: %s does not fully exist yet, delaying lookup", -			__PRETTY_FUNCTION__, pim->vrf->name); +			__func__, pim->vrf->name);  		return -1;  	} @@ -356,14 +353,14 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim,  		flog_err(  			EC_LIB_SOCKET,  			"%s: writen() failure: %d writing to zclient lookup socket", -			__PRETTY_FUNCTION__, errno); +			__func__, errno);  		zclient_lookup_failed(zlookup);  		return -2;  	}  	if (ret == 0) {  		flog_err_sys(EC_LIB_SOCKET,  			     "%s: connection closed on zclient lookup socket", -			     __PRETTY_FUNCTION__); +			     __func__);  		zclient_lookup_failed(zlookup);  		return -3;  	} @@ -410,8 +407,8 @@ int zclient_lookup_nexthop(struct pim_instance *pim,  					       sizeof(addr_str));  				zlog_debug(  					"%s: lookup=%d/%d: could not find nexthop ifindex for address %s(%s)", -					__PRETTY_FUNCTION__, lookup, max_lookup, -					addr_str, pim->vrf->name); +					__func__, lookup, max_lookup, addr_str, +					pim->vrf->name);  			}  			return -1;  		} @@ -448,9 +445,9 @@ int zclient_lookup_nexthop(struct pim_instance *pim,  						       sizeof(addr_str));  					zlog_debug(  						"%s: lookup=%d/%d: found non-recursive ifindex=%d for address %s(%s) dist=%d met=%d", -						__PRETTY_FUNCTION__, lookup, -						max_lookup, first_ifindex, -						addr_str, pim->vrf->name, +						__func__, lookup, max_lookup, +						first_ifindex, addr_str, +						pim->vrf->name,  						nexthop_tab[0]  							.protocol_distance,  						nexthop_tab[0].route_metric); @@ -477,8 +474,8 @@ int zclient_lookup_nexthop(struct pim_instance *pim,  				      sizeof(nexthop_str));  			zlog_debug(  				"%s: lookup=%d/%d: zebra returned recursive nexthop %s for address %s(%s) dist=%d met=%d", -				__PRETTY_FUNCTION__, lookup, max_lookup, -				nexthop_str, addr_str, pim->vrf->name, +				__func__, lookup, max_lookup, nexthop_str, +				addr_str, pim->vrf->name,  				nexthop_tab[0].protocol_distance,  				nexthop_tab[0].route_metric);  		} @@ -493,8 +490,7 @@ int zclient_lookup_nexthop(struct pim_instance *pim,  		pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));  		zlog_warn(  			"%s: lookup=%d/%d: failure searching recursive nexthop ifindex for address %s(%s)", -			__PRETTY_FUNCTION__, lookup, max_lookup, addr_str, -			pim->vrf->name); +			__func__, lookup, max_lookup, addr_str, pim->vrf->name);  	}  	return -2; @@ -548,7 +544,7 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)  		flog_err(  			EC_LIB_SOCKET,  			"%s: writen() failure: %d writing to zclient lookup socket", -			__PRETTY_FUNCTION__, errno); +			__func__, errno);  		return -1;  	} @@ -566,8 +562,7 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)  					  &version, &vrf_id, &command);  		if (err < 0) {  			flog_err(EC_LIB_ZAPI_MISSMATCH, -				 "%s: zclient_read_header() failed", -				 __PRETTY_FUNCTION__); +				 "%s: zclient_read_header() failed", __func__);  			zclient_lookup_failed(zlookup);  			return -1;  		} @@ -585,7 +580,7 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)  			flog_err(  				EC_LIB_ZAPI_MISSMATCH,  				"%s: Received wrong %s(%s) information requested", -				__PRETTY_FUNCTION__, pim_str_sg_dump(&more), +				__func__, pim_str_sg_dump(&more),  				c_oil->pim->vrf->name);  		}  		zclient_lookup_failed(zlookup); diff --git a/pimd/pimd.c b/pimd/pimd.c index 0a7ac3b31f..a2af66fdc7 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -115,8 +115,8 @@ void pim_init(void)  		flog_err(  			EC_LIB_SOCKET,  			"%s %s: could not solve %s to group address: errno=%d: %s", -			__FILE__, __PRETTY_FUNCTION__, PIM_ALL_PIM_ROUTERS, -			errno, safe_strerror(errno)); +			__FILE__, __func__, PIM_ALL_PIM_ROUTERS, errno, +			safe_strerror(errno));  		zassert(0);  		return;  	} diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c index 102b64df6b..77c2db8ceb 100644 --- a/ripd/rip_routemap.c +++ b/ripd/rip_routemap.c @@ -468,7 +468,7 @@ static void *route_set_metric_compile(const char *arg)  	if (metric > RIP_METRIC_INFINITY) {  		zlog_info(  			"%s: Metric specified: %ld is greater than RIP_METRIC_INFINITY, using INFINITY instead", -			__PRETTY_FUNCTION__, metric); +			__func__, metric);  		mod->metric = RIP_METRIC_INFINITY;  	} else  		mod->metric = metric; diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c index 6123591429..b5f80d2ab0 100644 --- a/ripngd/ripng_routemap.c +++ b/ripngd/ripng_routemap.c @@ -237,9 +237,9 @@ static void *route_set_metric_compile(const char *arg)  		return mod;  	if (metric > RIPNG_METRIC_INFINITY) { -		zlog_info("%s: Metric specified: %ld is being converted into METRIC_INFINITY", -			  __PRETTY_FUNCTION__, -			  metric); +		zlog_info( +			"%s: Metric specified: %ld is being converted into METRIC_INFINITY", +			__func__, metric);  		mod->metric = RIPNG_METRIC_INFINITY;  	} else  		mod->metric = metric; diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 4fc8f40ae1..5baa74fe96 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -318,8 +318,7 @@ void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import,  	}  	if (zclient_send_rnh(zclient, command, p, connected, vrf_id) < 0) -		zlog_warn("%s: Failure to send nexthop to zebra", -			  __PRETTY_FUNCTION__); +		zlog_warn("%s: Failure to send nexthop to zebra", __func__);  }  static int sharp_debug_nexthops(struct zapi_route *api) @@ -367,7 +366,7 @@ static int sharp_nexthop_update(ZAPI_CALLBACK_ARGS)  	struct zapi_route nhr;  	if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) { -		zlog_warn("%s: Decode of update failed", __PRETTY_FUNCTION__); +		zlog_warn("%s: Decode of update failed", __func__);  		return 0;  	} @@ -388,8 +387,7 @@ static int sharp_redistribute_route(ZAPI_CALLBACK_ARGS)  	struct zapi_route api;  	if (zapi_route_decode(zclient->ibuf, &api) < 0) -		zlog_warn("%s: Decode of redistribute failed: %d", -			  __PRETTY_FUNCTION__, +		zlog_warn("%s: Decode of redistribute failed: %d", __func__,  			  ZEBRA_REDISTRIBUTE_ROUTE_ADD);  	zlog_debug("%s: %pFX (%s)", zserv_command_string(cmd), diff --git a/staticd/static_vty.c b/staticd/static_vty.c index 6390fd811f..3903a5a5c5 100644 --- a/staticd/static_vty.c +++ b/staticd/static_vty.c @@ -287,8 +287,8 @@ static int static_route_leak(  		if (vty)  			vty_out(vty, "%% Malformed address\n");  		else -			zlog_warn("%s: Malformed address: %s", -				  __PRETTY_FUNCTION__, dest_str); +			zlog_warn("%s: Malformed address: %s", __func__, +				  dest_str);  		return CMD_WARNING_CONFIG_FAILED;  	} @@ -302,8 +302,7 @@ static int static_route_leak(  					vty_out(vty, "%% Malformed address\n");  				else  					zlog_warn("%s: Malformed address: %s", -						  __PRETTY_FUNCTION__, -						  mask_str); +						  __func__, mask_str);  				return CMD_WARNING_CONFIG_FAILED;  			}  			p.prefixlen = ip_masklen(mask); @@ -320,7 +319,7 @@ static int static_route_leak(  				else  					zlog_warn(  						"%s: Malformed source address: %s", -						__PRETTY_FUNCTION__, src_str); +						__func__, src_str);  				return CMD_WARNING_CONFIG_FAILED;  			}  			src_p = (struct prefix_ipv6 *)&src; @@ -351,10 +350,9 @@ static int static_route_leak(  				    "%% Table %s overlaps vrf table %u\n",  				    table_str, svrf->vrf->data.l.table_id);  			else -				zlog_warn( -				    "%s: Table %s overlaps vrf table %u", -				    __PRETTY_FUNCTION__, -				    table_str, svrf->vrf->data.l.table_id); +				zlog_warn("%s: Table %s overlaps vrf table %u", +					  __func__, table_str, +					  svrf->vrf->data.l.table_id);  			return CMD_WARNING_CONFIG_FAILED;  		}  	} @@ -379,7 +377,7 @@ static int static_route_leak(  			else  				zlog_warn(  					"%s: MPLS not turned on in kernel ignoring static route to %s", -					__PRETTY_FUNCTION__, dest_str); +					__func__, dest_str);  			return CMD_WARNING_CONFIG_FAILED;  		}  		int rc = mpls_str2label(label_str, &snh_label.num_labels, @@ -392,7 +390,7 @@ static int static_route_leak(  				else  					zlog_warn(  						"%s: Malformed labels specified for route %s", -						__PRETTY_FUNCTION__, dest_str); +						__func__, dest_str);  				break;  			case -2:  				if (vty) @@ -403,7 +401,7 @@ static int static_route_leak(  				else  					zlog_warn(  						"%s: Cannot use reserved labels (%d-%d) for %s", -						__PRETTY_FUNCTION__, +						__func__,  						MPLS_LABEL_RESERVED_MIN,  						MPLS_LABEL_RESERVED_MAX,  						dest_str); @@ -416,8 +414,8 @@ static int static_route_leak(  				else  					zlog_warn(  						"%s: Too many labels, Enter %d or fewer for %s", -						__PRETTY_FUNCTION__, -						MPLS_MAX_LABELS, dest_str); +						__func__, MPLS_MAX_LABELS, +						dest_str);  				break;  			}  			return CMD_WARNING_CONFIG_FAILED; @@ -439,7 +437,7 @@ static int static_route_leak(  			else  				zlog_warn(  					"%s: %s: Nexthop interface name can not be from reserved keywords (Null0, reject, blackhole)", -					__PRETTY_FUNCTION__, dest_str); +					__func__, dest_str);  			return CMD_WARNING_CONFIG_FAILED;  		}  	} @@ -462,8 +460,7 @@ static int static_route_leak(  					flag_str);  			else  				zlog_warn("%s: Malformed flag %s for %s", -					  __PRETTY_FUNCTION__, flag_str, -					  dest_str); +					  __func__, flag_str, dest_str);  			return CMD_WARNING_CONFIG_FAILED;  		}  	} @@ -477,8 +474,7 @@ static int static_route_leak(  			else  				zlog_warn(  					"%s: Malformed nexthop address %s for %s", -					__PRETTY_FUNCTION__, gate_str, -					dest_str); +					__func__, gate_str, dest_str);  			return CMD_WARNING_CONFIG_FAILED;  		}  		gatep = &gate; diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c index 42646d15bc..5cadf34365 100644 --- a/staticd/static_zebra.c +++ b/staticd/static_zebra.c @@ -122,12 +122,13 @@ static int route_notify_owner(ZAPI_CALLBACK_ARGS)  	case ZAPI_ROUTE_FAIL_INSTALL:  		static_nht_mark_state(&p, vrf_id, STATIC_NOT_INSTALLED);  		zlog_warn("%s: Route %s failed to install for table: %u", -			  __PRETTY_FUNCTION__, buf, table_id); +			  __func__, buf, table_id);  		break;  	case ZAPI_ROUTE_BETTER_ADMIN_WON:  		static_nht_mark_state(&p, vrf_id, STATIC_NOT_INSTALLED); -		zlog_warn("%s: Route %s over-ridden by better route for table: %u", -			  __PRETTY_FUNCTION__, buf, table_id); +		zlog_warn( +			"%s: Route %s over-ridden by better route for table: %u", +			__func__, buf, table_id);  		break;  	case ZAPI_ROUTE_INSTALLED:  		static_nht_mark_state(&p, vrf_id, STATIC_INSTALLED); @@ -138,7 +139,7 @@ static int route_notify_owner(ZAPI_CALLBACK_ARGS)  	case ZAPI_ROUTE_REMOVE_FAIL:  		static_nht_mark_state(&p, vrf_id, STATIC_INSTALLED);  		zlog_warn("%s: Route %s failure to remove for table: %u", -			  __PRETTY_FUNCTION__, buf, table_id); +			  __func__, buf, table_id);  		break;  	} @@ -335,8 +336,7 @@ void static_zebra_nht_register(struct route_node *rn,  	}  	if (zclient_send_rnh(zclient, cmd, &p, false, si->nh_vrf_id) < 0) -		zlog_warn("%s: Failure to send nexthop to zebra", -			  __PRETTY_FUNCTION__); +		zlog_warn("%s: Failure to send nexthop to zebra", __func__);  }  extern void static_zebra_route_add(struct route_node *rn, diff --git a/tests/bgpd/test_mpath.c b/tests/bgpd/test_mpath.c index 3f63c0499a..81dd4308ec 100644 --- a/tests/bgpd/test_mpath.c +++ b/tests/bgpd/test_mpath.c @@ -52,8 +52,8 @@  #define EXPECT_TRUE(expr, res)                                                 \  	if (!(expr)) {                                                         \ -		printf("Test failure in %s line %u: %s\n", __FUNCTION__,       \ -		       __LINE__, #expr);                                       \ +		printf("Test failure in %s line %u: %s\n", __func__, __LINE__, \ +		       #expr);                                                 \  		(res) = TEST_FAILED;                                           \  	} diff --git a/vrrpd/vrrp_zebra.c b/vrrpd/vrrp_zebra.c index 000672a080..a578921df6 100644 --- a/vrrpd/vrrp_zebra.c +++ b/vrrpd/vrrp_zebra.c @@ -204,5 +204,5 @@ void vrrp_zebra_init(void)  	zclient_init(zclient, ZEBRA_ROUTE_VRRP, 0, &vrrp_privs); -	zlog_notice("%s: zclient socket initialized", __PRETTY_FUNCTION__); +	zlog_notice("%s: zclient socket initialized", __func__);  } diff --git a/zebra/connected.c b/zebra/connected.c index 0ee41afa8f..5c713aa970 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -210,9 +210,10 @@ void connected_up(struct interface *ifp, struct connected *ifc)  	zvrf = zebra_vrf_lookup_by_id(ifp->vrf_id);  	if (!zvrf) { -		flog_err(EC_ZEBRA_VRF_NOT_FOUND, -			 "%s: Received Up for interface but no associated zvrf: %d", -			 __PRETTY_FUNCTION__, ifp->vrf_id); +		flog_err( +			EC_ZEBRA_VRF_NOT_FOUND, +			"%s: Received Up for interface but no associated zvrf: %d", +			__func__, ifp->vrf_id);  		return;  	}  	if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL)) @@ -355,9 +356,10 @@ void connected_down(struct interface *ifp, struct connected *ifc)  	zvrf = zebra_vrf_lookup_by_id(ifp->vrf_id);  	if (!zvrf) { -		flog_err(EC_ZEBRA_VRF_NOT_FOUND, -			 "%s: Received Up for interface but no associated zvrf: %d", -			 __PRETTY_FUNCTION__, ifp->vrf_id); +		flog_err( +			EC_ZEBRA_VRF_NOT_FOUND, +			"%s: Received Up for interface but no associated zvrf: %d", +			__func__, ifp->vrf_id);  		return;  	} diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 4731d1ed15..580efee40e 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -616,10 +616,10 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup)  	len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct ifinfomsg));  	if (len < 0) { -		zlog_err("%s: Message received from netlink is of a broken size: %d %zu", -			 __PRETTY_FUNCTION__, -			 h->nlmsg_len, -			 (size_t)NLMSG_LENGTH(sizeof(struct ifinfomsg))); +		zlog_err( +			"%s: Message received from netlink is of a broken size: %d %zu", +			__func__, h->nlmsg_len, +			(size_t)NLMSG_LENGTH(sizeof(struct ifinfomsg)));  		return -1;  	} @@ -975,10 +975,10 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)  	len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct ifaddrmsg));  	if (len < 0) { -		zlog_err("%s: Message received from netlink is of a broken size: %d %zu", -			 __PRETTY_FUNCTION__, -			 h->nlmsg_len, -			 (size_t)NLMSG_LENGTH(sizeof(struct ifaddrmsg))); +		zlog_err( +			"%s: Message received from netlink is of a broken size: %d %zu", +			__func__, h->nlmsg_len, +			(size_t)NLMSG_LENGTH(sizeof(struct ifaddrmsg)));  		return -1;  	} @@ -1176,9 +1176,10 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)  	len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct ifinfomsg));  	if (len < 0) { -		zlog_err("%s: Message received from netlink is of a broken size %d %zu", -			 __PRETTY_FUNCTION__, h->nlmsg_len, -			 (size_t)NLMSG_LENGTH(sizeof(struct ifinfomsg))); +		zlog_err( +			"%s: Message received from netlink is of a broken size %d %zu", +			__func__, h->nlmsg_len, +			(size_t)NLMSG_LENGTH(sizeof(struct ifinfomsg)));  		return -1;  	} diff --git a/zebra/interface.c b/zebra/interface.c index a434ba0d38..59cbfc6854 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -84,9 +84,8 @@ static int if_zebra_speed_update(struct thread *thread)  		return 1;  	if (new_speed != ifp->speed) { -		zlog_info("%s: %s old speed: %u new speed: %u", -			  __PRETTY_FUNCTION__, ifp->name, ifp->speed, -			  new_speed); +		zlog_info("%s: %s old speed: %u new speed: %u", __func__, +			  ifp->name, ifp->speed, new_speed);  		ifp->speed = new_speed;  		if_add_update(ifp);  		changed = true; diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 90d3aeb482..0d25798d39 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -697,8 +697,7 @@ static void netlink_parse_extended_ack(struct nlmsghdr *h)  			 * but noticing it for later.  			 */  			err_nlh = &err->msg; -			zlog_debug("%s: Received %s extended Ack", -				   __PRETTY_FUNCTION__, +			zlog_debug("%s: Received %s extended Ack", __func__,  				   nl_msg_type_to_str(err_nlh->nlmsg_type));  		}  	} @@ -844,7 +843,7 @@ int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int),  					if (IS_ZEBRA_DEBUG_KERNEL) {  						zlog_debug(  							"%s: %s ACK: type=%s(%u), seq=%u, pid=%u", -							__FUNCTION__, nl->name, +							__func__, nl->name,  							nl_msg_type_to_str(  								err->msg.nlmsg_type),  							err->msg.nlmsg_type, diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 3d203dea47..32051a62b7 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -346,14 +346,13 @@ void zebra_redistribute_add(ZAPI_HANDLER_ARGS)  	if (afi == 0 || afi >= AFI_MAX) {  		flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF, -			  "%s: Specified afi %d does not exist", -			  __PRETTY_FUNCTION__, afi); +			  "%s: Specified afi %d does not exist", __func__, afi);  		return;  	}  	if (type == 0 || type >= ZEBRA_ROUTE_MAX) {  		zlog_debug("%s: Specified Route Type %d does not exist", -			   __PRETTY_FUNCTION__, type); +			   __func__, type);  		return;  	} @@ -395,14 +394,13 @@ void zebra_redistribute_delete(ZAPI_HANDLER_ARGS)  	if (afi == 0 || afi >= AFI_MAX) {  		flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF, -			  "%s: Specified afi %d does not exist", -			  __PRETTY_FUNCTION__, afi); +			  "%s: Specified afi %d does not exist", __func__, afi);  		return;  	}  	if (type == 0 || type >= ZEBRA_ROUTE_MAX) {  		zlog_debug("%s: Specified Route Type %d does not exist", -			   __PRETTY_FUNCTION__, type); +			   __func__, type);  		return;  	} @@ -429,8 +427,7 @@ void zebra_redistribute_default_add(ZAPI_HANDLER_ARGS)  	if (afi == 0 || afi >= AFI_MAX) {  		flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF, -			  "%s: Specified afi %u does not exist", -			  __PRETTY_FUNCTION__, afi); +			  "%s: Specified afi %u does not exist", __func__, afi);  		return;  	} @@ -449,8 +446,7 @@ void zebra_redistribute_default_delete(ZAPI_HANDLER_ARGS)  	if (afi == 0 || afi >= AFI_MAX) {  		flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF, -			  "%s: Specified afi %u does not exist", -			  __PRETTY_FUNCTION__, afi); +			  "%s: Specified afi %u does not exist", __func__, afi);  		return;  	} diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 1d63db32e8..a417175da1 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -213,7 +213,7 @@ static inline int zebra2proto(int proto)  		 */  		zlog_debug(  			"%s: Please add this protocol(%d) to proper rt_netlink.c handling", -			__PRETTY_FUNCTION__, proto); +			__func__, proto);  		proto = RTPROT_ZEBRA;  		break;  	} @@ -280,7 +280,7 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop)  		 */  		zlog_debug(  			"%s: Please add this protocol(%d) to proper rt_netlink.c handling", -			__PRETTY_FUNCTION__, proto); +			__func__, proto);  		proto = ZEBRA_ROUTE_KERNEL;  		break;  	} @@ -439,7 +439,7 @@ static uint8_t parse_multipath_nexthops_unicast(ns_id_t ns_id,  				flog_warn(  					EC_ZEBRA_UNKNOWN_INTERFACE,  					"%s: Unknown interface %u specified, defaulting to VRF_DEFAULT", -					__PRETTY_FUNCTION__, index); +					__func__, index);  				nh_vrf_id = VRF_DEFAULT;  			}  		} else @@ -557,9 +557,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,  	len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct rtmsg));  	if (len < 0) { -		zlog_err("%s: Message received from netlink is of a broken size %d %zu", -			 __PRETTY_FUNCTION__, h->nlmsg_len, -			 (size_t)NLMSG_LENGTH(sizeof(struct rtmsg))); +		zlog_err( +			"%s: Message received from netlink is of a broken size %d %zu", +			__func__, h->nlmsg_len, +			(size_t)NLMSG_LENGTH(sizeof(struct rtmsg)));  		return -1;  	} @@ -951,10 +952,10 @@ int netlink_route_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)  	len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct rtmsg));  	if (len < 0) { -		zlog_err("%s: Message received from netlink is of a broken size: %d %zu", -			 __PRETTY_FUNCTION__, -			 h->nlmsg_len, -			 (size_t)NLMSG_LENGTH(sizeof(struct rtmsg))); +		zlog_err( +			"%s: Message received from netlink is of a broken size: %d %zu", +			__func__, h->nlmsg_len, +			(size_t)NLMSG_LENGTH(sizeof(struct rtmsg)));  		return -1;  	} @@ -2296,7 +2297,7 @@ static struct nexthop netlink_nexthop_process_nh(struct rtattr **tb,  		flog_warn(  			EC_ZEBRA_UNKNOWN_INTERFACE,  			"%s: Unknown nexthop interface %u received, defaulting to VRF_DEFAULT", -			__PRETTY_FUNCTION__, nh.ifindex); +			__func__, nh.ifindex);  		nh.vrf_id = VRF_DEFAULT;  	} @@ -2386,7 +2387,7 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)  	if (len < 0) {  		zlog_warn(  			"%s: Message received from netlink is of a broken size %d %zu", -			__PRETTY_FUNCTION__, h->nlmsg_len, +			__func__, h->nlmsg_len,  			(size_t)NLMSG_LENGTH(sizeof(struct nhmsg)));  		return -1;  	} @@ -2606,7 +2607,7 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)  	if (!ifp || !ifp->info) {  		if (IS_ZEBRA_DEBUG_KERNEL)  			zlog_debug("\t%s without associated interface: %u", -				   __PRETTY_FUNCTION__, ndm->ndm_ifindex); +				   __func__, ndm->ndm_ifindex);  		return 0;  	} @@ -2614,7 +2615,7 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)  	if (!IS_ZEBRA_IF_BRIDGE_SLAVE(ifp)) {  		if (IS_ZEBRA_DEBUG_KERNEL)  			zlog_debug("\t%s Not interested in %s, not a slave", -				   __PRETTY_FUNCTION__, ifp->name); +				   __func__, ifp->name);  		return 0;  	} @@ -2622,7 +2623,7 @@ static int netlink_macfdb_change(struct nlmsghdr *h, int len, ns_id_t ns_id)  	if (ndm->ndm_state & NUD_PERMANENT) {  		if (IS_ZEBRA_DEBUG_KERNEL)  			zlog_debug("\t%s Entry is PERMANENT, dropping", -				   __PRETTY_FUNCTION__); +				   __func__);  		return 0;  	} @@ -2871,8 +2872,7 @@ static int netlink_request_specific_mac_in_bridge(struct zebra_ns *zns,  	addattr32(&req.n, sizeof(req), NDA_MASTER, br_if->ifindex);  	if (IS_ZEBRA_DEBUG_KERNEL) -		zlog_debug("%s: Tx family %s IF %s(%u) MAC %s vid %u", -			   __PRETTY_FUNCTION__, +		zlog_debug("%s: Tx family %s IF %s(%u) MAC %s vid %u", __func__,  			   nl_family_to_str(req.ndm.ndm_family), br_if->name,  			   br_if->ifindex,  			   prefix_mac2str(mac, buf, sizeof(buf)), vid); @@ -3303,10 +3303,8 @@ int netlink_neigh_read_specific_ip(struct ipaddr *ip,  	if (IS_ZEBRA_DEBUG_KERNEL)  		zlog_debug("%s: neigh request IF %s(%u) IP %s vrf_id %u", -			   __PRETTY_FUNCTION__, vlan_if->name, -			   vlan_if->ifindex, -			   ipaddr2str(ip, buf, sizeof(buf)), -			   vlan_if->vrf_id); +			   __func__, vlan_if->name, vlan_if->ifindex, +			   ipaddr2str(ip, buf, sizeof(buf)), vlan_if->vrf_id);  	ret = netlink_request_specific_neigh_in_vlan(zns, RTM_GETNEIGH, ip,  					    vlan_if->ifindex); @@ -3330,9 +3328,10 @@ int netlink_neigh_change(struct nlmsghdr *h, ns_id_t ns_id)  	/* Length validity. */  	len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct ndmsg));  	if (len < 0) { -		zlog_err("%s: Message received from netlink is of a broken size %d %zu", -			 __PRETTY_FUNCTION__, h->nlmsg_len, -			 (size_t)NLMSG_LENGTH(sizeof(struct ndmsg))); +		zlog_err( +			"%s: Message received from netlink is of a broken size %d %zu", +			__func__, h->nlmsg_len, +			(size_t)NLMSG_LENGTH(sizeof(struct ndmsg)));  		return -1;  	} diff --git a/zebra/rule_netlink.c b/zebra/rule_netlink.c index 2fdb215128..c9699c7d95 100644 --- a/zebra/rule_netlink.c +++ b/zebra/rule_netlink.c @@ -201,9 +201,10 @@ int netlink_rule_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)  	len = h->nlmsg_len - NLMSG_LENGTH(sizeof(struct fib_rule_hdr));  	if (len < 0) { -		zlog_err("%s: Message received from netlink is of a broken size: %d %zu", -			 __PRETTY_FUNCTION__, h->nlmsg_len, -			 (size_t)NLMSG_LENGTH(sizeof(struct fib_rule_hdr))); +		zlog_err( +			"%s: Message received from netlink is of a broken size: %d %zu", +			__func__, h->nlmsg_len, +			(size_t)NLMSG_LENGTH(sizeof(struct fib_rule_hdr)));  		return -1;  	} diff --git a/zebra/rule_socket.c b/zebra/rule_socket.c index c5660abf3a..e2c650b4ad 100644 --- a/zebra/rule_socket.c +++ b/zebra/rule_socket.c @@ -46,14 +46,14 @@  enum zebra_dplane_result kernel_add_pbr_rule(struct zebra_pbr_rule *rule)  {  	flog_err(EC_LIB_UNAVAILABLE, "%s not Implemented for this platform", -		 __PRETTY_FUNCTION__); +		 __func__);  	return ZEBRA_DPLANE_REQUEST_FAILURE;  }  enum zebra_dplane_result kernel_del_pbr_rule(struct zebra_pbr_rule *rule)  {  	flog_err(EC_LIB_UNAVAILABLE, "%s not Implemented for this platform", -		 __PRETTY_FUNCTION__); +		 __func__);  	return ZEBRA_DPLANE_REQUEST_FAILURE;  } diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 1a5a293d11..509c0e1019 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1086,7 +1086,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)  			if (p.prefixlen > IPV4_MAX_BITLEN) {  				zlog_debug(  					"%s: Specified prefix hdr->length %d is too large for a v4 address", -					__PRETTY_FUNCTION__, p.prefixlen); +					__func__, p.prefixlen);  				return;  			}  			STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN); @@ -1096,7 +1096,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)  			if (p.prefixlen > IPV6_MAX_BITLEN) {  				zlog_debug(  					"%s: Specified prefix hdr->length %d is to large for a v6 address", -					__PRETTY_FUNCTION__, p.prefixlen); +					__func__, p.prefixlen);  				return;  			}  			STREAM_GET(&p.u.prefix6, s, IPV6_MAX_BYTELEN); @@ -1177,7 +1177,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)  			if (p.prefixlen > IPV4_MAX_BITLEN) {  				zlog_debug(  					"%s: Specified prefix hdr->length %d is to large for a v4 address", -					__PRETTY_FUNCTION__, p.prefixlen); +					__func__, p.prefixlen);  				return;  			}  			STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN); @@ -1187,7 +1187,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)  			if (p.prefixlen > IPV6_MAX_BITLEN) {  				zlog_debug(  					"%s: Specified prefix hdr->length %d is to large for a v6 address", -					__PRETTY_FUNCTION__, p.prefixlen); +					__func__, p.prefixlen);  				return;  			}  			STREAM_GET(&p.u.prefix6, s, IPV6_MAX_BYTELEN); @@ -1255,7 +1255,7 @@ static void zread_fec_register(ZAPI_HANDLER_ARGS)  			&& p.prefixlen > IPV6_MAX_BITLEN)) {  			zlog_debug(  				"%s: Specified prefix hdr->length: %d is to long for %d", -				__PRETTY_FUNCTION__, p.prefixlen, p.family); +				__func__, p.prefixlen, p.family);  			return;  		}  		l += 5; @@ -1321,7 +1321,7 @@ static void zread_fec_unregister(ZAPI_HANDLER_ARGS)  			&& p.prefixlen > IPV6_MAX_BITLEN)) {  			zlog_debug(  				"%s: Received prefix hdr->length %d which is greater than %d can support", -				__PRETTY_FUNCTION__, p.prefixlen, p.family); +				__func__, p.prefixlen, p.family);  			return;  		}  		l += 5; @@ -1426,7 +1426,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)  	if (zapi_route_decode(s, &api) < 0) {  		if (IS_ZEBRA_DEBUG_RECV)  			zlog_debug("%s: Unable to decode zapi_route sent", -				   __PRETTY_FUNCTION__); +				   __func__);  		return;  	} @@ -1563,7 +1563,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)  			flog_warn(  				EC_ZEBRA_NEXTHOP_CREATION_FAILED,  				"%s: Nexthops Specified: %d but we failed to properly create one", -				__PRETTY_FUNCTION__, api.nexthop_num); +				__func__, api.nexthop_num);  			nexthop_group_delete(&ng);  			XFREE(MTYPE_RE, re);  			return; @@ -1612,7 +1612,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)  	if (afi != AFI_IP6 && CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) {  		flog_warn(EC_ZEBRA_RX_SRCDEST_WRONG_AFI,  			  "%s: Received SRC Prefix but afi is not v6", -			  __PRETTY_FUNCTION__); +			  __func__);  		nexthop_group_delete(&ng);  		XFREE(MTYPE_RE, re);  		return; @@ -1663,7 +1663,7 @@ static void zread_route_del(ZAPI_HANDLER_ARGS)  	if (afi != AFI_IP6 && CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) {  		flog_warn(EC_ZEBRA_RX_SRCDEST_WRONG_AFI,  			  "%s: Received a src prefix while afi is not v6", -			  __PRETTY_FUNCTION__); +			  __func__);  		return;  	}  	if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) @@ -1816,7 +1816,7 @@ static void zread_mpls_labels_add(ZAPI_HANDLER_ARGS)  	if (zapi_labels_decode(s, &zl) < 0) {  		if (IS_ZEBRA_DEBUG_RECV)  			zlog_debug("%s: Unable to decode zapi_labels sent", -				   __PRETTY_FUNCTION__); +				   __func__);  		return;  	} @@ -1860,7 +1860,7 @@ static void zread_mpls_labels_delete(ZAPI_HANDLER_ARGS)  	if (zapi_labels_decode(s, &zl) < 0) {  		if (IS_ZEBRA_DEBUG_RECV)  			zlog_debug("%s: Unable to decode zapi_labels sent", -				   __PRETTY_FUNCTION__); +				   __func__);  		return;  	} @@ -1915,7 +1915,7 @@ static void zread_mpls_labels_replace(ZAPI_HANDLER_ARGS)  	if (zapi_labels_decode(s, &zl) < 0) {  		if (IS_ZEBRA_DEBUG_RECV)  			zlog_debug("%s: Unable to decode zapi_labels sent", -				   __PRETTY_FUNCTION__); +				   __func__);  		return;  	} diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c index 929e675351..d60da336fd 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c @@ -570,7 +570,7 @@ int zfpm_netlink_encode_route(int cmd, rib_dest_t *dest, struct route_entry *re,  	if (!netlink_route_info_fill(ri, cmd, dest, re))  		return 0; -	zfpm_log_route_info(ri, __FUNCTION__); +	zfpm_log_route_info(ri, __func__);  	return netlink_route_info_encode(ri, in_buf, in_buf_len);  } diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 8088b78a93..097dd7f024 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1693,7 +1693,7 @@ static unsigned nexthop_active_check(struct route_node *rn,  	if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) {  		if (IS_ZEBRA_DEBUG_RIB_DETAILED)  			zlog_debug("\t%s: Unable to find a active nexthop", -				   __PRETTY_FUNCTION__); +				   __func__);  		return 0;  	} @@ -1722,7 +1722,7 @@ static unsigned nexthop_active_check(struct route_node *rn,  	zvrf = zebra_vrf_lookup_by_id(nexthop->vrf_id);  	if (!zvrf) {  		if (IS_ZEBRA_DEBUG_RIB_DETAILED) -			zlog_debug("\t%s: zvrf is NULL", __PRETTY_FUNCTION__); +			zlog_debug("\t%s: zvrf is NULL", __func__);  		return CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE);  	} diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index ff3907451b..a11f428b57 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -458,7 +458,7 @@ void zebra_pbr_del_rule(struct zebra_pbr_rule *rule)  		XFREE(MTYPE_TMP, lookup);  	} else  		zlog_debug("%s: Rule being deleted we know nothing about", -			   __PRETTY_FUNCTION__); +			   __func__);  }  static void zebra_pbr_cleanup_rules(struct hash_bucket *b, void *data) @@ -572,7 +572,7 @@ void zebra_pbr_destroy_ipset(struct zebra_pbr_ipset *ipset)  	} else  		zlog_debug(  			"%s: IPSet Entry being deleted we know nothing about", -			__PRETTY_FUNCTION__); +			__func__);  }  struct pbr_ipset_name_lookup { @@ -651,7 +651,7 @@ void zebra_pbr_del_ipset_entry(struct zebra_pbr_ipset_entry *ipset)  		XFREE(MTYPE_TMP, lookup);  	} else  		zlog_debug("%s: IPSet being deleted we know nothing about", -			   __PRETTY_FUNCTION__); +			   __func__);  }  static void *pbr_iptable_alloc_intern(void *arg) diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index b80c9026a7..669cb2466f 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -390,7 +390,7 @@ static int zebra_ptm_socket_init(void)  	if (set_nonblocking(sock) < 0) {  		if (IS_ZEBRA_DEBUG_EVENT)  			zlog_debug("%s: Unable to set socket non blocking[%s]", -				   __PRETTY_FUNCTION__, safe_strerror(errno)); +				   __func__, safe_strerror(errno));  		close(sock);  		return -1;  	} diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 6a2e20d05a..29d59b515f 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -632,10 +632,11 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq)  		if (IS_ZEBRA_DEBUG_NHT_DETAILED) {  			char buf[PREFIX_STRLEN]; -			zlog_debug("%s: %s Being examined for Nexthop Tracking Count: %zd", -				   __PRETTY_FUNCTION__, -				   srcdest_rnode2str(rn, buf, sizeof(buf)), -				   dest ? rnh_list_count(&dest->nht) : 0); +			zlog_debug( +				"%s: %s Being examined for Nexthop Tracking Count: %zd", +				__func__, +				srcdest_rnode2str(rn, buf, sizeof(buf)), +				dest ? rnh_list_count(&dest->nht) : 0);  		}  		if (!dest) {  			rn = rn->parent; diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 74c3ac3712..b538126632 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -111,8 +111,8 @@ static void zebra_rnh_remove_from_routing_table(struct rnh *rnh)  		char buf[PREFIX_STRLEN];  		char buf1[PREFIX_STRLEN]; -		zlog_debug("%s: %u:%s removed from tracking on %s", -			   __PRETTY_FUNCTION__, rnh->vrf_id, +		zlog_debug("%s: %u:%s removed from tracking on %s", __func__, +			   rnh->vrf_id,  			   prefix2str(&rnh->node->p, buf, sizeof(buf)),  			   srcdest_rnode2str(rn, buf1, sizeof(buf)));  	} @@ -137,8 +137,8 @@ static void zebra_rnh_store_in_routing_table(struct rnh *rnh)  		char buf[PREFIX_STRLEN];  		char buf1[PREFIX_STRLEN]; -		zlog_debug("%s: %u:%s added for tracking on %s", -			   __PRETTY_FUNCTION__, rnh->vrf_id, +		zlog_debug("%s: %u:%s added for tracking on %s", __func__, +			   rnh->vrf_id,  			   prefix2str(&rnh->node->p, buf, sizeof(buf)),  			   srcdest_rnode2str(rn, buf1, sizeof(buf)));  	} @@ -452,8 +452,8 @@ zebra_rnh_resolve_import_entry(struct zebra_vrf *zvrf, afi_t afi,  		char buf[PREFIX_STRLEN];  		char buf1[PREFIX_STRLEN]; -		zlog_debug("%s: %u:%s Resolved Import Entry to %s", -			   __PRETTY_FUNCTION__, rnh->vrf_id, +		zlog_debug("%s: %u:%s Resolved Import Entry to %s", __func__, +			   rnh->vrf_id,  			   prefix2str(&rnh->node->p, buf, sizeof(buf)),  			   srcdest_rnode2str(rn, buf1, sizeof(buf)));  	} diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 0bfcd8f0be..caff99dbe2 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -254,8 +254,8 @@ static int host_rb_entry_compare(const struct host_rb_entry *hle1,  		return memcmp(&hle1->p.u.prefix6, &hle2->p.u.prefix6,  			      IPV6_MAX_BYTELEN);  	} else { -		zlog_debug("%s: Unexpected family type: %d", -			   __PRETTY_FUNCTION__, hle1->p.family); +		zlog_debug("%s: Unexpected family type: %d", __func__, +			   hle1->p.family);  		return 0;  	}  } @@ -590,8 +590,8 @@ static void zebra_vxlan_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf,  	if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE)) {  		if (IS_ZEBRA_DEBUG_VXLAN)  			zlog_debug( -				   "%s: duplicate addr MAC %s IP %s flags 0x%x skip installing, learn count %u recover time %u", -					   __PRETTY_FUNCTION__, +				"%s: duplicate addr MAC %s IP %s flags 0x%x skip installing, learn count %u recover time %u", +				__func__,  				prefix_mac2str(&nbr->emac, buf, sizeof(buf)),  				ipaddr2str(&nbr->ip, buf1, sizeof(buf1)),  				nbr->flags, nbr->dad_count, @@ -631,7 +631,7 @@ static void zebra_vxlan_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf,  		if (IS_ZEBRA_DEBUG_VXLAN)  			zlog_debug(  				"%s: duplicate addr MAC %s IP %s flags 0x%x detection time passed, reset learn count %u", -				__PRETTY_FUNCTION__, +				__func__,  				prefix_mac2str(&nbr->emac, buf, sizeof(buf)),  				ipaddr2str(&nbr->ip, buf1, sizeof(buf1)),  				nbr->flags, nbr->dad_count); @@ -681,10 +681,12 @@ static void zebra_vxlan_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf,  			if (IS_ZEBRA_DEBUG_VXLAN)  				zlog_debug(  					"%s: duplicate addr MAC %s IP %s flags 0x%x auto recovery time %u start", -				   __PRETTY_FUNCTION__, -				   prefix_mac2str(&nbr->emac, buf, sizeof(buf)), -				   ipaddr2str(&nbr->ip, buf1, sizeof(buf1)), -				   nbr->flags, zvrf->dad_freeze_time); +					__func__, +					prefix_mac2str(&nbr->emac, buf, +						       sizeof(buf)), +					ipaddr2str(&nbr->ip, buf1, +						   sizeof(buf1)), +					nbr->flags, zvrf->dad_freeze_time);  			thread_add_timer(zrouter.master,  				zebra_vxlan_dad_ip_auto_recovery_exp, @@ -3426,11 +3428,10 @@ static bool zvni_check_mac_del_from_db(struct mac_walk_ctx *wctx,  		if (IS_ZEBRA_DEBUG_VXLAN) {  			char buf[ETHER_ADDR_STRLEN]; -			zlog_debug("%s: Del MAC %s flags 0x%x", -				   __PRETTY_FUNCTION__, -				   prefix_mac2str(&mac->macaddr, -						  buf, sizeof(buf)), -				   mac->flags); +			zlog_debug( +				"%s: Del MAC %s flags 0x%x", __func__, +				prefix_mac2str(&mac->macaddr, buf, sizeof(buf)), +				mac->flags);  		}  		wctx->uninstall = 0; @@ -5881,7 +5882,7 @@ static void process_remote_macip_del(vni_t vni,  			if (IS_ZEBRA_DEBUG_VXLAN)  				zlog_debug(  					"%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry", -					__PRETTY_FUNCTION__, +					__func__,  					ipaddr2str(ipaddr, buf1, sizeof(buf1)),  					n->flags,  					vlan_if ? vlan_if->name : "Unknown"); @@ -5911,11 +5912,12 @@ static void process_remote_macip_del(vni_t vni,  		    CHECK_FLAG(mac->flags, ZEBRA_MAC_DUPLICATE) &&  		    CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE)) {  			if (IS_ZEBRA_DEBUG_VXLAN) -				zlog_debug("%s: MAC %s (flags 0x%x) is remote and duplicate, read kernel for local entry", -					   __PRETTY_FUNCTION__, -					   prefix_mac2str(macaddr, buf, -							  sizeof(buf)), -					   mac->flags); +				zlog_debug( +					"%s: MAC %s (flags 0x%x) is remote and duplicate, read kernel for local entry", +					__func__, +					prefix_mac2str(macaddr, buf, +						       sizeof(buf)), +					mac->flags);  			macfdb_read_specific_mac(zns, zif->brslave_info.br_if,  						 macaddr, vxl->access_vlan);  		} @@ -6981,8 +6983,7 @@ int zebra_vxlan_clear_dup_detect_vni_ip(struct vty *vty,  	if (IS_ZEBRA_DEBUG_VXLAN)  		zlog_debug("%s: clear neigh %s in dup state, flags 0x%x seq %u", -			   __PRETTY_FUNCTION__, buf, nbr->flags, -			   nbr->loc_seq); +			   __func__, buf, nbr->flags, nbr->loc_seq);  	UNSET_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE);  	nbr->dad_count = 0; @@ -7075,10 +7076,8 @@ static void zvni_clear_dup_neigh_hash(struct hash_bucket *bucket, void *ctxt)  	if (IS_ZEBRA_DEBUG_VXLAN) {  		ipaddr2str(&nbr->ip, buf, sizeof(buf)); -		zlog_debug( -		"%s: clear neigh %s dup state, flags 0x%x seq %u", -			   __PRETTY_FUNCTION__, buf, -			   nbr->flags, nbr->loc_seq); +		zlog_debug("%s: clear neigh %s dup state, flags 0x%x seq %u", +			   __func__, buf, nbr->flags, nbr->loc_seq);  	}  	UNSET_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE); @@ -7513,9 +7512,10 @@ int zebra_vxlan_handle_kernel_neigh_del(struct interface *ifp,  	zvni = zvni_from_svi(ifp, link_if);  	if (!zvni) {  		if (IS_ZEBRA_DEBUG_VXLAN) -			zlog_debug("%s: Del neighbor %s VNI is not present for interface %s", -				   __PRETTY_FUNCTION__, -				   ipaddr2str(ip, buf, sizeof(buf)), ifp->name); +			zlog_debug( +				"%s: Del neighbor %s VNI is not present for interface %s", +				__func__, ipaddr2str(ip, buf, sizeof(buf)), +				ifp->name);  		return 0;  	} @@ -7558,8 +7558,8 @@ int zebra_vxlan_handle_kernel_neigh_del(struct interface *ifp,  	zvrf = vrf_info_lookup(zvni->vxlan_if->vrf_id);  	if (!zvrf) { -		zlog_debug("%s: VNI %u vrf lookup failed.", -				   __PRETTY_FUNCTION__, zvni->vni); +		zlog_debug("%s: VNI %u vrf lookup failed.", __func__, +			   zvni->vni);  		return -1;  	} @@ -8173,7 +8173,7 @@ void zebra_vxlan_remote_vtep_del(ZAPI_HANDLER_ARGS)  	if (!is_evpn_enabled()) {  		zlog_debug(  			"%s: EVPN is not enabled yet we have received a vtep del command", -			__PRETTY_FUNCTION__); +			__func__);  		return;  	} @@ -8263,7 +8263,7 @@ void zebra_vxlan_remote_vtep_add(ZAPI_HANDLER_ARGS)  	if (!is_evpn_enabled()) {  		zlog_debug(  			"%s: EVPN not enabled yet we received a vtep_add zapi call", -			__PRETTY_FUNCTION__); +			__func__);  		return;  	} @@ -9178,12 +9178,12 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni,  		zl3vni->mac_vlan_if = zl3vni_map_to_mac_vlan_if(zl3vni);  		if (IS_ZEBRA_DEBUG_VXLAN) -			zlog_debug("%s: l3vni %u svi_if %s mac_vlan_if %s", -				   __PRETTY_FUNCTION__, vni, -				   zl3vni->svi_if ? -				   zl3vni->svi_if->name : "NIL", -				   zl3vni->mac_vlan_if ? -				   zl3vni->mac_vlan_if->name : "NIL"); +			zlog_debug( +				"%s: l3vni %u svi_if %s mac_vlan_if %s", +				__func__, vni, +				zl3vni->svi_if ? zl3vni->svi_if->name : "NIL", +				zl3vni->mac_vlan_if ? zl3vni->mac_vlan_if->name +						    : "NIL");  		/* formulate l2vni list */  		hash_iterate(zvrf_evpn->vni_table, zvni_add_to_l3vni_list, @@ -9736,12 +9736,12 @@ static int zebra_vxlan_dad_ip_auto_recovery_exp(struct thread *t)  		return 0;  	if (IS_ZEBRA_DEBUG_VXLAN) -		zlog_debug("%s: duplicate addr MAC %s IP %s flags 0x%x learn count %u vni %u auto recovery expired", -			  __PRETTY_FUNCTION__, -			  prefix_mac2str(&nbr->emac, buf2, sizeof(buf2)), -			  ipaddr2str(&nbr->ip, buf1, sizeof(buf1)), -			  nbr->flags, -			  nbr->dad_count, zvni->vni); +		zlog_debug( +			"%s: duplicate addr MAC %s IP %s flags 0x%x learn count %u vni %u auto recovery expired", +			__func__, +			prefix_mac2str(&nbr->emac, buf2, sizeof(buf2)), +			ipaddr2str(&nbr->ip, buf1, sizeof(buf1)), nbr->flags, +			nbr->dad_count, zvni->vni);  	UNSET_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE);  	nbr->dad_count = 0;  | 
