Browse code

- fixed SUBST_{SND,RCV}_IP for the ipv6 case (address must be enclosed in [])

Andrei Pelinescu-Onciul authored on 31/03/2003 19:56:37
Showing 1 changed files
... ...
@@ -515,9 +515,15 @@ static inline void process_lumps(	struct sip_msg* msg,
515 515
 	switch((subst_l)->u.subst){ \
516 516
 		case SUBST_RCV_IP: \
517 517
 			if (msg->rcv.bind_address){  \
518
+				if (msg->rcv.bind_address->address.af!=AF_INET){\
519
+					new_buf[offset]='['; offset++; \
520
+				}\
518 521
 				memcpy(new_buf+offset, msg->rcv.bind_address->address_str.s, \
519 522
 						msg->rcv.bind_address->address_str.len); \
520 523
 				offset+=msg->rcv.bind_address->address_str.len; \
524
+				if (msg->rcv.bind_address->address.af!=AF_INET){\
525
+					new_buf[offset]=']'; offset++; \
526
+				}\
521 527
 			}else{  \
522 528
 				/*FIXME*/ \
523 529
 				LOG(L_CRIT, "FIXME: process_lumps: null bind_address\n"); \
... ...
@@ -535,9 +541,15 @@ static inline void process_lumps(	struct sip_msg* msg,
535 535
 			break; \
536 536
 		case SUBST_SND_IP: \
537 537
 			if (send_sock){  \
538
+				if (send_sock->address.af!=AF_INET){\
539
+					new_buf[offset]='['; offset++; \
540
+				}\
538 541
 				memcpy(new_buf+offset, send_sock->address_str.s, \
539 542
 									send_sock->address_str.len); \
540 543
 				offset+=send_sock->address_str.len; \
544
+				if (send_sock->address.af!=AF_INET){\
545
+					new_buf[offset]=']'; offset++; \
546
+				}\
541 547
 			}else{  \
542 548
 				/*FIXME*/ \
543 549
 				LOG(L_CRIT, "FIXME: process_lumps: called with" \