Skip to content

Commit

Permalink
rename s_addr to avoid overlapping with Solaris structs
Browse files Browse the repository at this point in the history
Discovered by Nathaniel L. Keeling

(cherry picked from commit 6c99004)
  • Loading branch information
razvancrainea committed Feb 29, 2016
1 parent 8dce547 commit aa4b580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions modules/emergency/sip_emergency.c
Expand Up @@ -303,7 +303,7 @@ int get_callid_header(struct sip_msg *msg, char** callidHeader) {


// get ip address of opensips server in port that receive INVITE
int get_ip_socket(struct sip_msg *msg, char** s_addr){
int get_ip_socket(struct sip_msg *msg, char** saddr){

char *socket;
struct socket_info** list;
Expand All @@ -316,7 +316,7 @@ int get_ip_socket(struct sip_msg *msg, char** s_addr){
}

si = *list;
*s_addr = NULL;
*saddr = NULL;

while (si) {
if (si->port_no == msg->rcv.dst_port) {
Expand All @@ -325,7 +325,8 @@ int get_ip_socket(struct sip_msg *msg, char** s_addr){
LM_ERR("no more pkg memory\n");
return -1;
}
*s_addr = socket;

*saddr = socket;
*socket = '@';
socket++;
memcpy(socket, si->address_str.s, si->address_str.len);
Expand All @@ -336,12 +337,12 @@ int get_ip_socket(struct sip_msg *msg, char** s_addr){
socket = socket + si->port_no_str.len;
*socket = 0;

LM_INFO(" --- SERVER = %s \n \n", *s_addr);
LM_INFO(" --- SERVER = %s \n \n", *saddr);
break;
}
si = si->next;
}
if (*s_addr == NULL) {
if (*saddr == NULL) {
LM_ERR("failed in found ip listen\n");
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/emergency/sip_emergency.h
Expand Up @@ -62,5 +62,5 @@ int add_hdr_PAI(struct sip_msg *msg, str cbn);
int find_body_pidf(struct sip_msg *msg, char** pidf_body);
int proxy_request(struct sip_msg *msg,char *call_server_hostname);
int new_uri_proxy(struct sip_msg *req_msg, char* new_uri );
int get_ip_socket(struct sip_msg *msg, char** s_addr);
int get_ip_socket(struct sip_msg *msg, char** saddr);
int extract_contact_hdrs(struct sip_msg *reply, char **contact_esgwri, char **contact_lro);

0 comments on commit aa4b580

Please sign in to comment.