|
|
27639a |
diff -up pptp-1.7.2/pptp_ctrl.c.sign-compare pptp-1.7.2/pptp_ctrl.c
|
|
|
27639a |
--- pptp-1.7.2/pptp_ctrl.c.sign-compare 2011-11-30 16:33:00.877964659 +0000
|
|
|
27639a |
+++ pptp-1.7.2/pptp_ctrl.c 2011-11-30 18:49:17.603973525 +0000
|
|
|
27639a |
@@ -193,7 +193,7 @@ int ctrlp_disp(PPTP_CONN * conn, void *
|
|
|
27639a |
void pptp_set_link(PPTP_CONN * conn, int peer_call_id);
|
|
|
27639a |
|
|
|
27639a |
/*** log error information in control packets *********************************/
|
|
|
27639a |
-static void ctrlp_error( int result, int error, int cause,
|
|
|
27639a |
+static void ctrlp_error( int result, u_int8_t error, int cause,
|
|
|
27639a |
const char *result_text[], int max_result)
|
|
|
27639a |
{
|
|
|
27639a |
if( cause >= 0)
|
|
|
27639a |
@@ -238,7 +238,7 @@ static const char *ctrl_msg_types[] = {
|
|
|
27639a |
#define MAX_CTRLMSG_TYPE 15
|
|
|
27639a |
|
|
|
27639a |
/*** report a sent packet ****************************************************/
|
|
|
27639a |
-static void ctrlp_rep( void * buffer, int size, int isbuff)
|
|
|
27639a |
+static void ctrlp_rep( void * buffer, size_t size, int isbuff)
|
|
|
27639a |
{
|
|
|
27639a |
struct pptp_header *packet = buffer;
|
|
|
27639a |
unsigned int type;
|
|
|
27639a |
@@ -532,7 +532,7 @@ int pptp_write_some(PPTP_CONN * conn) {
|
|
|
27639a |
return -1;
|
|
|
27639a |
}
|
|
|
27639a |
}
|
|
|
27639a |
- assert(retval <= conn->write_size);
|
|
|
27639a |
+ assert((size_t)retval <= conn->write_size);
|
|
|
27639a |
conn->write_size -= retval;
|
|
|
27639a |
memmove(conn->write_buffer, conn->write_buffer + retval, conn->write_size);
|
|
|
27639a |
ctrlp_rep(conn->write_buffer, retval, 0);
|
|
|
27639a |
diff -up pptp-1.7.2/pptp_gre.c.sign-compare pptp-1.7.2/pptp_gre.c
|
|
|
27639a |
--- pptp-1.7.2/pptp_gre.c.sign-compare 2011-11-30 16:33:00.899964648 +0000
|
|
|
27639a |
+++ pptp-1.7.2/pptp_gre.c 2011-11-30 16:33:00.911964643 +0000
|
|
|
27639a |
@@ -200,8 +200,7 @@ void pptp_gre_copy(u_int16_t call_id, u_
|
|
|
27639a |
int decaps_hdlc(int fd, int (*cb)(int cl, void *pack, unsigned int len), int cl)
|
|
|
27639a |
{
|
|
|
27639a |
unsigned char buffer[PACKET_MAX];
|
|
|
27639a |
- unsigned int start = 0;
|
|
|
27639a |
- int end;
|
|
|
27639a |
+ ssize_t start = 0, end;
|
|
|
27639a |
int status;
|
|
|
27639a |
static unsigned int len = 0, escape = 0;
|
|
|
27639a |
static unsigned char copy[PACKET_MAX];
|
|
|
27639a |
@@ -210,7 +209,7 @@ int decaps_hdlc(int fd, int (*cb)(int cl
|
|
|
27639a |
/* this is the only blocking read we will allow */
|
|
|
27639a |
if ((end = read (fd, buffer, sizeof(buffer))) <= 0) {
|
|
|
27639a |
int saved_errno = errno;
|
|
|
27639a |
- warn("short read (%d): %s", end, strerror(saved_errno));
|
|
|
27639a |
+ warn("short read (%zd): %s", end, strerror(saved_errno));
|
|
|
27639a |
switch (saved_errno) {
|
|
|
27639a |
case EMSGSIZE: {
|
|
|
27639a |
socklen_t optval, optlen = sizeof(optval);
|
|
|
27639a |
@@ -499,7 +498,7 @@ int encaps_gre (int fd, void *pack, unsi
|
|
|
27639a |
if (errno == ENOBUFS)
|
|
|
27639a |
rc = 0; /* Simply ignore it */
|
|
|
27639a |
stats.tx_failed++;
|
|
|
27639a |
- } else if (rc < sizeof(u.header) - sizeof(u.header.seq)) {
|
|
|
27639a |
+ } else if ((size_t)rc < sizeof(u.header) - sizeof(u.header.seq)) {
|
|
|
27639a |
stats.tx_short++;
|
|
|
27639a |
} else {
|
|
|
27639a |
stats.tx_acks++;
|
|
|
27639a |
@@ -533,7 +532,7 @@ int encaps_gre (int fd, void *pack, unsi
|
|
|
27639a |
if (errno == ENOBUFS)
|
|
|
27639a |
rc = 0; /* Simply ignore it */
|
|
|
27639a |
stats.tx_failed++;
|
|
|
27639a |
- } else if (rc < header_len + len) {
|
|
|
27639a |
+ } else if ((size_t)rc < header_len + len) {
|
|
|
27639a |
stats.tx_short++;
|
|
|
27639a |
} else {
|
|
|
27639a |
stats.tx_sent++;
|
|
|
27639a |
diff -up pptp-1.7.2/pqueue.c.sign-compare pptp-1.7.2/pqueue.c
|
|
|
27639a |
--- pptp-1.7.2/pqueue.c.sign-compare 2008-05-14 07:33:55.000000000 +0100
|
|
|
27639a |
+++ pptp-1.7.2/pqueue.c 2011-11-30 16:41:39.598648652 +0000
|
|
|
27639a |
@@ -17,7 +17,7 @@
|
|
|
27639a |
|
|
|
27639a |
#define MIN_CAPACITY 128 /* min allocated buffer for a packet */
|
|
|
27639a |
|
|
|
27639a |
-static int pqueue_alloc (int seq, unsigned char *packet, int packlen, pqueue_t **new);
|
|
|
27639a |
+static int pqueue_alloc (u_int32_t seq, unsigned char *packet, int packlen, pqueue_t **new);
|
|
|
27639a |
|
|
|
27639a |
int packet_timeout_usecs = DEFAULT_PACKET_TIMEOUT * 1000000;
|
|
|
27639a |
|
|
|
27639a |
@@ -29,7 +29,7 @@ static pqueue_t *pq_freelist_head = NULL
|
|
|
27639a |
|
|
|
27639a |
|
|
|
27639a |
|
|
|
27639a |
-static int pqueue_alloc(int seq, unsigned char *packet, int packlen, pqueue_t **new) {
|
|
|
27639a |
+static int pqueue_alloc(u_int32_t seq, unsigned char *packet, int packlen, pqueue_t **new) {
|
|
|
27639a |
|
|
|
27639a |
pqueue_t *newent;
|
|
|
27639a |
|
|
|
27639a |
@@ -125,7 +125,7 @@ static int pqueue_alloc(int seq, unsigne
|
|
|
27639a |
|
|
|
27639a |
|
|
|
27639a |
|
|
|
27639a |
-int pqueue_add (int seq, unsigned char *packet, int packlen) {
|
|
|
27639a |
+int pqueue_add (u_int32_t seq, unsigned char *packet, int packlen) {
|
|
|
27639a |
pqueue_t *newent, *point;
|
|
|
27639a |
|
|
|
27639a |
/* get a new entry */
|
|
|
27639a |
diff -up pptp-1.7.2/pqueue.h.sign-compare pptp-1.7.2/pqueue.h
|
|
|
27639a |
--- pptp-1.7.2/pqueue.h.sign-compare 2008-05-14 07:33:55.000000000 +0100
|
|
|
27639a |
+++ pptp-1.7.2/pqueue.h 2011-11-30 18:42:16.733706666 +0000
|
|
|
27639a |
@@ -15,14 +15,14 @@ extern int packet_timeout_usecs;
|
|
|
27639a |
typedef struct pqueue {
|
|
|
27639a |
struct pqueue *next;
|
|
|
27639a |
struct pqueue *prev;
|
|
|
27639a |
- int seq;
|
|
|
27639a |
+ u_int32_t seq;
|
|
|
27639a |
struct timeval expires;
|
|
|
27639a |
unsigned char *packet;
|
|
|
27639a |
int packlen;
|
|
|
27639a |
int capacity;
|
|
|
27639a |
} pqueue_t;
|
|
|
27639a |
|
|
|
27639a |
-int pqueue_add (int seq, unsigned char *packet, int packlen);
|
|
|
27639a |
+int pqueue_add (u_int32_t seq, unsigned char *packet, int packlen);
|
|
|
27639a |
int pqueue_del (pqueue_t *point);
|
|
|
27639a |
pqueue_t *pqueue_head ();
|
|
|
27639a |
int pqueue_expiry_time (pqueue_t *entry);
|
|
|
27639a |
diff -up pptp-1.7.2/test.c.sign-compare pptp-1.7.2/test.c
|
|
|
27639a |
--- pptp-1.7.2/test.c.sign-compare 2008-05-14 07:33:55.000000000 +0100
|
|
|
27639a |
+++ pptp-1.7.2/test.c 2011-11-30 18:45:44.553853995 +0000
|
|
|
27639a |
@@ -52,7 +52,7 @@ static ssize_t write_reordered_swap(int
|
|
|
27639a |
test_ordering_phase = 0;
|
|
|
27639a |
/* send the new packet first */
|
|
|
27639a |
stat = write(fd, buf, count);
|
|
|
27639a |
- if (stat != count) return stat;
|
|
|
27639a |
+ if ((size_t)stat != count) return stat;
|
|
|
27639a |
/* then send the old packet next */
|
|
|
27639a |
stat = write(fd, pocket_buf, pocket_count);
|
|
|
27639a |
free(pocket_buf);
|
|
|
27639a |
@@ -96,7 +96,7 @@ static ssize_t write_reordered_retransmi
|
|
|
27639a |
test_ordering_phase = 0;
|
|
|
27639a |
/* send the new packet first */
|
|
|
27639a |
stat = write(fd, buf, count);
|
|
|
27639a |
- if (stat != count) return stat;
|
|
|
27639a |
+ if ((size_t)stat != count) return stat;
|
|
|
27639a |
/* send the buffered packets in normal order */
|
|
|
27639a |
for (n=0; n
|
|
|
27639a |
stat = write(fd, pocket_buf[n], pocket_count[n]);
|
|
|
27639a |
@@ -142,7 +142,7 @@ static ssize_t write_reordered_reverse(i
|
|
|
27639a |
test_ordering_phase = 0;
|
|
|
27639a |
/* send the new packet first */
|
|
|
27639a |
stat = write(fd, buf, count);
|
|
|
27639a |
- if (stat != count) return stat;
|
|
|
27639a |
+ if ((size_t)stat != count) return stat;
|
|
|
27639a |
/* send the buffered packets in reverse order */
|
|
|
27639a |
for (n=test_length-1; n>0; n--) {
|
|
|
27639a |
stat = write(fd, pocket_buf[n], pocket_count[n]);
|