Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 diff -Nau etc/c2s.xml.dist.in.orig etc/c2s.xml.dist.in
2 Index: etc/c2s.xml.dist.in
3 --- etc/c2s.xml.dist.in.orig 2012-05-22 22:27:51.000000000 +0200
4 +++ etc/c2s.xml.dist.in 2012-08-27 13:44:20.119445160 +0200
5 @@ -50,18 +50,16 @@
6 </router>
8 <!-- Log configuration - type is "syslog", "file" or "stdout" -->
9 - <log type='syslog'>
10 + <log type='file'>
11 <!-- If logging to syslog, this is the log ident -->
12 - <ident>jabberd/c2s</ident>
13 + <!-- <ident>jabberd/c2s</ident> -->
15 <!-- If logging to syslog, this is the log facility
16 (local0 - local7) [default: local3] -->
17 - <facility>local3</facility>
18 + <!-- <facility>local3</facility> -->
20 <!-- If logging to file, this is the filename of the logfile -->
21 - <!--
22 <file>@localstatedir@/@package@/log/c2s.log</file>
23 - -->
25 <!-- Filename of the debug logfile -->
26 <!--
27 @@ -154,7 +152,7 @@
28 <id password-change='mu' /> -->
30 <!-- IP address to bind to (default: 0.0.0.0) -->
31 - <ip>0.0.0.0</ip>
32 + <ip>127.0.0.1</ip>
34 <!-- Port to bind to, or 0 to disable unencrypted access to the
35 server (default: 5222) -->
36 diff -Nau etc/router.xml.dist.in.orig etc/router.xml.dist.in
37 Index: etc/router.xml.dist.in
38 --- etc/router.xml.dist.in.orig 2012-05-04 18:24:36.000000000 +0200
39 +++ etc/router.xml.dist.in 2012-08-27 13:47:20.357743449 +0200
40 @@ -8,18 +8,16 @@
41 <pidfile>@localstatedir@/@package@/pid/router.pid</pidfile>
43 <!-- Log configuration - type is "syslog", "file" or "stdout" -->
44 - <log type='syslog'>
45 + <log type='file'>
46 <!-- If logging to syslog, this is the log ident -->
47 - <ident>jabberd/router</ident>
48 + <!-- <ident>jabberd/router</ident> -->
50 <!-- If logging to syslog, this is the log facility
51 (local0 - local7) [default: local3] -->
52 - <facility>local3</facility>
53 + <!-- <facility>local3</facility> -->
55 <!-- If logging to file, this is the filename of the logfile -->
56 - <!--
57 <file>@localstatedir@/@package@/log/router.log</file>
58 - -->
60 <!-- Filename of the debug logfile -->
61 <!--
62 @@ -30,7 +28,7 @@
63 <!-- Local network configuration -->
64 <local>
65 <!-- IP address to bind to (default: 0.0.0.0) -->
66 - <ip>0.0.0.0</ip>
67 + <ip>127.0.0.1</ip>
69 <!-- Port to bind to (default: 5347) -->
70 <port>5347</port>
71 diff -Nau etc/s2s.xml.dist.in.orig etc/s2s.xml.dist.in
72 Index: etc/s2s.xml.dist.in
73 --- etc/s2s.xml.dist.in.orig 2012-08-06 20:18:46.000000000 +0200
74 +++ etc/s2s.xml.dist.in 2012-08-27 13:45:50.771011934 +0200
75 @@ -60,18 +60,16 @@
76 </router>
78 <!-- Log configuration - type is "syslog", "file" or "stdout" -->
79 - <log type='syslog'>
80 + <log type='file'>
81 <!-- If logging to syslog, this is the log ident -->
82 - <ident>jabberd/s2s</ident>
83 + <!-- <ident>jabberd/s2s</ident> -->
85 <!-- If logging to syslog, this is the log facility
86 (local0 - local7) [default: local3] -->
87 - <facility>local3</facility>
88 + <!-- <facility>local3</facility> -->
90 <!-- if logging to file, this is the filename of the logfile -->
91 - <!--
92 <file>@localstatedir@/@package@/log/s2s.log</file>
93 - -->
95 <!-- Filename of the debug logfile -->
96 <!--
97 @@ -83,7 +81,7 @@
98 <local>
99 <!-- IP and port to listen for incoming s2s connections on
100 (default: 0.0.0.0, 5269) -->
101 - <ip>0.0.0.0</ip>
102 + <ip>127.0.0.1</ip>
103 <port>5269</port>
105 <!-- Multihomed machines (with more than one interface and IP address)
106 diff -Nau etc/sm.xml.dist.in.orig etc/sm.xml.dist.in
107 Index: etc/sm.xml.dist.in
108 --- etc/sm.xml.dist.in.orig 2012-05-04 18:24:36.000000000 +0200
109 +++ etc/sm.xml.dist.in 2012-08-27 13:41:59.772838992 +0200
110 @@ -50,13 +50,13 @@
111 </router>
113 <!-- Log configuration - type is "syslog", "file" or "stdout" -->
114 - <log type='syslog'>
115 + <log type='file'>
116 <!-- If logging to syslog, this is the log ident -->
117 - <ident>jabberd/sm</ident>
118 + <!-- <ident>jabberd/sm</ident> -->
120 <!-- If logging to syslog, this is the log facility
121 (local0 - local7) [default: local3] -->
122 - <facility>local3</facility>
123 + <!-- <facility>local3</facility> -->
125 <!-- If logging to file, this is the filename of the logfile -->
126 <!--
127 diff -Nau sm/mod_iq_time.c.orig sm/mod_iq_time.c
128 Index: sm/mod_iq_time.c
129 --- sm/mod_iq_time.c.orig 2011-10-22 21:56:00.000000000 +0200
130 +++ sm/mod_iq_time.c 2012-08-27 13:41:59.773059371 +0200
131 @@ -39,6 +39,7 @@
132 static mod_ret_t _iq_time_pkt_sm(mod_instance_t mi, pkt_t pkt)
133 {
134 time_t t;
135 + time_t tzone;
136 struct tm *tm;
137 char buf[64];
138 char *c;
139 @@ -78,7 +79,8 @@
140 datetime_out(t, dt_DATETIME, buf, 64);
141 nad_insert_elem(pkt->nad, 2, NAD_ENS(pkt->nad, 1), "utc", buf);
142 #ifdef HAVE_TZSET
143 - snprintf(buf, 64, "%+03d:%02d", -((int)timezone)/(60*60), -((int)timezone)%(60*60));
144 + tzone = (time_t)((long)mktime(gmtime(&t)) - (long)t);
145 + snprintf(buf, 64, "%+03d:%02d", (int) -tzone/(60*60), (int) -tzone%(60*60));
146 #else
147 snprintf(buf, 64, "%+03d:%02d", (int) tm->tm_gmtoff/(60*60), (int) tm->tm_gmtoff%(60*60));
148 #endif
149 diff -Nau sm/mod_roster.c.orig sm/mod_roster.c
150 Index: sm/mod_roster.c
151 --- sm/mod_roster.c.orig 2012-02-12 22:36:18.000000000 +0100
152 +++ sm/mod_roster.c 2012-08-27 13:41:59.773438877 +0200
153 @@ -717,6 +717,9 @@
154 if(user->sessions == NULL)
155 return mod_PASS;
157 + /* We have to free old packet - Lemming's memory leak fix */
158 + pkt_free(pkt);
159 +
160 /* build a new packet to push out to everyone */
161 pkt = pkt_create(user->sm, "iq", "set", NULL, NULL);
162 pkt_id_new(pkt);
163 diff -Nau tools/jabberd.in.orig tools/jabberd.in
164 Index: tools/jabberd.in
165 --- tools/jabberd.in.orig 2012-02-12 22:38:25.000000000 +0100
166 +++ tools/jabberd.in 2012-09-16 11:21:49.325189601 +0200
167 @@ -65,7 +65,7 @@
170 #-----------------------------------------------------------------------------
171 -# Setup the jobs: router, sm, c2s, s2s
172 +# Setup the jobs: router, sm, c2s, s2s, mu-conference
173 #-----------------------------------------------------------------------------
174 $jobs{jabberd}->{prefix} = "JBRD";
176 @@ -85,12 +85,17 @@
177 $jobs{s2s}->{config} = "$config_dir/s2s.xml";
178 $jobs{s2s}->{prefix} = "S2S";
180 +$jobs{muc}->{cmd} = "$Bin/mu-conference";
181 +$jobs{muc}->{config} = "$config_dir/muc.xml";
182 +$jobs{muc}->{prefix} = "MUC";
183 +
184 if ($config eq "internal")
185 {
186 $programs[0] = ["router"];
187 $programs[1] = ["sm"];
188 $programs[2] = ["c2s"];
189 $programs[3] = ["s2s"];
190 + $programs[4] = ["muc"];
191 }
192 else
193 {
194 diff -Nau util/util.h.orig util/util.h
195 Index: util/util.h
196 --- util/util.h.orig 2012-08-22 08:03:58.000000000 +0200
197 +++ util/util.h 2012-08-27 13:41:59.773719964 +0200
198 @@ -30,6 +30,8 @@
199 #include <time.h>
200 #include <errno.h>
201 #include <assert.h>
202 +#include <sys/types.h>
203 +#include <sys/socket.h>
205 #include <expat.h>