<< | Thread Index | >> ]    [ << | Date Index | >> ]

Subject: cipe patch
From: João Seabra <seabra,AT,aac,DOT,uc,DOT,pt>
Date: Thu, 17 Apr 2003 18:47:36 +0200

In attach goes a little patch I wrote to correct ciped.
gcc makes alot of noise when compiling.This should fix it.

 Please test it.

 Kind Regards,

 João Seabra

--- cipe/ciped.c        2003-04-04 21:33:58.000000000 +0100
+++ cipe/ciped.c        2003-04-16 07:29:05.000000000 +0100
@@ -39,6 +39,7 @@
 #include "ciped.h"
 #include "ioctl.h"
 #include "cipelib.h"
+#include <time.h>
 
 #ifndef LOGFAC
 #define LOGFAC LOG_DAEMON

--- pkcipe/main.c       2001-02-14 20:21:34.000000000 +0000
+++ pkcipe/main.c       2003-04-16 06:57:51.000000000 +0100
@@ -106,7 +106,7 @@
     }
     setsig(SIGALRM, tout);
     alarm(timeout);
-    if (connect(c, &sa, sizeof(sa))<0) {
+    if (connect(c,(struct sockaddr *) &sa, sizeof(sa))<0) {
        perror("connect");
        close(c);
        return 1;
@@ -138,7 +138,7 @@
     sa.sin_family=AF_INET;
     sa.sin_port=htons(p);
     sa.sin_addr.s_addr=htonl(INADDR_ANY);
-    if (bind(l, &sa, sizeof(sa))<0) {
+    if (bind(l,(struct sockaddr *) &sa, sizeof(sa))<0) {
        perror("bind");
        close(l);
        return 1;
@@ -152,7 +152,7 @@
     while (1) {
        e=sizeof(sa);
         alarm(0);
-       if ((c=accept(l, &sa, &e))<0) {
+       if ((c=accept(l,(struct sockaddr *) &sa, &e))<0) {
            if (errno!=EINTR)
                perror("accept");
            continue;
@@ -265,7 +265,7 @@
     } else {
        struct sockaddr_in sa;
        int ss=sizeof(sa);
-       if (getpeername(0, &sa, &ss)<0) {
+       if (getpeername(0, (struct sockaddr *)&sa, &ss)<0) {
            Log(LOG_ERR, "main: getsockname: %m");
            sa.sin_addr.s_addr=htonl(INADDR_ANY);
        }

--- pkcipe/proto.c      2002-05-30 12:40:18.000000000 +0100
+++ pkcipe/proto.c      2003-04-16 06:55:22.000000000 +0100
@@ -100,16 +100,16 @@
     if (me) {
         getaddr(me, &sb, "udp");
     }
-    if (bind(f, &sb, sizeof(sb))<0) {
+    if (bind(f, (struct sockaddr *)&sb, sizeof(sb))<0) {
        perror("getMySocket: bind");
     }
     sb.sin_port=htons(9);
     sb.sin_addr=connectAddr;
-    if (connect(f, &sb, sizeof(sb))<0) {
+    if (connect(f,(struct sockaddr *) &sb, sizeof(sb))<0) {
        perror("getMySocket: connect");
     }
     n=sizeof(*sa);
-    if (getsockname(f, sa, &n)<0) {
+    if (getsockname(f,(struct sockaddr *) sa, &n)<0) {
        perror("getMySocket: getsockname");
     }
     return f;




<< | Thread Index | >> ]    [ << | Date Index | >> ]