Browse code

core: IPv6 addr enclosed in square brackets for process descripton

- UDP and SCTP listeners will have the IPv6 address in between square
brackets inside the description string

Daniel-Constantin Mierla authored on 07/06/2011 21:19:18
Showing 1 changed files
... ...
@@ -1541,9 +1541,15 @@ int main_loop()
1541 1541
 		/* udp processes */
1542 1542
 		for(si=udp_listen; si; si=si->next){
1543 1543
 			for(i=0;i<children_no;i++){
1544
-				snprintf(si_desc, MAX_PT_DESC, "udp receiver child=%d "
1544
+				if(si->address.af==AF_INET6) {
1545
+					snprintf(si_desc, MAX_PT_DESC, "udp receiver child=%d "
1546
+						"sock=[%s]:%s",
1547
+						i, si->name.s, si->port_no_str.s);
1548
+				} else {
1549
+					snprintf(si_desc, MAX_PT_DESC, "udp receiver child=%d "
1545 1550
 						"sock=%s:%s",
1546 1551
 						i, si->name.s, si->port_no_str.s);
1552
+				}
1547 1553
 				child_rank++;
1548 1554
 				pid = fork_process(child_rank, si_desc, 1);
1549 1555
 				if (pid<0){
... ...
@@ -1566,9 +1572,15 @@ int main_loop()
1566 1566
 		if (!sctp_disable){
1567 1567
 			for(si=sctp_listen; si; si=si->next){
1568 1568
 				for(i=0;i<sctp_children_no;i++){
1569
-					snprintf(si_desc, MAX_PT_DESC, "sctp receiver child=%d "
1569
+					if(si->address.af==AF_INET6) {
1570
+						snprintf(si_desc, MAX_PT_DESC, "sctp receiver child=%d "
1571
+								"sock=[%s]:%s",
1572
+								i, si->name.s, si->port_no_str.s);
1573
+					} else {
1574
+						snprintf(si_desc, MAX_PT_DESC, "sctp receiver child=%d "
1570 1575
 								"sock=%s:%s",
1571 1576
 								i, si->name.s, si->port_no_str.s);
1577
+					}
1572 1578
 					child_rank++;
1573 1579
 					pid = fork_process(child_rank, si_desc, 1);
1574 1580
 					if (pid<0){