]> git.pld-linux.org Git - packages/boa.git/blob - boa-SA_LEN.patch
- added noreplace to config-file
[packages/boa.git] / boa-SA_LEN.patch
1 --- ./src/boa.h.org     Fri Dec 14 03:15:46 2001
2 +++ ./src/boa.h Sat Dec 22 23:52:55 2001
3 @@ -25,6 +25,11 @@
4  #ifndef _BOA_H
5  #define _BOA_H
6  
7 +#ifndef SA_LEN
8 +#define SA_LEN(x) (((x)->sa_family == AF_INET6)?sizeof(struct sockaddr_in6): \
9 +               (((x)->sa_family == AF_INET)?sizeof(struct sockaddr_in):sizeof(struct sockaddr)))
10 +#endif
11 +
12  #include "config.h"
13  /* config.h should be 1st include because this sets lots of #defines that
14   are used in other header files
15 @@ -187,6 +192,6 @@
16  /* ip */
17  int bind_server(int server_s, char *server_ip);
18  char *ascii_sockaddr(struct SOCKADDR *s, char *dest, int len);
19 -int net_port(struct SOCKADDR *s);
20 +int net_port(struct sockaddr *s);
21  
22  #endif
23 --- ./src/ip.c.org      Sat Dec 22 23:34:29 2001
24 +++ ./src/ip.c  Sat Dec 22 23:51:28 2001
25 @@ -45,6 +45,7 @@
26  #include "boa.h"
27  #include "compat.h"
28  #include <arpa/inet.h>          /* inet_ntoa */
29 +#include <linux/socket.h>
30  
31  /* Binds to the existing server_s, based on the configuration string
32     in server_ip.  IPv6 version doesn't pay attention to server_ip yet.  */
33 @@ -84,7 +85,7 @@
34          *dest = '\0';
35      }
36  #ifdef WHEN_DOES_THIS_APPLY
37 -    if ((s->__ss_family == AF_INET6) &&
38 +    if ((s->sa_family == AF_INET6) &&
39          IN6_IS_ADDR_V4MAPPED(&(((struct sockaddr_in6 *) s)->sin6_addr))) {
40          strncpy(dest, dest + 7, NI_MAXHOST);
41      }
42 @@ -95,11 +96,11 @@
43      return dest;
44  }
45  
46 -int net_port(struct SOCKADDR *s)
47 +int net_port(struct sockaddr *s)
48  {
49      int p;
50  #ifdef INET6
51 -    switch (s->__ss_family) {
52 +    switch (s->sa_family) {
53      case AF_INET:
54          p = ntohs(((struct sockaddr_in *) s)->sin_port);
55          break;
56 @@ -108,7 +109,7 @@
57          break;
58      default:
59          fprintf(stderr, "[IPv6] family isn't supported: %d\n",
60 -                s->__ss_family);
61 +                s->sa_family);
62          p = 0;
63      }
64  #else
65 --- ./src/request.c.org Sat Dec 22 23:34:29 2001
66 +++ ./src/request.c     Sat Dec 22 23:56:36 2001
67 @@ -68,13 +68,13 @@
68  void get_request(int server_s)
69  {
70      int fd;                     /* socket */
71 -    struct SOCKADDR remote_addr; /* address */
72 +    struct sockaddr remote_addr; /* address */
73      int remote_addrlen = sizeof (struct sockaddr_in);
74      request *conn;              /* connection */
75      int len;
76      static int system_bufsize = 0; /* Default size of SNDBUF given by system */
77  
78 -    remote_addr.S_FAMILY = 0xdead;
79 +    remote_addr.sa_family = 0xdead;
80      fd = accept(server_s, (struct sockaddr *) &remote_addr,
81                  &remote_addrlen);
82  
This page took 0.043476 seconds and 3 git commands to generate.