Re: Simple cell with standalone router/server + backup

"Elvis Stansvik" <[email protected]> Sat, 13 Sep 2008 12:57:03 +0200
Newsgroups gmane.network.silc.user
Message-ID <[email protected]>
2008/9/12 Elvis Stansvik <[email protected]>:
> 2008/9/12 Pekka Riikonen <[email protected]>:
>> : > Unfortuantely the current silcd requires ServerConnection entry, real or
>> : > dummy, for it to recognize that it is router.  This will be fixed in 1.2.
>> : > I'm not sure if the backup router stuff requires IP addresses instead of
>> : > host names, but you may also attempt to use only IP addresses and see if
>> : > it makes a difference, also.
>> :
>> : Hm. Okay. I tried making it a dummy connection like you suggested, and
>> : also changed to using only IP addresses, but still tcpdump shows
>> : absolutely no traffic on port 706 between the two hosts when I do
>> : state changing stuff like e.g. /join foo followed by /cmode foo +f.
>> :
>> The backup router configuration is wrong as well.  The backup router needs
>> to use the primary router as its primary router connection and thus use
>> RouterConnection.   But because it is also router it also must have real
>> or dummy ServerConnection entry:
>>
>> ServerConnection {
>>  host = "dummy";
>>  backup = true;
>> };
>>
>> RouterConnection {
>>  host = "silc.dose.se"
>>  initiator = true;
>> };
>>
>> Backup router must initiate connection to primary.
>>
>> Primary then has:
>>
>> ServerConnection {
>>  host = "dummy";
>> };
>>
>> RouterConnection {
>>  host = "silc2.dose.se"
>>  backuphost = "silc.dose.se"
>>  backupport = 706;
>>  backuplocal = true;
>> };
>>
>> I tested this and it worked...
>
> Thanks a lot for your patience with me. I see how I got it wrong now.
> However after I've adjusted my configuration to be:
>
> Backup Router
> --------------
> ServerConnection {
>        Host = "dummy";
>        Backup = true;
> };
> RouterConnection {
>        Host = "silc.dose.se";
>        Port = 706;
>        PublicKey = "/opt/etc/silc.dose.se.pub";
>        Params = "normal";
>        Initiator = true;
> };
>
> Primary Router
> ---------------
> ServerConnection {
>  Host = "dummy";
> };
> RouterConnection {
>  Host = "silc2.dose.se";
>  PublicKey = "/usr/local/etc/silc/silc2.dose.se.pub";
>  BackupHost = "silc.dose.se";
>  BackupPort = 706;
>  BackupLocal = true;
> };
>
> I first start up silcd on the primary router like this:
>
> [astan@franz /var/log/silc]$ sudo silcd -D 99
> [Logging] [Info] SILC Server started
>
> But then when I start up silcd on the backup router, I get a segfault
> on the primary:
>
> [Logging] [Info] Incoming connection h251n2fls33o879.telia.com (213.66.197.251)
> Segmentation fault: 11 (core dumped)
>
> It segfaults right at the connection attempt from the backup. Got any
> ideas off the top of your head about this, or should I bring out gdb?
> :)

I now compiled silc-server with --enable-debug on the primary router
and got a backtrace from the segfault:

Starting program: /usr/home/astan/silc/sbin/silcd -f
/usr/local/etc/silc/silcd.conf -D 99
[New LWP 100212]
[New Thread 0x28401100 (LWP 100212)]
[New Thread 0x28401200 (LWP 100162)]
[Thread 0x28401200 (LWP 100162) exited]
[New Thread 0x28401200 (LWP 100162)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x28401100 (LWP 100212)]
silc_pkcs_public_key_copy (public_key=0x0) at silcpkcs.c:637
637	  key->pkcs = public_key->pkcs;
#0  silc_pkcs_public_key_copy (public_key=0x0) at silcpkcs.c:637
#1  0x08061ff5 in silc_server_accept_completed (ske=0x284490c0,
status=SILC_SKE_STATUS_OK, prop=0x284058a0,
    keymat=0x2840eca0, rekey=0x2840b820, context=0x2842c080) at server.c:2578
#2  0x0810f8ee in silc_ske_st_responder_end (fsm=0x28449124,
fsm_context=0x284490c0, state_context=0x0)
    at silcske.c:969
#3  0x080b0db4 in silc_fsm_run (schedule=0x2841f1a0,
app_context=0x28406140, type=0, fd=0, context=0x28449124)
    at silcfsm.c:429
#4  0x080b0eb1 in silc_fsm_continue_sync (fsm=0x28449124) at silcfsm.c:309
#5  0x0810afbd in silc_ske_packet_receive (engine=0x2840f1f0,
stream=0x2842c080, packet=0x2840eb20,
    callback_context=0x284490c0, app_context=0x2842c0f0) at silcske.c:121
#6  0x08094c14 in silc_packet_dispatch (packet=0x2840eb20) at silcpacket.c:2054
#7  0x08098b10 in silc_packet_read_process (stream=0x2842c080) at
silcpacket.c:2318
#8  0x0809ae84 in silc_packet_stream_io (stream=0x2840ebb0,
status=SILC_STREAM_CAN_READ, context=0x2842c080)
    at silcpacket.c:436
#9  0x08118de6 in silc_socket_stream_io (schedule=0x2841f1a0,
app_context=0x28406140, type=SILC_TASK_READ,
    fd=10, context=0x2840ebb0) at silcunixsocketstream.c:36
#10 0x080a879a in silc_schedule_dispatch_fd (schedule=0x2841f1a0) at
silcschedule.c:61
#11 0x080a99e5 in silc_schedule_iterate (schedule=0x2841f1a0,
timeout_usecs=-1) at silcschedule.c:455
#12 0x080a9abc in silc_schedule (schedule=0x2841f1a0) at silcschedule.c:499
#13 0x0805900f in silc_server_run (server=0x28406140) at server.c:1192
#14 0x080503b5 in main (argc=Error accessing memory address 0x0: Bad address.
) at silcd.c:753

It seems that the key is NULL for some reason, not sure what to make
of it. Maybe it's a missing NULL-check somewhere or the value really
shouldn't be NULL there. So I tried with simple passphrase
authentication instead of using PublicKey, and then I get on the
primary router:

[astan@franz ~/silc/sbin]$ sudo ./silcd -f /usr/local/etc/silc/silcd.conf -D 99
[Logging] [Info] SILC Server started
[Logging] [Info] Incoming connection h251n2fls33o879.telia.com (213.66.197.251)
[Logging] [Error] Remote connection not configured
[Logging] [Error] Authentication failed
[Logging] [Info] Authentication failed for h251n2fls33o879.telia.com
(213.66.197.251) [Unknown]
[Logging] [Info] Closing connection h251n2fls33o879.telia.com:25591 [Unknown]

Sorry for all the troubles, but I really think it should work when I
use just Passphrase. Any more ideas?

Elvis

>
> Elvis
>
>>
>> : > All state data is transferred, topics, modes, clients, channels, servers,
>> : > etc.
>> :
>> : Okay that's great. I forgot to ask though; are the public keys that
>> : the server read in from PublicKeyDir considered state data? So that if
>> : I at some point E would actually allow client connections to my backup
>> : router, could my clients authenticate with their public keys to the
>> : backup router and it would work? E.g. the keys would have been
>> : transferred to the backup?
>> :
>> Public keys are not transferred.
>>
>>        Pekka
>> ________________________________________________________________________
>>  Pekka Riikonen                                 priikone at silcnet.org
>>  Secure Internet Live Conferencing (SILC)       http://silcnet.org/
>>
>

_______________________________________________________________
Info:    https://lists.silcnet.org/mailman/listinfo/silc-users
Archive: https://lists.silcnet.org/pipermail/silc-users
FAQ:     http://silcnet.org/support/faq/