diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-30 16:56:51 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-30 16:56:51 +0000 |
commit | 34117659e31effca1195dcebcb884e58b0446a18 (patch) | |
tree | a80f97f17cee88dd8e10127d0d520b04fb94b94d /res | |
parent | 14feeee6dc3e86b0b9f1eee325fcb2478f66cf3f (diff) |
Use INET_ADDRLEN (bug #1956) (from airport!)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3364 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rwxr-xr-x | res/res_osp.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } } |