[PATCH] Force KRT rescan on syncer startup with multi syncer config

Sergey Popovich popovich_sergei at mail.ru
Thu Oct 10 09:24:24 CEST 2013


It seems commit

  commit c6964c305b425b98aaf0492806a28b578d799d83
  Author: Ondrej Zajicek <santiago at crfreenet.org>
  Date:   Sat Jun 29 22:55:41 2013 +0200

      Makes krt.c much more readable.

introduces regression, so in configurations with more
than one kernel syncer when kernel protocol added/enabled/or
restarted (for example due to filter changes), no KRT scan is
performed and BRT remains empty until next scan on regular
interval specified scan time option).

BIRD config:
------------
# Configure logging
log stderr all;
log syslog all;

router id 172.16.1.1;

protocol device devices {
	scan time 120;
}

### KRT 10

table rt_10;

protocol kernel kernel10 {
	table rt_10;

	debug all;

	persist no;
	scan time 120;
	learn yes;
	device routes yes;
	kernel table 10;
	import all;
	export none;
}

### KRT 20

table rt_20;

protocol kernel kernel20 {
	disabled yes;

	table rt_20;

	debug all;

	persist no;
	scan time 120;
	learn yes;
	device routes yes;
	kernel table 20;
	import all;
	export none;
}

System configuration:
---------------------

# ip -4 addr sh dev lo255
6: lo255: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    inet 192.0.2.1/24 brd 192.0.2.255 scope global lo255

# ip -4 route show table 10
172.16.1.0/24 dev lo255  proto static  scope link  src 192.0.2.1 

# ip -4 route show table 20
172.16.1.0/24 dev lo255  proto static  scope link  src 192.0.2.1

After BIRD starts:
------------------

# birdc 'show protocols'
BIRD 1.3.11 ready.
name     proto    table    state  since       info
devices  Device   master   up     10:21       
kernel10 Kernel   rt_10    up     10:21       
kernel20 Kernel   rt_20    down   10:21

# birdc 'show route table rt_10'
BIRD 1.3.11 ready.
172.16.1.0/24      dev lo255 [kernel10 10:21] * (10)

# birdc 'show route table rt_20'
BIRD 1.3.11 ready.

Now enable kernel20:
--------------------

# birdc 'enable kernel20'
BIRD 1.3.11 ready.
kernel20: enabled

10-10-2013 10:23:11 <INFO> Enabling protocol kernel20
Kicking kernel20 up
10-10-2013 10:23:11 <TRACE> kernel20: Starting
Allocating FIB hash of order 10: 1024 entries, 0 low, 4096 high
kernel20 reporting state transition HUNGRY/DOWN -> */UP
kernel20: Scheduling meal
Connecting protocol kernel20 to table rt_20
10-10-2013 10:23:11 <TRACE> kernel20: Connected to table rt_20
10-10-2013 10:23:11 <TRACE> kernel20: State changed to feed
Feeding protocol kernel20
Feeding protocol kernel20 continued
Announcing routes to new protocol kernel20
10-10-2013 10:23:11 <TRACE> kernel20: State changed to up
Protocol kernel20 up and running

And see no routes from kernel:
------------------------------
# birdc 'show route table rt_20'
BIRD 1.3.11 ready.

After less than scan time interval (120 sec in configuration):
--------------------------------------------------------------

BIRD 1.3.11 ready.
172.16.1.0/24      dev lo255 [kernel20 10:25] * (10)

10-10-2013 10:25:06 <TRACE> kernel10: 172.16.1.0/24: [alien] seen
KRT: Got 172.16.1.0/24, type=1, oif=6, table=20, prid=4, proto=kernel20
10-10-2013 10:25:06 <TRACE> kernel20: 172.16.1.0/24: [alien] created

---
 sysdep/unix/krt.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Force-KRT-rescan-on-syncer-startup-with-multi-syncer-c.eml
Type: text/x-patch
Size: 434 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20131010/f2035f65/attachment.bin>


More information about the Bird-users mailing list