Lines 1-8
Link Here
|
1 |
Index: sysdep/unix/krt.h |
1 |
Index: sysdep/unix/krt.h |
2 |
=================================================================== |
2 |
=================================================================== |
3 |
--- sysdep/unix/krt.h (revision 4869) |
3 |
--- sysdep/unix/krt.h (revision 4963) |
4 |
+++ sysdep/unix/krt.h (working copy) |
4 |
+++ sysdep/unix/krt.h (revision 4965) |
5 |
@@ -67,6 +67,7 @@ |
5 |
@@ -67,6 +67,7 @@ struct krt_proto { |
6 |
#ifdef CONFIG_ALL_TABLES_AT_ONCE |
6 |
#ifdef CONFIG_ALL_TABLES_AT_ONCE |
7 |
node instance_node; /* Node in krt instance list */ |
7 |
node instance_node; /* Node in krt instance list */ |
8 |
#endif |
8 |
#endif |
Lines 12-20
Link Here
|
12 |
|
12 |
|
13 |
Index: sysdep/bsd/krt-sock.h |
13 |
Index: sysdep/bsd/krt-sock.h |
14 |
=================================================================== |
14 |
=================================================================== |
15 |
--- sysdep/bsd/krt-sock.h (revision 4869) |
15 |
--- sysdep/bsd/krt-sock.h (revision 4963) |
16 |
+++ sysdep/bsd/krt-sock.h (working copy) |
16 |
+++ sysdep/bsd/krt-sock.h (revision 4965) |
17 |
@@ -42,5 +42,8 @@ |
17 |
@@ -42,5 +42,8 @@ struct krt_if_status { |
18 |
|
18 |
|
19 |
static inline int krt_set_params_same(struct krt_set_params *o UNUSED, struct krt_set_params *n UNUSED) { return 1; } |
19 |
static inline int krt_set_params_same(struct krt_set_params *o UNUSED, struct krt_set_params *n UNUSED) { return 1; } |
20 |
void krt_read_msg(struct proto *p, struct ks_msg *msg, int scan); |
20 |
void krt_read_msg(struct proto *p, struct ks_msg *msg, int scan); |
Lines 26-32
Link Here
|
26 |
Index: sysdep/bsd/fib.Y |
26 |
Index: sysdep/bsd/fib.Y |
27 |
=================================================================== |
27 |
=================================================================== |
28 |
--- sysdep/bsd/fib.Y (revision 0) |
28 |
--- sysdep/bsd/fib.Y (revision 0) |
29 |
+++ sysdep/bsd/fib.Y (revision 0) |
29 |
+++ sysdep/bsd/fib.Y (revision 4965) |
30 |
@@ -0,0 +1,29 @@ |
30 |
@@ -0,0 +1,29 @@ |
31 |
+/* |
31 |
+/* |
32 |
+ * BIRD -- FreeBSD rtsock configuration |
32 |
+ * BIRD -- FreeBSD rtsock configuration |
Lines 59-75
Link Here
|
59 |
+CF_END |
59 |
+CF_END |
60 |
Index: sysdep/bsd/Modules |
60 |
Index: sysdep/bsd/Modules |
61 |
=================================================================== |
61 |
=================================================================== |
62 |
--- sysdep/bsd/Modules (revision 4869) |
62 |
--- sysdep/bsd/Modules (revision 4963) |
63 |
+++ sysdep/bsd/Modules (working copy) |
63 |
+++ sysdep/bsd/Modules (revision 4965) |
64 |
@@ -4,3 +4,4 @@ |
64 |
@@ -4,3 +4,4 @@ sysio.h |
65 |
krt-set.h |
65 |
krt-set.h |
66 |
krt-sock.c |
66 |
krt-sock.c |
67 |
krt-sock.h |
67 |
krt-sock.h |
68 |
+fib.Y |
68 |
+fib.Y |
69 |
Index: sysdep/bsd/krt-scan.h |
69 |
Index: sysdep/bsd/krt-scan.h |
70 |
=================================================================== |
70 |
=================================================================== |
71 |
--- sysdep/bsd/krt-scan.h (revision 4869) |
71 |
--- sysdep/bsd/krt-scan.h (revision 4963) |
72 |
+++ sysdep/bsd/krt-scan.h (working copy) |
72 |
+++ sysdep/bsd/krt-scan.h (revision 4965) |
73 |
@@ -10,6 +10,7 @@ |
73 |
@@ -10,6 +10,7 @@ |
74 |
#define _BIRD_KRT_SCAN_H_ |
74 |
#define _BIRD_KRT_SCAN_H_ |
75 |
|
75 |
|
Lines 80-87
Link Here
|
80 |
struct krt_scan_status { |
80 |
struct krt_scan_status { |
81 |
Index: sysdep/bsd/krt-sock.c |
81 |
Index: sysdep/bsd/krt-sock.c |
82 |
=================================================================== |
82 |
=================================================================== |
83 |
--- sysdep/bsd/krt-sock.c (revision 4869) |
83 |
--- sysdep/bsd/krt-sock.c (revision 4963) |
84 |
+++ sysdep/bsd/krt-sock.c (working copy) |
84 |
+++ sysdep/bsd/krt-sock.c (revision 4965) |
85 |
@@ -33,8 +33,6 @@ |
85 |
@@ -33,8 +33,6 @@ |
86 |
#include "lib/string.h" |
86 |
#include "lib/string.h" |
87 |
#include "lib/socket.h" |
87 |
#include "lib/socket.h" |
Lines 91-97
Link Here
|
91 |
int |
91 |
int |
92 |
krt_capable(rte *e) |
92 |
krt_capable(rte *e) |
93 |
{ |
93 |
{ |
94 |
@@ -53,6 +51,49 @@ |
94 |
@@ -53,6 +51,49 @@ krt_capable(rte *e) |
95 |
); |
95 |
); |
96 |
} |
96 |
} |
97 |
|
97 |
|
Lines 106-112
Link Here
|
106 |
+ return 1; |
106 |
+ return 1; |
107 |
+ } |
107 |
+ } |
108 |
+ |
108 |
+ |
109 |
+ //log(L_TRACE "Max fibs: %d", fibs); |
109 |
+ log(L_TRACE "Max fibs: %d", fibs); |
110 |
+ return fibs; |
110 |
+ return fibs; |
111 |
+} |
111 |
+} |
112 |
+ |
112 |
+ |
Lines 141-147
Link Here
|
141 |
#define ROUNDUP(a) \ |
141 |
#define ROUNDUP(a) \ |
142 |
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) |
142 |
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) |
143 |
|
143 |
|
144 |
@@ -69,7 +110,7 @@ |
144 |
@@ -69,7 +110,7 @@ krt_capable(rte *e) |
145 |
body += l;} |
145 |
body += l;} |
146 |
|
146 |
|
147 |
static void |
147 |
static void |
Lines 150-156
Link Here
|
150 |
{ |
150 |
{ |
151 |
net *net = e->net; |
151 |
net *net = e->net; |
152 |
rta *a = e->attrs; |
152 |
rta *a = e->attrs; |
153 |
@@ -180,23 +221,23 @@ |
153 |
@@ -180,23 +221,23 @@ static void |
154 |
l = body - (char *)&msg; |
154 |
l = body - (char *)&msg; |
155 |
msg.rtm.rtm_msglen = l; |
155 |
msg.rtm.rtm_msglen = l; |
156 |
|
156 |
|
Lines 178-184
Link Here
|
178 |
} |
178 |
} |
179 |
} |
179 |
} |
180 |
|
180 |
|
181 |
@@ -218,25 +259,34 @@ |
181 |
@@ -218,25 +259,34 @@ void |
182 |
krt_set_start(struct krt_proto *x, int first UNUSED) |
182 |
krt_set_start(struct krt_proto *x, int first UNUSED) |
183 |
{ |
183 |
{ |
184 |
sock *sk_rt; |
184 |
sock *sk_rt; |
Lines 221-227
Link Here
|
221 |
} |
221 |
} |
222 |
|
222 |
|
223 |
#define SKIP(ARG...) do { DBG("KRT: Ignoring route - " ARG); return; } while(0) |
223 |
#define SKIP(ARG...) do { DBG("KRT: Ignoring route - " ARG); return; } while(0) |
224 |
@@ -624,6 +674,8 @@ |
224 |
@@ -624,6 +674,8 @@ krt_sysctl_scan(struct proto *p, pool *pool, byte |
225 |
size_t obl, needed; |
225 |
size_t obl, needed; |
226 |
struct ks_msg *m; |
226 |
struct ks_msg *m; |
227 |
int retries = 3; |
227 |
int retries = 3; |
Lines 230-236
Link Here
|
230 |
|
230 |
|
231 |
mib[0] = CTL_NET; |
231 |
mib[0] = CTL_NET; |
232 |
mib[1] = PF_ROUTE; |
232 |
mib[1] = PF_ROUTE; |
233 |
@@ -632,6 +684,17 @@ |
233 |
@@ -632,6 +684,17 @@ krt_sysctl_scan(struct proto *p, pool *pool, byte |
234 |
mib[4] = cmd; |
234 |
mib[4] = cmd; |
235 |
mib[5] = 0; |
235 |
mib[5] = 0; |
236 |
|
236 |
|
Lines 248-254
Link Here
|
248 |
try: |
248 |
try: |
249 |
if (sysctl(mib, 6 , NULL , &needed, NULL, 0) < 0) |
249 |
if (sysctl(mib, 6 , NULL , &needed, NULL, 0) < 0) |
250 |
die("krt_sysctl_scan 1: %m"); |
250 |
die("krt_sysctl_scan 1: %m"); |
251 |
@@ -656,6 +719,7 @@ |
251 |
@@ -656,6 +719,7 @@ krt_sysctl_scan(struct proto *p, pool *pool, byte |
252 |
goto try; |
252 |
goto try; |
253 |
|
253 |
|
254 |
log(L_ERR "KRT: Route scan failed"); |
254 |
log(L_ERR "KRT: Route scan failed"); |
Lines 256-262
Link Here
|
256 |
return; |
256 |
return; |
257 |
} |
257 |
} |
258 |
die("krt_sysctl_scan 2: %m"); |
258 |
die("krt_sysctl_scan 2: %m"); |
259 |
@@ -666,6 +730,8 @@ |
259 |
@@ -666,6 +730,8 @@ krt_sysctl_scan(struct proto *p, pool *pool, byte |
260 |
m = (struct ks_msg *)next; |
260 |
m = (struct ks_msg *)next; |
261 |
krt_read_msg(p, m, 1); |
261 |
krt_read_msg(p, m, 1); |
262 |
} |
262 |
} |
Lines 265-274
Link Here
|
265 |
} |
265 |
} |
266 |
|
266 |
|
267 |
static byte *krt_buffer = NULL; |
267 |
static byte *krt_buffer = NULL; |
|
|
268 |
@@ -695,10 +761,13 @@ krt_set_construct(struct krt_config *c UNUSED) |
269 |
} |
270 |
|
271 |
void |
272 |
-krt_set_shutdown(struct krt_proto *x UNUSED, int last UNUSED) |
273 |
+krt_set_shutdown(struct krt_proto *x UNUSED, int last) |
274 |
{ |
275 |
- mb_free(krt_buffer); |
276 |
- krt_buffer = NULL; |
277 |
+ if (last) |
278 |
+ { |
279 |
+ mb_free(krt_buffer); |
280 |
+ krt_buffer = NULL; |
281 |
+ } |
282 |
} |
283 |
|
284 |
void |
268 |
Index: sysdep/cf/bsd-v6.h |
285 |
Index: sysdep/cf/bsd-v6.h |
269 |
=================================================================== |
286 |
=================================================================== |
270 |
--- sysdep/cf/bsd-v6.h (revision 4869) |
287 |
--- sysdep/cf/bsd-v6.h (revision 4963) |
271 |
+++ sysdep/cf/bsd-v6.h (working copy) |
288 |
+++ sysdep/cf/bsd-v6.h (revision 4965) |
272 |
@@ -10,7 +10,7 @@ |
289 |
@@ -10,7 +10,7 @@ |
273 |
|
290 |
|
274 |
#define CONFIG_AUTO_ROUTES |
291 |
#define CONFIG_AUTO_ROUTES |
Lines 280-287
Link Here
|
280 |
#undef CONFIG_UNIX_SET |
297 |
#undef CONFIG_UNIX_SET |
281 |
Index: sysdep/cf/bsd.h |
298 |
Index: sysdep/cf/bsd.h |
282 |
=================================================================== |
299 |
=================================================================== |
283 |
--- sysdep/cf/bsd.h (revision 4869) |
300 |
--- sysdep/cf/bsd.h (revision 4963) |
284 |
+++ sysdep/cf/bsd.h (working copy) |
301 |
+++ sysdep/cf/bsd.h (revision 4965) |
285 |
@@ -8,7 +8,7 @@ |
302 |
@@ -8,7 +8,7 @@ |
286 |
|
303 |
|
287 |
#define CONFIG_AUTO_ROUTES |
304 |
#define CONFIG_AUTO_ROUTES |
Lines 291-293
Link Here
|
291 |
|
308 |
|
292 |
#undef CONFIG_UNIX_IFACE |
309 |
#undef CONFIG_UNIX_IFACE |
293 |
#undef CONFIG_UNIX_SET |
310 |
#undef CONFIG_UNIX_SET |
|
|
311 |
Index: sysdep/unix/krt.c |
312 |
=================================================================== |
313 |
--- sysdep/unix/krt.c (revision 4966) |
314 |
+++ sysdep/unix/krt.c (revision 4967) |
315 |
@@ -492,9 +492,9 @@ |
316 |
|
317 |
#ifdef CONFIG_ALL_TABLES_AT_ONCE |
318 |
static timer *krt_scan_timer; |
319 |
-static int krt_instance_count; |
320 |
static list krt_instance_list; |
321 |
#endif |
322 |
+static int krt_instance_count; |
323 |
|
324 |
static void |
325 |
krt_flush_routes(struct krt_proto *p) |
326 |
@@ -830,6 +830,7 @@ |
327 |
add_tail(&krt_instance_list, &p->instance_node); |
328 |
#else |
329 |
p->krt_pool = P->pool; |
330 |
+ krt_instance_count++; |
331 |
#endif |
332 |
|
333 |
#ifdef KRT_ALLOW_LEARN |
334 |
@@ -859,11 +860,12 @@ |
335 |
struct krt_proto *p = (struct krt_proto *) P; |
336 |
int last = 1; |
337 |
|
338 |
+ if (--krt_instance_count) |
339 |
+ last = 0; |
340 |
+ |
341 |
#ifdef CONFIG_ALL_TABLES_AT_ONCE |
342 |
rem_node(&p->instance_node); |
343 |
- if (--krt_instance_count) |
344 |
- last = 0; |
345 |
- else |
346 |
+ if (!krt_instance_count) |
347 |
#endif |
348 |
tm_stop(p->scan_timer); |
349 |
|