Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 426398 | Differences between
and this patch

Collapse All | Expand All

(-)pptp-1.7.2/pptp_ctrl.c.sign-compare (-3 / +3 lines)
Lines 193-199 int ctrlp_disp(PPTP_CONN * conn, void * Link Here
193
void pptp_set_link(PPTP_CONN * conn, int peer_call_id);
193
void pptp_set_link(PPTP_CONN * conn, int peer_call_id);
194
194
195
/*** log error information in control packets *********************************/
195
/*** log error information in control packets *********************************/
196
static void ctrlp_error( int result, int error, int cause,
196
static void ctrlp_error( int result, u_int8_t error, int cause,
197
        const char *result_text[], int max_result)
197
        const char *result_text[], int max_result)
198
{
198
{
199
    if( cause >= 0)
199
    if( cause >= 0)
Lines 238-244 static const char *ctrl_msg_types[] = { Link Here
238
#define MAX_CTRLMSG_TYPE 15
238
#define MAX_CTRLMSG_TYPE 15
239
         
239
         
240
/*** report a sent packet ****************************************************/
240
/*** report a sent packet ****************************************************/
241
static void ctrlp_rep( void * buffer, int size, int isbuff)
241
static void ctrlp_rep( void * buffer, size_t size, int isbuff)
242
{
242
{
243
    struct pptp_header *packet = buffer;
243
    struct pptp_header *packet = buffer;
244
    unsigned int type;
244
    unsigned int type;
Lines 532-538 int pptp_write_some(PPTP_CONN * conn) { Link Here
532
	    return -1;
532
	    return -1;
533
        }
533
        }
534
    }
534
    }
535
    assert(retval <= conn->write_size);
535
    assert((size_t)retval <= conn->write_size);
536
    conn->write_size -= retval;
536
    conn->write_size -= retval;
537
    memmove(conn->write_buffer, conn->write_buffer + retval, conn->write_size);
537
    memmove(conn->write_buffer, conn->write_buffer + retval, conn->write_size);
538
    ctrlp_rep(conn->write_buffer, retval, 0);
538
    ctrlp_rep(conn->write_buffer, retval, 0);
(-)pptp-1.7.2/pptp_gre.c.sign-compare (-5 / +4 lines)
Lines 200-207 void pptp_gre_copy(u_int16_t call_id, u_ Link Here
200
int decaps_hdlc(int fd, int (*cb)(int cl, void *pack, unsigned int len), int cl)
200
int decaps_hdlc(int fd, int (*cb)(int cl, void *pack, unsigned int len), int cl)
201
{
201
{
202
    unsigned char buffer[PACKET_MAX];
202
    unsigned char buffer[PACKET_MAX];
203
    unsigned int start = 0;
203
    ssize_t start = 0, end;
204
    int end;
205
    int status;
204
    int status;
206
    static unsigned int len = 0, escape = 0;
205
    static unsigned int len = 0, escape = 0;
207
    static unsigned char copy[PACKET_MAX];
206
    static unsigned char copy[PACKET_MAX];
Lines 210-216 int decaps_hdlc(int fd, int (*cb)(int cl Link Here
210
    /*  this is the only blocking read we will allow */
209
    /*  this is the only blocking read we will allow */
211
    if ((end = read (fd, buffer, sizeof(buffer))) <= 0) {
210
    if ((end = read (fd, buffer, sizeof(buffer))) <= 0) {
212
        int saved_errno = errno;
211
        int saved_errno = errno;
213
        warn("short read (%d): %s", end, strerror(saved_errno));
212
        warn("short read (%zd): %s", end, strerror(saved_errno));
214
	switch (saved_errno) {
213
	switch (saved_errno) {
215
	  case EMSGSIZE: {
214
	  case EMSGSIZE: {
216
	    socklen_t optval, optlen = sizeof(optval);
215
	    socklen_t optval, optlen = sizeof(optval);
Lines 499-505 int encaps_gre (int fd, void *pack, unsi Link Here
499
                if (errno == ENOBUFS)
498
                if (errno == ENOBUFS)
500
                    rc = 0;         /* Simply ignore it */
499
                    rc = 0;         /* Simply ignore it */
501
                stats.tx_failed++;
500
                stats.tx_failed++;
502
            } else if (rc < sizeof(u.header) - sizeof(u.header.seq)) {
501
            } else if ((size_t)rc < sizeof(u.header) - sizeof(u.header.seq)) {
503
                stats.tx_short++;
502
                stats.tx_short++;
504
            } else {
503
            } else {
505
                stats.tx_acks++;
504
                stats.tx_acks++;
Lines 533-539 int encaps_gre (int fd, void *pack, unsi Link Here
533
        if (errno == ENOBUFS)
532
        if (errno == ENOBUFS)
534
            rc = 0;         /* Simply ignore it */
533
            rc = 0;         /* Simply ignore it */
535
        stats.tx_failed++;
534
        stats.tx_failed++;
536
    } else if (rc < header_len + len) {
535
    } else if ((size_t)rc < header_len + len) {
537
        stats.tx_short++;
536
        stats.tx_short++;
538
    } else {
537
    } else {
539
        stats.tx_sent++;
538
        stats.tx_sent++;
(-)pptp-1.7.2/pqueue.c.sign-compare (-3 / +3 lines)
Lines 17-23 Link Here
17
17
18
#define MIN_CAPACITY 128 /* min allocated buffer for a packet */
18
#define MIN_CAPACITY 128 /* min allocated buffer for a packet */
19
19
20
static int pqueue_alloc (int seq, unsigned char *packet, int packlen, pqueue_t **new);
20
static int pqueue_alloc (u_int32_t seq, unsigned char *packet, int packlen, pqueue_t **new);
21
21
22
int packet_timeout_usecs = DEFAULT_PACKET_TIMEOUT * 1000000;
22
int packet_timeout_usecs = DEFAULT_PACKET_TIMEOUT * 1000000;
23
23
Lines 29-35 static pqueue_t *pq_freelist_head = NULL Link Here
29
29
30
30
31
31
32
static int pqueue_alloc(int seq, unsigned char *packet, int packlen, pqueue_t **new) {
32
static int pqueue_alloc(u_int32_t seq, unsigned char *packet, int packlen, pqueue_t **new) {
33
33
34
  pqueue_t *newent;
34
  pqueue_t *newent;
35
35
Lines 125-131 static int pqueue_alloc(int seq, unsigne Link Here
125
125
126
126
127
127
128
int pqueue_add (int seq, unsigned char *packet, int packlen) {
128
int pqueue_add (u_int32_t seq, unsigned char *packet, int packlen) {
129
  pqueue_t *newent, *point;
129
  pqueue_t *newent, *point;
130
130
131
  /* get a new entry */
131
  /* get a new entry */
(-)pptp-1.7.2/pqueue.h.sign-compare (-2 / +2 lines)
Lines 15-28 extern int packet_timeout_usecs; Link Here
15
typedef struct pqueue {
15
typedef struct pqueue {
16
  struct pqueue *next;
16
  struct pqueue *next;
17
  struct pqueue *prev;
17
  struct pqueue *prev;
18
  int seq;
18
  u_int32_t seq;
19
  struct timeval expires;
19
  struct timeval expires;
20
  unsigned char *packet;
20
  unsigned char *packet;
21
  int packlen;
21
  int packlen;
22
  int capacity;
22
  int capacity;
23
} pqueue_t;
23
} pqueue_t;
24
24
25
int       pqueue_add  (int seq, unsigned char *packet, int packlen);
25
int       pqueue_add  (u_int32_t seq, unsigned char *packet, int packlen);
26
int       pqueue_del  (pqueue_t *point);
26
int       pqueue_del  (pqueue_t *point);
27
pqueue_t *pqueue_head ();
27
pqueue_t *pqueue_head ();
28
int       pqueue_expiry_time (pqueue_t *entry);
28
int       pqueue_expiry_time (pqueue_t *entry);
(-)pptp-1.7.2/test.c.sign-compare (-3 / +3 lines)
Lines 52-58 static ssize_t write_reordered_swap(int Link Here
52
      test_ordering_phase = 0;
52
      test_ordering_phase = 0;
53
      /* send the new packet first */
53
      /* send the new packet first */
54
      stat = write(fd, buf, count);
54
      stat = write(fd, buf, count);
55
      if (stat != count) return stat;
55
      if ((size_t)stat != count) return stat;
56
      /* then send the old packet next */
56
      /* then send the old packet next */
57
      stat = write(fd, pocket_buf, pocket_count);
57
      stat = write(fd, pocket_buf, pocket_count);
58
      free(pocket_buf);
58
      free(pocket_buf);
Lines 96-102 static ssize_t write_reordered_retransmi Link Here
96
    test_ordering_phase = 0;
96
    test_ordering_phase = 0;
97
    /* send the new packet first */
97
    /* send the new packet first */
98
    stat = write(fd, buf, count);
98
    stat = write(fd, buf, count);
99
    if (stat != count) return stat;
99
    if ((size_t)stat != count) return stat;
100
    /* send the buffered packets in normal order */
100
    /* send the buffered packets in normal order */
101
    for (n=0; n<test_length; n++) {
101
    for (n=0; n<test_length; n++) {
102
      stat = write(fd, pocket_buf[n], pocket_count[n]);
102
      stat = write(fd, pocket_buf[n], pocket_count[n]);
Lines 142-148 static ssize_t write_reordered_reverse(i Link Here
142
    test_ordering_phase = 0;
142
    test_ordering_phase = 0;
143
    /* send the new packet first */
143
    /* send the new packet first */
144
    stat = write(fd, buf, count);
144
    stat = write(fd, buf, count);
145
    if (stat != count) return stat;
145
    if ((size_t)stat != count) return stat;
146
    /* send the buffered packets in reverse order */
146
    /* send the buffered packets in reverse order */
147
    for (n=test_length-1; n>0; n--) {
147
    for (n=test_length-1; n>0; n--) {
148
      stat = write(fd, pocket_buf[n], pocket_count[n]);
148
      stat = write(fd, pocket_buf[n], pocket_count[n]);

Return to bug 426398