~damg/ubuntu/quantal/asterisk/LP1097687

« back to all changes in this revision

Viewing changes to main/udptl.c

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2010-10-15 22:24:34 UTC
  • mfrom: (1.2.8 upstream) (8.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20101015222434-iy328q8in3lajzlv
Tags: 1:1.6.2.9-2ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control:
    + Build-depend on hardening-wrapper
    + Change Maintainer
    + Removed Uploaders field.
    + Removed Debian Vcs-Svn entry and replaced with ubuntu-voip Vcs-Bzr,
      to reflect divergence in packages.
  - debian/rules: Make use of hardening-wrapper
  - debian/asterisk.init: chown /dev/dahdi
  - debian/backports/hardy: add file
  - debian/backports/asterisk.init.hardy: add file
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
#include "asterisk.h"
53
53
 
54
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 244445 $")
 
54
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 264405 $")
55
55
 
56
56
#include <sys/time.h>
57
57
#include <signal.h>
226
226
{
227
227
        unsigned int octet_cnt;
228
228
        unsigned int octet_idx;
229
 
        unsigned int length;
230
229
        unsigned int i;
 
230
        int length; /* a negative length indicates the limit has been reached in decode_length. */
231
231
        const uint8_t **pbuf;
232
232
 
233
233
        for (octet_idx = 0, *p_num_octets = 0; ; octet_idx += octet_cnt) {
1097
1097
        /* Cook up the UDPTL packet, with the relevant EC info. */
1098
1098
        len = udptl_build_packet(s, buf, sizeof(buf), f->data.ptr, len);
1099
1099
 
1100
 
        if (len > 0 && s->them.sin_port && s->them.sin_addr.s_addr) {
 
1100
        if ((signed int) len > 0 && s->them.sin_port && s->them.sin_addr.s_addr) {
1101
1101
                if ((res = sendto(s->fd, buf, len, 0, (struct sockaddr *) &s->them, sizeof(s->them))) < 0)
1102
1102
                        ast_log(LOG_NOTICE, "(%s): UDPTL Transmission error to %s:%d: %s\n",
1103
1103
                                LOG_TAG(s), ast_inet_ntoa(s->them.sin_addr), ntohs(s->them.sin_port), strerror(errno));