Browse code

Fixed: IP address in Warning header was not 3261 ABNF compliant (discovered at SIPit23)

Nils Ohlmeier authored on 29/10/2008 23:03:22
Showing 1 changed files
... ...
@@ -265,6 +265,13 @@ static char * warning_builder( struct sip_msg *msg, unsigned int *returned_len)
265 265
 			str_pair_print(string, t, print_len);\
266 266
 		} while(0)
267 267
 
268
+#define str_su_print(sockaddr)\
269
+		do{\
270
+			t=su2a(&sockaddr, sizeof(sockaddr)); \
271
+			print_len=strlen(t); \
272
+			str_print(t, print_len); \
273
+		} while(0)
274
+
268 275
 #define str_ipaddr_print(string, ipaddr_val)\
269 276
 		do{\
270 277
 			t=ip_addr2a((ipaddr_val)); \
... ...
@@ -273,11 +280,8 @@ static char * warning_builder( struct sip_msg *msg, unsigned int *returned_len)
273 273
 		} while(0)
274 274
 
275 275
 	clen=0;
276
-	str_lenpair_print(WARNING, WARNING_LEN,
277
-						msg->rcv.bind_address->name.s,
278
-						msg->rcv.bind_address->name.len);
279
-	str_lenpair_print(":", 1, msg->rcv.bind_address->port_no_str.s,
280
-						msg->rcv.bind_address->port_no_str.len);
276
+	str_print(WARNING, WARNING_LEN);
277
+	str_su_print(msg->rcv.bind_address->su);
281 278
 	str_print(WARNING_PHRASE, WARNING_PHRASE_LEN);
282 279
 
283 280
 	/*adding out_uri*/