summaryrefslogtreecommitdiff
blob: f37392ad17cae0ea0b55808ea823d8aa4532471f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
--- pump-0.8.21/pump.c.orig	2005-11-18 09:43:38.634480153 +0000
+++ pump-0.8.21/pump.c	2005-11-18 09:42:26.736658004 +0000
@@ -306,7 +306,7 @@
 static void runDaemon(int sock, int sock_in) {
     int conn;
     struct sockaddr_un addr;
-    int addrLength = sizeof(struct sockaddr_un);
+    socklen_t addrLength = sizeof(struct sockaddr_un);
     struct command cmd;
     struct pumpNetIntf intf[20];
     const int maxIntf = sizeof(intf) / sizeof(intf[0]);
--- pump-0.8.21/dhcp.c.orig	2005-11-18 09:43:46.883546029 +0000
+++ pump-0.8.21/dhcp.c	2005-11-18 09:55:24.672589943 +0000
@@ -406,7 +406,7 @@
     unsigned char option, length;
 
    
-    chptr = response->vendor;
+    chptr = (unsigned char *) response->vendor;
 
     chptr += 4;
     while (*chptr != 0xFF) {
@@ -483,7 +483,7 @@
     intf->set |= PUMP_INTFINFO_HAS_NEXTSERVER;
     syslog (LOG_DEBUG, "intf: next server: %s", inet_ntoa (intf->nextServer));
 
-    chptr = breq->vendor;
+    chptr = (unsigned char *) breq->vendor;
     chptr += 4;
     while (*chptr != 0xFF && (void *) chptr < (void *) breq->vendor + DHCP_VENDOR_LENGTH) {
 	option = *chptr++;
@@ -739,7 +739,7 @@
     syslog (LOG_DEBUG, "%s: servername: %s", name, breq->servername);
     syslog (LOG_DEBUG, "%s: bootfile: %s", name, breq->bootfile);
     
-    vndptr = breq->vendor;
+    vndptr = (unsigned char *) breq->vendor;
     sprintf (vendor, "0x%02x 0x%02x 0x%02x 0x%02x", vndptr[0], vndptr[1], vndptr[2], vndptr[3]);
     vndptr += 4;
     syslog (LOG_DEBUG, "%s: vendor: %s", name, vendor);
@@ -751,7 +751,7 @@
 	if (option == 0xFF)
 	  {
 	    sprintf (vendor, "0x%02x", option);
-	    vndptr = breq->vendor + DHCP_VENDOR_LENGTH;
+	    vndptr = (unsigned char *)breq->vendor + DHCP_VENDOR_LENGTH;
 	  }
 	else if (option == 0x00)
 	  {
@@ -794,10 +794,11 @@
     fd_set readfs;
     int i, j;
     struct sockaddr_pkt tmpAddress;
+    socklen_t addrLength;
     int gotit = 0;
     int tries;
     int nextTimeout = 2;
-    time_t timeoutTime;
+    time_t timeoutTime = 0;
     int sin;
     int resend = 1;
     struct ethhdr;
@@ -884,9 +885,9 @@
 	    break;
 
 	  case 1:
-	    i = sizeof(tmpAddress);
+	    addrLength = sizeof(tmpAddress);
 	    if ((j = recvfrom(sin, ethPacket, sizeof(ethPacket), 0, 
-		     (struct sockaddr *) &tmpAddress, &i)) < 0)
+		     (struct sockaddr *) &tmpAddress, &addrLength)) < 0)
 		return perrorstr("recvfrom");
 
 	    /* We need to do some basic sanity checking of the header */
@@ -998,7 +999,7 @@
     unsigned char * chptr;
     int theOption, theLength;
 
-    chptr = breq->vendor;
+    chptr = (unsigned char *) breq->vendor;
     chptr += 4;
     while (*chptr != 0xFF && *chptr != option) {
 	theOption = *chptr++;
@@ -1018,7 +1019,7 @@
     unsigned char * chptr;
     unsigned int length, theOption;
 
-    chptr = bresp->vendor;
+    chptr = (unsigned char *) bresp->vendor;
     chptr += 4;
     while (*chptr != 0xFF && *chptr != option) {
 	theOption = *chptr++;
@@ -1290,7 +1291,7 @@
     struct sockaddr_in serverAddr;
     struct sockaddr_ll broadcastAddr;
     struct bootpRequest breq, bresp;
-    unsigned char * chptr;
+    char * chptr;
     time_t startTime = pumpUptime();
     char * saveDeviceName;
     unsigned char messageType;