aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-30 16:56:51 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-30 16:56:51 +0000
commit34117659e31effca1195dcebcb884e58b0446a18 (patch)
treea80f97f17cee88dd8e10127d0d520b04fb94b94d
parent14feeee6dc3e86b0b9f1eee325fcb2478f66cf3f (diff)
Use INET_ADDRLEN (bug #1956) (from airport!)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3364 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xacl.c19
-rwxr-xr-xchannels/chan_h323.c8
-rwxr-xr-xchannels/chan_iax.c34
-rwxr-xr-xchannels/chan_iax2.c45
-rwxr-xr-xchannels/chan_mgcp.c20
-rwxr-xr-xchannels/chan_sip.c80
-rwxr-xr-xchannels/chan_skinny.c6
-rwxr-xr-xchannels/iax2-parser.c4
-rwxr-xr-xmanager.c10
-rwxr-xr-xres/res_osp.c8
-rwxr-xr-xrtp.c12
11 files changed, 125 insertions, 121 deletions
diff --git a/acl.c b/acl.c
index d42f8b2d1..6c460969f 100755
--- a/acl.c
+++ b/acl.c
@@ -170,10 +170,13 @@ int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin)
/* Start optimistic */
int res = AST_SENSE_ALLOW;
while(ha) {
- char tmp[80];
- char tmp2[80];
+ char iabuf[INET_ADDRSTRLEN];
+ char iabuf2[INET_ADDRSTRLEN];
/* DEBUG */
- ast_log(LOG_DEBUG, "##### Testing %s with %s\n",ast_inet_ntoa(tmp, sizeof(tmp), sin->sin_addr), ast_inet_ntoa(tmp2, sizeof(tmp2), ha->netaddr));
+ ast_log(LOG_DEBUG,
+ "##### Testing %s with %s\n",
+ ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr),
+ ast_inet_ntoa(iabuf2, sizeof(iabuf2), ha->netaddr));
/* For each rule, if this address and the netmask = the net address
apply the current rule */
if ((sin->sin_addr.s_addr & ha->netmask.s_addr) == (ha->netaddr.s_addr))
@@ -228,13 +231,13 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
struct rt_msghdr m_rtm;
char m_space[512];
} m_rtmsg;
- char tmp[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cp, *p;
int i, l, s, seq, flags;
pid_t pid = getpid();
static int routeseq; /* Protected by "routeseq_lock" mutex */
- p = ast_strdupa(ast_inet_ntoa(tmp, sizeof(tmp), *them));
+ p = ast_strdupa(ast_inet_ntoa(iabuf, sizeof(iabuf), *them));
memset(us, 0, sizeof(struct in_addr));
memset(&m_rtmsg, 0, sizeof(m_rtmsg));
@@ -297,7 +300,7 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
if (i == RTA_IFA && sa->sa_family == AF_INET) {
sin = (struct sockaddr_in *)sa;
*us = sin->sin_addr;
- ast_log(LOG_DEBUG, "Found route to %s, output from our address %s.\n", p, ast_inet_ntoa(tmp, sizeof(tmp), *us));
+ ast_log(LOG_DEBUG, "Found route to %s, output from our address %s.\n", p, ast_inet_ntoa(iabuf, sizeof(iabuf), *us));
return 0;
}
cp += sa->sa_len > 0 ?
@@ -354,8 +357,8 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
sscanf(fields[2],"%x",&gateway);
sscanf(fields[7],"%x",&mask);
#if 0
- { char tmp[80];
- printf("Addr: %s %08x Dest: %08x Mask: %08x\n", ast_inet_ntoa(tmp, sizeof(tmp), *them), remote_ip, dest, mask); }
+ { char iabuf[INET_ADDRSTRLEN];
+ printf("Addr: %s %08x Dest: %08x Mask: %08x\n", ast_inet_ntoa(iabuf, sizeof(iabuf), *them), remote_ip, dest, mask); }
#endif
/* Looks simple, but here is the magic */
if (((remote_ip & mask) ^ dest) == 0) {
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 6677ab03d..45398ffa4 100755
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -918,7 +918,7 @@ struct oh323_alias *find_alias(const char *source_aliases)
struct oh323_user *find_user(const call_details_t cd)
{
struct oh323_user *u;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
u = userl.users;
if(userbyalias == 1){
while(u) {
@@ -1002,7 +1002,7 @@ struct rtp_info *create_connection(unsigned call_reference)
but this function wants to return a static variable so
the only way to do this will be to declare iabuf within
the oh323_pvt structure XXX */
- static char iabuf[80];
+ static char iabuf[INET_ADDRSTRLEN];
info = (struct rtp_info *) malloc(sizeof(struct rtp_info));
@@ -1036,7 +1036,7 @@ int setup_incoming_call(call_details_t cd)
/* struct ast_channel *c = NULL; */
struct oh323_user *user = NULL;
struct oh323_alias *alias = NULL;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* allocate the call*/
p = oh323_alloc(cd.call_reference);
@@ -1839,7 +1839,7 @@ static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, str
struct sockaddr_in them;
struct sockaddr_in us;
char *mode;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
mode = convertcap(chan->writeformat);
diff --git a/channels/chan_iax.c b/channels/chan_iax.c
index 9f0356a6a..3ebd4fb19 100755
--- a/channels/chan_iax.c
+++ b/channels/chan_iax.c
@@ -509,7 +509,7 @@ static void showframe(struct ast_iax_frame *f, struct ast_iax_full_hdr *fhi, int
char subclass2[20];
char *class;
char *subclass;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (f) {
fh = f->data;
snprintf(retries, sizeof(retries), "%03d", f->retries);
@@ -940,7 +940,7 @@ static int handle_error(void)
static int send_packet(struct ast_iax_frame *f)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Called with iaxsl held */
if (option_debug)
ast_log(LOG_DEBUG, "Sending %d on %d/%d to %s:%d\n", f->ts, f->callno, iaxs[f->callno]->peercallno, ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[f->callno]->addr.sin_addr), ntohs(iaxs[f->callno]->addr.sin_port));
@@ -1110,7 +1110,7 @@ static int attempt_transmit(void *data)
struct ast_iax_frame *f = data;
int freeme=0;
int callno = f->callno;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Make sure this call is still active */
if (callno > -1)
ast_mutex_lock(&iaxsl[callno]);
@@ -1905,7 +1905,7 @@ static int iax_start_transfer(struct ast_channel *c0, struct ast_channel *c1)
int res;
char req0[256];
char req1[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct chan_iax_pvt *p0 = c0->pvt->pvt;
struct chan_iax_pvt *p1 = c1->pvt->pvt;
snprintf(req0, sizeof(req0), "remip=%s;remport=%d;remcall=%d;", ast_inet_ntoa(iabuf, sizeof(iabuf), p1->addr.sin_addr), ntohs(p1->addr.sin_port), p1->peercallno);
@@ -2083,7 +2083,7 @@ static struct ast_channel *ast_iax_new(struct chan_iax_pvt *i, int state, int ca
{
char host[256];
struct ast_channel *tmp;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
tmp = ast_channel_alloc(1);
if (tmp) {
if (!iax_getpeername(i->addr, host, sizeof(host)))
@@ -2339,7 +2339,7 @@ static int iax_show_peers(int fd, int argc, char *argv[])
#define FORMAT "%-15.15s %-15.15s %s %-15.15s %-8d %-10s\n"
struct iax_peer *peer;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
@@ -2414,7 +2414,7 @@ static int iax_show_registry(int fd, int argc, char *argv[])
struct iax_registry *reg;
char host[80];
char perceived[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
@@ -2440,7 +2440,7 @@ static int iax_show_channels(int fd, int argc, char *argv[])
#define FORMAT "%-15.15s %-10.10s %5.5d/%5.5d %5.5d/%5.5d %-5.5dms %-4.4dms %-6.6s\n"
int x;
int numchans = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT2, "Peer", "Username", "ID (Lo/Rem)", "Seq (Tx/Rx)", "Lag", "Jitter", "Format");
@@ -2634,7 +2634,7 @@ static int check_access(int callno, struct sockaddr_in *sin, char *orequest, int
char *var, *value;
struct iax_user *user;
char request[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int gotcapability=0;
char *stringp=NULL;
strncpy(request, orequest, sizeof(request)-1);
@@ -2745,7 +2745,7 @@ static int check_access(int callno, struct sockaddr_in *sin, char *orequest, int
static int raw_hangup(struct sockaddr_in *sin, short src, short dst)
{
struct ast_iax_full_hdr fh;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
fh.callno = htons(src | AST_FLAG_FULL);
fh.dcallno = htons(dst);
fh.ts = 0;
@@ -2851,7 +2851,7 @@ static int register_verify(int callno, struct sockaddr_in *sin, char *orequest)
char md5secret[256] = "";
char rsasecret[256] = "";
char secret[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax_peer *p;
struct ast_key *key;
char *var;
@@ -2996,7 +2996,7 @@ static int authenticate(char *challenge, char *secret, char *keyn, char *methods
{
int res = -1;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (keyn && strlen(keyn)) {
if (!strstr(methods, "rsa")) {
if (!secret || !strlen(secret))
@@ -3304,7 +3304,7 @@ static int iax_ack_registry(char *orequest, struct sockaddr_in *sin, int callno)
int ourport = 0;
int refresh = 0;
char ourip[256] = "<Unspecified>";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sockaddr_in oldus;
char *var, *value;
char *stringp=NULL;
@@ -3442,7 +3442,7 @@ static int update_registry(char *name, struct sockaddr_in *sin, int callno)
/* Called from IAX thread only, with proper iaxsl lock */
char requeststr[256] = "";
struct iax_peer *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (p = peerl.peers;p;p = p->next) {
if (!strcasecmp(name, p->name)) {
break;
@@ -3524,7 +3524,7 @@ static int registry_rerequest(char *orequest, int callno, struct sockaddr_in *si
char peer[256] = "";
char methods[256] = "";
char challenge[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *var, *value;
int res;
char *stringp=NULL;
@@ -3666,7 +3666,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
int format;
int exists;
int mm;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char rel0[256];
char rel1[255];
char empty[32]=""; /* Safety measure */
@@ -5400,7 +5400,7 @@ int load_module(void)
int x;
struct iax_registry *reg;
struct iax_peer *peer;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sockaddr_in sin;
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 8b0761270..1196949cb 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -629,7 +629,7 @@ static int iax2_getpeername(struct sockaddr_in sin, char *host, int len, int loc
static struct chan_iax2_pvt *new_iax(struct sockaddr_in *sin, int lockpeer)
{
struct chan_iax2_pvt *tmp;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
tmp = malloc(sizeof(struct chan_iax2_pvt));
if (tmp) {
memset(tmp, 0, sizeof(struct chan_iax2_pvt));
@@ -1195,7 +1195,7 @@ static int transmit_trunk(struct iax_frame *f, struct sockaddr_in *sin)
static int send_packet(struct iax_frame *f)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Called with iaxsl held */
if (option_debug)
ast_log(LOG_DEBUG, "Sending %d on %d/%d to %s:%d\n", f->ts, f->callno, iaxs[f->callno]->peercallno, ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[f->callno]->addr.sin_addr), ntohs(iaxs[f->callno]->addr.sin_port));
@@ -1386,7 +1386,7 @@ static int attempt_transmit(void *data)
struct iax_frame *f = data;
int freeme=0;
int callno = f->callno;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Make sure this call is still active */
if (callno)
ast_mutex_lock(&iaxsl[callno]);
@@ -1597,7 +1597,7 @@ static unsigned int calc_fakestamp(struct chan_iax2_pvt *from, struct chan_iax2_
static int forward_delivery(struct iax_frame *fr)
{
struct chan_iax2_pvt *p1, *p2;
- char tmp[80];
+ char iabuf[INET_ADDRSTRLEN];
p1 = iaxs[fr->callno];
p2 = iaxs[p1->bridgecallno];
if (!p1)
@@ -1610,7 +1610,8 @@ static int forward_delivery(struct iax_frame *fr)
fr->ts,
p1->callno, p1->peercallno,
p2->callno, p2->peercallno,
- ast_inet_ntoa(tmp, sizeof(tmp), p2->addr.sin_addr), ntohs(p2->addr.sin_port));
+ ast_inet_ntoa(iabuf, sizeof(iabuf), p2->addr.sin_addr),
+ ntohs(p2->addr.sin_port));
/* Fix relative timestamp */
fr->ts = calc_fakestamp(p1, p2, fr->ts);
@@ -1836,7 +1837,7 @@ static void mysql_update_peer(char *peer, struct sockaddr_in *sin)
if (mysql && (strlen(peer) < 128)) {
char query[512];
char *name;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
time_t nowtime;
name = alloca(strlen(peer) * 2 + 1);
time(&nowtime);
@@ -2764,7 +2765,7 @@ static unsigned int calc_rxstamp(struct chan_iax2_pvt *p)
static struct iax2_trunk_peer *find_tpeer(struct sockaddr_in *sin)
{
struct iax2_trunk_peer *tpeer;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Finds and locks trunk peer */
ast_mutex_lock(&tpeerlock);
tpeer = tpeers;
@@ -2799,7 +2800,7 @@ static int iax2_trunk_queue(struct chan_iax2_pvt *pvt, struct ast_frame *f)
struct iax2_trunk_peer *tpeer;
void *tmp, *ptr;
struct ast_iax2_meta_trunk_entry *met;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
tpeer = find_tpeer(&pvt->addr);
if (tpeer) {
if (tpeer->trunkdatalen + f->datalen + 4 >= tpeer->trunkdataalloc) {
@@ -3017,7 +3018,7 @@ static int iax2_show_peers(int fd, int argc, char *argv[])
#define FORMAT "%-15.15s %-15.15s %s %-15.15s %-5d%s %-10s\n"
struct iax2_peer *peer;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int registeredonly=0;
if ((argc != 3) && (argc != 4) && (argc != 5))
return RESULT_SHOWUSAGE;
@@ -3145,7 +3146,7 @@ static int iax2_show_registry(int fd, int argc, char *argv[])
struct iax2_registry *reg;
char host[80];
char perceived[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
@@ -3181,7 +3182,7 @@ static int iax2_show_channels(int fd, int argc, char *argv[])
#define FORMAT "%-15.15s %-10.10s %5.5d/%5.5d %5.5d/%5.5d %-5.5dms %-4.4dms %-4.4dms %-6.6s\n"
int x;
int numchans = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT2, "Peer", "Username", "ID (Lo/Rem)", "Seq (Tx/Rx)", "Lag", "Jitter", "JitBuf", "Format");
@@ -3391,7 +3392,7 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies
struct iax2_user *user, *best = NULL;
int bestscore = 0;
int gotcapability=0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!iaxs[callno])
return res;
@@ -3535,7 +3536,7 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies
static int raw_hangup(struct sockaddr_in *sin, unsigned short src, unsigned short dst)
{
struct ast_iax2_full_hdr fh;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
fh.scallno = htons(src | IAX_FLAG_FULL);
fh.dcallno = htons(dst);
fh.ts = 0;
@@ -3624,7 +3625,7 @@ static int register_verify(int callno, struct sockaddr_in *sin, struct iax_ies *
char md5secret[256] = "";
char rsasecret[256] = "";
char secret[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax2_peer *p;
struct ast_key *key;
char *keyn;
@@ -3761,7 +3762,7 @@ static int authenticate(char *challenge, char *secret, char *keyn, int authmetho
{
int res = -1;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (keyn && !ast_strlen_zero(keyn)) {
if (!(authmethods & IAX_AUTH_RSA)) {
if (!secret || ast_strlen_zero(secret))
@@ -4008,7 +4009,7 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
char ourip[256] = "<Unspecified>";
struct sockaddr_in oldus;
struct sockaddr_in us;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int oldmsgs;
memset(&us, 0, sizeof(us));
@@ -4135,7 +4136,7 @@ static void reg_source_db(struct iax2_peer *p)
{
char data[80];
struct in_addr in;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *c, *d;
if (!ast_db_get("IAX/Registry", p->name, data, sizeof(data))) {
c = strchr(data, ':');
@@ -4175,7 +4176,7 @@ static int update_registry(char *name, struct sockaddr_in *sin, int callno, char
struct iax2_peer *p;
int msgcount;
char data[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int version;
memset(&ied, 0, sizeof(ied));
for (p = peerl.peers;p;p = p->next) {
@@ -4289,7 +4290,7 @@ static int registry_rerequest(struct iax_ies *ies, int callno, struct sockaddr_i
/* Start pessimistic */
struct iax_ie_data ied;
char peer[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char challenge[256] = "";
int res;
int authmethods = 0;
@@ -4496,7 +4497,7 @@ static int timing_read(int *id, int fd, short events, void *cbdata)
{
char buf[1024];
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax2_trunk_peer *tpeer, *prev = NULL, *drop=NULL;
int processed = 0;
int totalcalls = 0;
@@ -4735,7 +4736,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
char dblbuf[4096]; /* Declaration of dblbuf must immediately *preceed* fr on the stack */
struct iax_frame fr;
struct iax_frame *cur;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct ast_frame f;
struct ast_channel *c;
struct iax2_dpcache *dp;
@@ -6981,7 +6982,7 @@ int load_module(void)
char *config = "iax.conf";
int res = 0;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax2_registry *reg;
struct iax2_peer *peer;
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index f3a0fb6bf..082ec9d01 100755
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -491,7 +491,7 @@ static int resend_response(struct mgcp_subchannel *sub, struct mgcp_response *re
{
struct mgcp_endpoint *p = sub->parent;
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (mgcpdebug) {
ast_verbose("Retransmitting:\n%s\n to %s:%d\n", resp->buf, ast_inet_ntoa(iabuf, sizeof(iabuf), p->parent->addr.sin_addr), ntohs(p->parent->addr.sin_port));
}
@@ -505,7 +505,7 @@ static int send_response(struct mgcp_subchannel *sub, struct mgcp_request *req)
{
struct mgcp_endpoint *p = sub->parent;
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (mgcpdebug) {
ast_verbose("Transmitting:\n%s\n to %s:%d\n", req->data, ast_inet_ntoa(iabuf, sizeof(iabuf), p->parent->addr.sin_addr), ntohs(p->parent->addr.sin_port));
}
@@ -700,7 +700,7 @@ static int send_request(struct mgcp_endpoint *p, struct mgcp_subchannel *sub,
{
int res = 0;
struct mgcp_request **queue, *q, *r, *t;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_mutex_t *l;
switch (req->cmd) {
@@ -937,7 +937,7 @@ static int mgcp_show_endpoints(int fd, int argc, char *argv[])
struct mgcp_gateway *g;
struct mgcp_endpoint *e;
int hasendpoints = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&gatelock);
@@ -1367,7 +1367,7 @@ static struct mgcp_subchannel *find_subchannel(char *name, int msgid, struct soc
struct mgcp_endpoint *p = NULL;
struct mgcp_subchannel *sub = NULL;
struct mgcp_gateway *g;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char tmp[256] = "";
char *at = NULL, *c;
int found = 0;
@@ -1800,7 +1800,7 @@ static int add_sdp(struct mgcp_request *resp, struct mgcp_subchannel *sub, struc
char t[256];
char m[256];
char a[1024] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int x;
struct sockaddr_in dest;
struct mgcp_endpoint *p = sub->parent;
@@ -2169,7 +2169,7 @@ static struct mgcp_request *find_command(struct mgcp_endpoint *p, struct mgcp_su
struct mgcp_request **queue, ast_mutex_t *l, int ident)
{
struct mgcp_request *prev, *req;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_mutex_lock(l);
for (prev = NULL, req = *queue; req; prev = req, req = req->next) {
@@ -2798,7 +2798,7 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
struct ast_frame f = { 0, };
struct mgcp_endpoint *p = sub->parent;
struct mgcp_gateway *g = NULL;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res;
if (mgcpdebug) {
ast_verbose("Handling request '%s' on %s@%s\n", req->verb, p->name, p->parent->name);
@@ -3092,7 +3092,7 @@ static int mgcpsock_read(int *id, int fd, short events, void *ignore)
int len;
int result;
int ident;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
len = sizeof(sin);
memset(&req, 0, sizeof(req));
res = recvfrom(mgcpsock, req.data, sizeof(req.data) - 1, 0, (struct sockaddr *)&sin, &len);
@@ -3861,7 +3861,7 @@ static int reload_config(void)
struct ast_variable *v;
struct mgcp_gateway *g;
struct mgcp_endpoint *e;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cat;
struct ast_hostent ahp; struct hostent *hp;
int format;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 941fa69e2..2cd5b6f5e 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -581,7 +581,7 @@ static inline int sip_debug_test_pvt(struct sip_pvt *p)
static int __sip_xmit(struct sip_pvt *p, char *data, int len)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (p->nat == SIP_NAT_ALWAYS)
res=sendto(sipsock, data, len, 0, (struct sockaddr *)&p->recv, sizeof(struct sockaddr_in));
else
@@ -608,7 +608,7 @@ static int ast_sip_ouraddrfor(struct in_addr *them, struct in_addr *us)
if (localaddr && externip.sin_addr.s_addr &&
ast_apply_ha(localaddr, &theirs)) {
char t[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
memcpy(us, &externip.sin_addr, sizeof(struct in_addr));
strcpy(t, ast_inet_ntoa(iabuf, sizeof(iabuf), *(struct in_addr *)&them->s_addr));
ast_log(LOG_DEBUG, "Target address %s is not local, substituting externip\n", t);
@@ -657,7 +657,7 @@ static int retrans_pkt(void *data)
{
struct sip_pkt *pkt=data, *prev, *cur;
int res = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_mutex_lock(&pkt->owner->lock);
if (pkt->retrans < MAX_RETRANS) {
pkt->retrans++;
@@ -840,7 +840,7 @@ static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp)
static int send_response(struct sip_pvt *p, struct sip_request *req, int reliable, int seqno)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (sip_debug_test_pvt(p)) {
if (p->nat == SIP_NAT_ALWAYS)
ast_verbose("%sTransmitting (NAT):\n%s\n to %s:%d\n", reliable ? "Reliably " : "", req->data, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr), ntohs(p->recv.sin_port));
@@ -863,7 +863,7 @@ static int send_response(struct sip_pvt *p, struct sip_request *req, int reliabl
static int send_request(struct sip_pvt *p, struct sip_request *req, int reliable, int seqno)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (sip_debug_test_pvt(p)) {
if (p->nat == SIP_NAT_ALWAYS)
ast_verbose("%sTransmitting:\n%s (NAT) to %s:%d\n", reliable ? "Reliably " : "", req->data, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr), ntohs(p->recv.sin_port));
@@ -1031,7 +1031,7 @@ static void mysql_update_peer(char *peer, struct sockaddr_in *sin, char *usernam
char query[512];
char *name;
char *uname;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
time_t nowtime;
name = alloca(strlen(peer) * 2 + 1);
uname = alloca(strlen(username) * 2 + 1);
@@ -1061,7 +1061,7 @@ static struct sip_peer *mysql_peer(char *peer, struct sockaddr_in *sin)
char *name = NULL;
int numfields, x;
int port;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
time_t regseconds, nowtime;
MYSQL_RES *result;
MYSQL_FIELD *fields;
@@ -1208,7 +1208,7 @@ static int create_addr(struct sip_pvt *r, char *peer)
int found=0;
char *port;
int portno;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char host[256], *hostn;
r->sa.sin_family = AF_INET;
@@ -2196,7 +2196,7 @@ static void build_callid(char *callid, int len, struct in_addr ourip)
int res;
int val;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (x=0;x<4;x++) {
val = rand();
res = snprintf(callid, len, "%08x", val);
@@ -2211,7 +2211,7 @@ static void build_callid(char *callid, int len, struct in_addr ourip)
static struct sip_pvt *sip_alloc(char *callid, struct sockaddr_in *sin, int useglobalnat)
{
struct sip_pvt *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
p = malloc(sizeof(struct sip_pvt));
if (!p)
@@ -2302,7 +2302,7 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
struct sip_pvt *p;
char *callid;
char tmp[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cmd;
char *tag = "", *c;
int themisfrom;
@@ -2568,7 +2568,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
char *c;
char *a;
char host[258];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int len = -1;
int portno=0;
int vportno=0;
@@ -2847,7 +2847,7 @@ static int copy_via_headers(struct sip_pvt *p, struct sip_request *req, struct s
int start = 0;
int copied = 0;
char new[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (;;) {
tmp = __get_header(orig, field, &start);
if (!ast_strlen_zero(tmp)) {
@@ -2902,7 +2902,7 @@ static void add_route(struct sip_request *req, struct sip_route *route)
static void set_destination(struct sip_pvt *p, char *uri)
{
char *h, *maddr, hostname[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int port, hn;
struct hostent *hp;
struct ast_hostent ahp;
@@ -3043,7 +3043,7 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, char *msg, int se
char stripped[80] ="";
char tmp[80];
char newto[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *c, *n;
char *ot, *of;
@@ -3252,7 +3252,7 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p)
char m2[256] = "";
char a[1024] = "";
char a2[1024] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int x;
int capability;
struct sockaddr_in dest;
@@ -3555,7 +3555,7 @@ static void extract_uri(struct sip_pvt *p, struct sip_request *req)
/*--- build_contact: Build contact header - the contact header we send out ---*/
static void build_contact(struct sip_pvt *p)
{
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Construct Contact: header */
if (ourport != 5060)
snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s@%s:%d>", p->exten, ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ourport);
@@ -3570,7 +3570,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, char *cmd, c
char from[256];
char to[256];
char tmp[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char cid[256];
char *l = callerid, *n=NULL;
@@ -3643,7 +3643,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, char *cmd, c
static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, char *authheader, char *vxml_url, char *distinctive_ring, char *osptoken, int init)
{
struct sip_request req;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (init) {
/* Bump branch even on initial requests */
@@ -3846,7 +3846,7 @@ static int sip_reg_timeout(void *data)
/* if we are here, our registration timed out, so we'll just do it over */
struct sip_registry *r=data;
struct sip_pvt *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res;
ast_mutex_lock(&regl.lock);
ast_log(LOG_NOTICE, "Registration for '%s@%s' timed out, trying again\n", r->username, ast_inet_ntoa(iabuf, sizeof(iabuf), r->addr.sin_addr));
@@ -3874,7 +3874,7 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char
char tmp[80];
char via[80];
char addr[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sip_pvt *p;
struct ast_hostent ahp;
struct hostent *hp;
@@ -4095,7 +4095,7 @@ static int sip_poke_peer(struct sip_peer *peer);
static void reg_source_db(struct sip_peer *p)
{
char data[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct in_addr in;
char *c, *d, *u;
int expiry;
@@ -4138,7 +4138,7 @@ static int parse_contact(struct sip_pvt *pvt, struct sip_peer *p, struct sip_req
{
char contact[80]= "";
char data[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *expires = get_header(req, "Expires");
int expiry = atoi(expires);
char *c, *n, *pt;
@@ -4551,7 +4551,7 @@ static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct si
int res = -1;
struct sip_peer *peer;
char tmp[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *name, *c;
char *t;
/* Terminate URI */
@@ -4921,7 +4921,7 @@ static int get_also_info(struct sip_pvt *p, struct sip_request *oreq)
static int check_via(struct sip_pvt *p, struct sip_request *req)
{
char via[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *c, *pt;
struct hostent *hp;
struct ast_hostent ahp;
@@ -5035,7 +5035,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd
struct sip_peer *peer;
char *of, from[256] = "", *c;
char *rpid,rpid_num[50];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res = 0;
char *t;
char calleridname[50];
@@ -5341,7 +5341,7 @@ static int sip_show_peers(int fd, int argc, char *argv[])
#define FORMAT "%-15.15s %-15.15s %s %s %s %-15.15s %-8d %-10s\n"
struct sip_peer *peer;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3 && argc != 5)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
@@ -5448,7 +5448,7 @@ static void print_group(int fd, unsigned int group)
static int sip_show_peer(int fd, int argc, char *argv[])
{
char status[30];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sip_peer *peer;
if (argc != 4)
@@ -5553,7 +5553,7 @@ static int sip_show_registry(int fd, int argc, char *argv[])
#define FORMAT "%-20.20s %-12.12s %8d %-20.20s\n"
struct sip_registry *reg;
char host[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&regl.lock);
@@ -5590,7 +5590,7 @@ static int __sip_show_channels(int fd, int argc, char *argv[], int subscriptions
#define FORMAT2 "%-15.15s %-10.10s %-11.11s %-11.11s %s\n"
#define FORMAT "%-15.15s %-10.10s %-11.11s %5.5d/%5.5d %-6.6s%s\n"
struct sip_pvt *cur;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int numchans = 0;
if (argc != 3)
return RESULT_SHOWUSAGE;
@@ -5654,7 +5654,7 @@ static int sip_show_channel(int fd, int argc, char *argv[])
{
struct sip_pvt *cur;
char tmp[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
size_t len;
int found = 0;
if (argc != 4)
@@ -5824,7 +5824,7 @@ static int sip_do_debug_ip(int fd, int argc, char *argv[])
{
struct hostent *hp;
struct ast_hostent ahp;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int port = 0;
char *p, *arg;
if (argc != 4)
@@ -5854,7 +5854,7 @@ static int sip_do_debug_ip(int fd, int argc, char *argv[])
static int sip_do_debug_peer(int fd, int argc, char *argv[])
{
struct sip_peer *peer;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 4)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
@@ -6065,7 +6065,7 @@ static int build_reply_digest(struct sip_pvt *p, char* orig_header, char* digest
char resp_hash[256];
char uri[256] = "";
char cnonce[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!ast_strlen_zero(p->domain))
strncpy(uri, p->domain, sizeof(uri) - 1);
@@ -6266,7 +6266,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
int pingtime;
struct timeval tv;
int seqno=0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
c = get_header(req, "Cseq");
if (sscanf(c, "%d ", &seqno) != 1) {
ast_log(LOG_WARNING, "Unable to determine sequence number\n");
@@ -6648,7 +6648,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
int respid;
int res;
int gotdest;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct ast_frame af = { AST_FRAME_NULL, };
int debug = sip_debug_test_pvt(p);
@@ -7223,7 +7223,7 @@ static int sip_send_mwi_to_peer(struct sip_peer *peer)
/* Called with peerl lock, but releases it */
struct sip_pvt *p;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int newmsgs, oldmsgs;
/* Check for messages */
ast_app_messagecount(peer->mailbox, &newmsgs, &oldmsgs);
@@ -7441,7 +7441,7 @@ static int sip_poke_noanswer(void *data)
static int sip_poke_peer(struct sip_peer *peer)
{
struct sip_pvt *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!peer->maxms || !peer->addr.sin_addr.s_addr) {
/* IF we have no IP, or this isn't to be monitored, return
imeediately after clearing things out */
@@ -7546,7 +7546,7 @@ static struct ast_channel *sip_request(char *type, int format, void *data)
struct ast_channel *tmpc = NULL;
char *ext, *host;
char tmp[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *dest = data;
oldformat = format;
@@ -8010,7 +8010,7 @@ static int reload_config(void)
struct hostent *hp;
int format;
int oldport = ntohs(bindaddr.sin_port);
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
globaldtmfmode = SIP_DTMF_RFC2833;
globalpromiscredir = 0;
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index be933ebc2..3472cac54 100755
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -988,7 +988,7 @@ static int skinny_show_lines(int fd, int argc, char *argv[])
struct skinny_device *d;
struct skinny_line *l;
int haslines = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&devicelock);
@@ -2327,7 +2327,7 @@ static void *skinny_session(void *data)
int res;
skinny_req *req;
struct skinnysession *s = data;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_verbose(VERBOSE_PREFIX_3 "Starting Skinny session from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), s->sin.sin_addr));
@@ -2508,7 +2508,7 @@ static int reload_config(void)
struct ast_variable *v;
int format;
char *cat;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct skinny_device *d;
int oldport = ntohs(bindaddr.sin_port);
diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c
index eeb1ff1c2..e41056eaf 100755
--- a/channels/iax2-parser.c
+++ b/channels/iax2-parser.c
@@ -45,7 +45,7 @@ static void (*errorf)(const char *str) = internalerror;
static void dump_addr(char *output, int maxlen, void *value, int len)
{
struct sockaddr_in sin;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (len == (int)sizeof(sin)) {
memcpy(&sin, value, len);
snprintf(output, maxlen, "IPV4 %s:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
@@ -254,7 +254,7 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s
char *class;
char *subclass;
char tmp[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (f) {
fh = f->data;
snprintf(retries, (int)sizeof(retries), "%03d", f->retries);
diff --git a/manager.c b/manager.c
index f990c073d..c3f5c07ad 100755
--- a/manager.c
+++ b/manager.c
@@ -163,7 +163,7 @@ static int handle_showmancmds(int fd, int argc, char *argv[])
static int handle_showmanconn(int fd, int argc, char *argv[])
{
struct mansession *s;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *format = " %-15.15s %-15.15s\n";
ast_mutex_lock(&sessionlock);
s = sessions;
@@ -312,7 +312,7 @@ static int set_eventmask(struct mansession *s, char *eventmask)
static int authenticate(struct mansession *s, struct message *m)
{
struct ast_config *cfg;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cat;
char *user = astman_get_header(m, "Username");
char *pass = astman_get_header(m, "Secret");
@@ -940,7 +940,7 @@ static int process_message(struct mansession *s, struct message *m)
struct manager_action *tmp = first_action;
char *id = astman_get_header(m,"ActionID");
char idText[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
strncpy(action, astman_get_header(m, "Action"), sizeof(action));
ast_log( LOG_DEBUG, "Manager received command '%s'\n", action );
@@ -1012,7 +1012,7 @@ static int get_input(struct mansession *s, char *output)
int res;
int x;
struct pollfd fds[1];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (x=1;x<s->inlen;x++) {
if ((s->inbuf[x] == '\n') && (s->inbuf[x-1] == '\r')) {
/* Copy output data up to and including \r\n */
@@ -1050,7 +1050,7 @@ static void *session_do(void *data)
{
struct mansession *s = data;
struct message m;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res;
ast_mutex_lock(&s->lock);
diff --git a/res/res_osp.c b/res/res_osp.c
index 94aaaf333..5db3d42e0 100755
--- a/res/res_osp.c
+++ b/res/res_osp.c
@@ -423,7 +423,7 @@ static int loadPemPrivateKey(unsigned char *FileName, unsigned char *buffer, int
int ast_osp_validate(char *provider, char *token, int *handle, unsigned int *timelimit, char *callerid, struct in_addr addr, char *extension)
{
char tmp[256]="", *l, *n;
- char ip[256];
+ char iabuf[INET_ADDRSTRLEN];
char source[OSP_MAX]; /* Same length as osp->source */
char *token2;
int tokenlen;
@@ -452,7 +452,7 @@ int ast_osp_validate(char *provider, char *token, int *handle, unsigned int *tim
}
callerid = l;
ast_mutex_lock(&osplock);
- ast_inet_ntoa(ip, sizeof(ip), addr);
+ ast_inet_ntoa(iabuf, sizeof(iabuf), addr);
osp = providers;
while(osp) {
if (!strcasecmp(osp->name, provider)) {
@@ -470,10 +470,10 @@ int ast_osp_validate(char *provider, char *token, int *handle, unsigned int *tim
if (res) {
res = 0;
dummy = 0;
- if (!OSPPTransactionValidateAuthorisation(*handle, ip, source, NULL, NULL,
+ if (!OSPPTransactionValidateAuthorisation(*handle, iabuf, source, NULL, NULL,
callerid, OSPC_E164, extension, OSPC_E164, 0, "", tokenlen, token2, &authorised, timelimit, &dummy, NULL, TOKEN_ALGO_BOTH)) {
if (authorised) {
- ast_log(LOG_DEBUG, "Validated token for '%s' from '%s@%s'\n", extension, callerid, ip);
+ ast_log(LOG_DEBUG, "Validated token for '%s' from '%s@%s'\n", extension, callerid, iabuf);
res = 1;
}
}
diff --git a/rtp.c b/rtp.c
index 90eaf73d9..ad5d37966 100755
--- a/rtp.c
+++ b/rtp.c
@@ -174,7 +174,7 @@ static struct ast_frame *send_dtmf(struct ast_rtp *rtp)
{
struct timeval tv;
static struct ast_frame null_frame = { AST_FRAME_NULL, };
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
gettimeofday(&tv, NULL);
if ((tv.tv_sec < rtp->dtmfmute.tv_sec) ||
((tv.tv_sec == rtp->dtmfmute.tv_sec) && (tv.tv_usec < rtp->dtmfmute.tv_usec))) {
@@ -338,7 +338,7 @@ struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
int res;
struct sockaddr_in sin;
unsigned int rtcpdata[1024];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!rtp->rtcp)
return &null_frame;
@@ -407,7 +407,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
int payloadtype;
int hdrlen = 12;
int mark;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
unsigned int timestamp;
unsigned int *rtpheader;
static struct ast_frame *f, null_frame = { AST_FRAME_NULL, };
@@ -950,7 +950,7 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit)
int ms;
int x;
char data[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if ((digit <= '9') && (digit >= '0'))
digit -= '0';
@@ -1013,7 +1013,7 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit)
static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec)
{
unsigned int *rtpheader;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int hdrlen = 12;
int res;
int ms;
@@ -1288,7 +1288,7 @@ int ast_rtp_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, st
struct sockaddr_in vac0, vac1;
struct sockaddr_in t0, t1;
struct sockaddr_in vt0, vt1;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
void *pvt0, *pvt1;
int to;