[Asterisk-cvs] asterisk/channels chan_h323.c,1.64,1.65 chan_iax.c,1.62,1.63 chan_iax2.c,1.165,1.166 chan_mgcp.c,1.57,1.58 chan_sip.c,1.435,1.436 chan_skinny.c,1.49,1.50 iax2-parser.c,1.23,1.24
markster at lists.digium.com
markster at lists.digium.com
Wed Jun 30 13:11:00 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv25596/channels
Modified Files:
chan_h323.c chan_iax.c chan_iax2.c chan_mgcp.c chan_sip.c
chan_skinny.c iax2-parser.c
Log Message:
Use INET_ADDRLEN (bug #1956) (from airport!)
Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- chan_h323.c 29 Jun 2004 18:00:14 -0000 1.64
+++ chan_h323.c 30 Jun 2004 16:56:51 -0000 1.65
@@ -918,7 +918,7 @@
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 @@
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 @@
/* 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 @@
struct sockaddr_in them;
struct sockaddr_in us;
char *mode;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
mode = convertcap(chan->writeformat);
Index: chan_iax.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- chan_iax.c 29 Jun 2004 12:56:46 -0000 1.62
+++ chan_iax.c 30 Jun 2004 16:56:51 -0000 1.63
@@ -509,7 +509,7 @@
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 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 @@
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 @@
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 @@
{
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 @@
#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 @@
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 @@
#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 @@
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 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 @@
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 @@
{
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 @@
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 @@
/* 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 @@
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 @@
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 x;
struct iax_registry *reg;
struct iax_peer *peer;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sockaddr_in sin;
Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -d -r1.165 -r1.166
--- chan_iax2.c 30 Jun 2004 13:57:49 -0000 1.165
+++ chan_iax2.c 30 Jun 2004 16:56:51 -0000 1.166
@@ -629,7 +629,7 @@
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 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 @@
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 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 @@
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 @@
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 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 @@
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 @@
#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 @@
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 @@
#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 @@
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 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 @@
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 @@
{
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 @@
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 @@
{
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 @@
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 @@
/* 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 @@
{
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 @@
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 @@
char *config = "iax.conf";
int res = 0;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax2_registry *reg;
struct iax2_peer *peer;
Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- chan_mgcp.c 29 Jun 2004 12:56:46 -0000 1.57
+++ chan_mgcp.c 30 Jun 2004 16:56:51 -0000 1.58
@@ -491,7 +491,7 @@
{
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 @@
{
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 @@
{
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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;
Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.435
retrieving revision 1.436
diff -u -d -r1.435 -r1.436
--- chan_sip.c 30 Jun 2004 13:57:49 -0000 1.435
+++ chan_sip.c 30 Jun 2004 16:56:51 -0000 1.436
@@ -581,7 +581,7 @@
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 @@
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 @@
{
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 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_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 @@
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 @@
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 @@
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 @@
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 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 @@
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 @@
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 @@
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 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 @@
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 @@
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 @@
/*--- 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 @@
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 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 @@
/* 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(®l.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 @@
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 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 @@
{
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 @@
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 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 @@
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 @@
#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 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 @@
#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(®l.lock);
@@ -5590,7 +5590,7 @@
#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 @@
{
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 @@
{
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_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 @@
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 @@
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 @@
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 @@
/* 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_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 @@
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 @@
struct hostent *hp;
int format;
int oldport = ntohs(bindaddr.sin_port);
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
globaldtmfmode = SIP_DTMF_RFC2833;
globalpromiscredir = 0;
Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- chan_skinny.c 29 Jun 2004 12:56:46 -0000 1.49
+++ chan_skinny.c 30 Jun 2004 16:56:51 -0000 1.50
@@ -988,7 +988,7 @@
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 @@
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 @@
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);
Index: iax2-parser.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- iax2-parser.c 29 Jun 2004 12:56:46 -0000 1.23
+++ iax2-parser.c 30 Jun 2004 16:56:51 -0000 1.24
@@ -45,7 +45,7 @@
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 @@
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);
More information about the svn-commits
mailing list