[olsr-dev] olsr and the defaultroute on macosx

Lorenz Schori (spam-protected)
Sat Feb 25 14:30:36 CET 2006


Am 25.02.2006 um 01:08 schrieb Alexander Morlang:

> Hi,
> when osx comes out of sleep, it sets the defaultroute. when olsrd  
> trys to set it, ist throws an error. i asked felix, an he wrote a  
> small patch, and it looks like it works.
> i attached it for your review.
>
> Greets, Alex
> diff -urN olsrd.old/src/bsd/kernel_routes.c olsrd.dev/src/bsd/ 
> kernel_routes.c
> --- olsrd.old/src/bsd/kernel_routes.c	2005-02-27 11:43:38.000000000  
> +0100
> +++ olsrd.dev/src/bsd/kernel_routes.c	2006-02-25 00:48:33.292240500  
> +0100
> @@ -93,10 +93,10 @@
>    }
>
>    rtm->rtm_version = RTM_VERSION;
> -  rtm->rtm_type = (add != 0) ? RTM_ADD : RTM_DELETE;
> +  rtm->rtm_type = (add == 1) ? RTM_ADD : RTM_DELETE;
>    rtm->rtm_index = 0;
>    rtm->rtm_flags = flags;
> -  rtm->rtm_addrs = RTA_DST | RTA_NETMASK | RTA_GATEWAY;
> +  rtm->rtm_addrs = (add == 2) ? RTA_DST : RTA_DST | RTA_NETMASK |  
> RTA_GATEWAY;
>    rtm->rtm_seq = ++seq;
>
>    walker = buff + sizeof (struct rt_msghdr);
> @@ -162,6 +162,7 @@
>
>  int olsr_ioctl_add_route(struct rt_entry *dest)
>  {
> +  add_del_route(dest, 2);
>    return add_del_route(dest, 1);
>  }

hi alex

i freqently get olsrd crashes on osx possibly related to sleep/wakeup  
or interface changes. i've attached a typical crash log entry below.  
it is not this very problem you are experiencing but probably a  
related one. as far as i remember the crash occures as soon as i shut  
down my wireless interface. i did not investigate it further because  
i just launch olsrd if i need it. could you please explain why it is  
nessesary to add a "pure" destination route before adding netmask +  
gateway?

lorenz


**********

Host Name:      mobilo
Date/Time:      2006-02-21 19:36:54.722 +0100
OS Version:     10.4.5 (Build 8H14)
Report Version: 4

Command: olsrd
Path:    /usr/local/sbin/olsrd
Parent:  launchd [1]

Version: ??? (???)

PID:    592
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x000006c0

Thread 0 Crashed:
0   libSystem.B.dylib 	0x900030b0 strcmp + 48
1   olsrd             	0x00016198 add_del_route + 544  
(kernel_routes.c:129)
2   olsrd             	0x00012390 olsr_delete_routes_from_kernel +  
256 (process_routes.c:351)
3   olsrd             	0x00012974 olsr_update_kernel_routes + 144  
(process_routes.c:225)
4   olsrd             	0x0000a0c4 olsr_calculate_lq_routing_table +  
1940 (lq_route.c:700)
5   olsrd             	0x0000e558 olsr_process_changes + 328 (olsr.c: 
212)
6   olsrd             	0x000147fc scheduler + 596 (scheduler.c:170)
7   olsrd             	0x0000b2a8 main + 4068 (main.c:409)
8   olsrd             	0x00001e64 _start + 340 (crt.c:272)
9   olsrd             	0x00001d0c start + 60

Thread 0 crashed with PPC Thread State 64:
   srr0: 0x00000000900030b0 srr1:  
0x000000000200f030                        vrsave: 0x0000000000000000
     cr: 0x44002442          xer: 0x0000000020000004   lr:  
0x0000000000016198  ctr: 0x0000000000000002
     r0: 0x0000000000000002   r1: 0x00000000bffff330   r2:  
0x00000000a00066d0   r3: 0x0000000001805583
     r4: 0x00000000000006bc   r5: 0x00000000fefefeff   r6:  
0x0000000080808080   r7: 0x000000000000006c
     r8: 0x0000000000000030   r9: 0x0000000000000000  r10:  
0x0000000000000060  r11: 0x00000000000242b8
    r12: 0x0000000090003080  r13: 0x00000000000245b0  r14:  
0x00000000000245b0  r15: 0x0000000000019944
    r16: 0x0000000000025f54  r17: 0x0000000000025f60  r18:  
0x0000000000029944  r19: 0x00000000000222a4
    r20: 0x0000000000025f54  r21: 0x0000000000025f60  r22:  
0x0000000000025f54  r23: 0x0000000000000001
    r24: 0x0000000000025f54  r25: 0x0000000000025f84  r26:  
0x0000000000303b70  r27: 0x00000000bffff3ac
    r28: 0x0000000000300690  r29: 0x000000000180516c  r30:  
0x0000000001805000  r31: 0x0000000000015f84

Binary Images Description:
     0x1000 -    0x23fff olsrd 	/usr/local/sbin/olsrd
    0x8a000 -    0x8bfff olsrd_dot_draw.so.0.3 	/usr/local/lib/ 
olsrd_dot_draw.so.0.3
    0x91000 -    0x93fff olsrd_nameservice.so.0.2 	/usr/local/lib/ 
olsrd_nameservice.so.0.2
    0x9d000 -    0xa6fff olsrd_httpinfo.so.0.1 	/usr/local/lib/ 
olsrd_httpinfo.so.0.1
0x8fe00000 - 0x8fe54fff dyld 44.2	/usr/lib/dyld
0x90000000 - 0x901b3fff libSystem.B.dylib 	/usr/lib/libSystem.B.dylib
0x9020b000 - 0x9020ffff libmathCommon.A.dylib 	/usr/lib/system/ 
libmathCommon.A.dylib



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Signierter Teil der Nachricht
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20060225/008bf79d/attachment.sig>


More information about the Olsr-dev mailing list