add packages_10.03.2 in preparation for the 10.03.2 interim release
[10.03/packages.git] / net / linuxigd / patches / 001-iptables_defs.patch
1 diff -urN linuxigd-1.0/iptc.c linuxigd-1.0.new/iptc.c
2 --- linuxigd-1.0/iptc.c 2006-09-11 17:55:48.000000000 +0200
3 +++ linuxigd-1.0.new/iptc.c     2007-06-02 12:24:34.000000000 +0200
4 @@ -22,9 +22,9 @@
5  struct ipt_entry_match *get_udp_match(const char *sports, const char *dports, unsigned int *nfcache);
6  struct ipt_entry_target *get_dnat_target(const char *input, unsigned int *nfcache);
7  
8 -static u_int16_t parse_port(const char *port);
9 -static void parse_ports(const char *portstring, u_int16_t *ports);
10 -static int service_to_port(const char *name);
11 +static u_int16_t igd_parse_port(const char *port);
12 +void parse_ports(const char *portstring, u_int16_t *ports);
13 +static int igd_service_to_port(const char *name);
14  
15  static void parse_range(const char *input, struct ip_nat_range *range);
16  static struct ipt_natinfo *append_range(struct ipt_natinfo *info, const struct ip_nat_range *range);
17 @@ -336,13 +336,12 @@
18  }
19  
20  /* Copied and modified from libipt_tcp.c and libipt_udp.c */
21 -
22  static u_int16_t
23 -parse_port(const char *port)
24 +igd_parse_port(const char *port)
25  {
26         unsigned int portnum;
27  
28 -       if ((portnum = service_to_port(port)) != -1) {
29 +       if ((portnum = igd_service_to_port(port)) != -1) {
30                 return (u_int16_t)portnum;
31         }
32         else {
33 @@ -350,7 +349,7 @@
34         }
35  }
36  
37 -static void
38 +void
39  parse_ports(const char *portstring, u_int16_t *ports)
40  {
41         char *buffer;
42 @@ -358,19 +357,18 @@
43  
44         buffer = strdup(portstring);
45         if ((cp = strchr(buffer, ':')) == NULL)
46 -               ports[0] = ports[1] = parse_port(buffer);
47 +               ports[0] = ports[1] = igd_parse_port(buffer);
48         else {
49                 *cp = '\0';
50                 cp++;
51  
52 -               ports[0] = buffer[0] ? parse_port(buffer) : 0;
53 -               ports[1] = cp[0] ? parse_port(cp) : 0xFFFF;
54 +               ports[0] = buffer[0] ? igd_parse_port(buffer) : 0;
55 +               ports[1] = cp[0] ? igd_parse_port(cp) : 0xFFFF;
56         }
57         free(buffer);
58  }
59 -
60  static int
61 -service_to_port(const char *name)
62 +igd_service_to_port(const char *name)
63  {
64         struct servent *service;
65  
66 @@ -382,7 +380,6 @@
67  
68  
69  
70 -
71  /* Copied and modified from libipt_DNAT.c */
72  
73  static void