Author: axel Date: 2009-11-27 14:42:32 +0000 (Fri, 27 Nov 2009) New Revision: 1484
Modified: trunk/batman-experimental/batman.h trunk/batman-experimental/control.c trunk/batman-experimental/hna.c trunk/batman-experimental/lib/Makefile trunk/batman-experimental/lib/bmx_gsf_map/Makefile trunk/batman-experimental/lib/bmx_howto_plugin/Makefile trunk/batman-experimental/lib/bmx_http_info/Makefile trunk/batman-experimental/lib/bmx_uci_config/Makefile trunk/batman-experimental/linux/route.c trunk/batman-experimental/originator.c Log: fix some 64bit linux issues
Modified: trunk/batman-experimental/batman.h =================================================================== --- trunk/batman-experimental/batman.h 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/batman.h 2009-11-27 14:42:32 UTC (rev 1484) @@ -458,8 +458,11 @@ int16_t send_bucket; uint8_t iteration; uint8_t own_if; + int32_t ogm_buff_len; struct batman_if *if_outgoing; - int32_t ogm_buff_len; + + // the following ogm_buff array MUST be aligned with bit-range of the OS (64bit for 64-bit OS) + // having a pointer right before ensures this alignment. unsigned char ogm_buff[]; // this is to access following ogm data };
Modified: trunk/batman-experimental/control.c =================================================================== --- trunk/batman-experimental/control.c 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/control.c 2009-11-27 14:42:32 UTC (rev 1484) @@ -486,7 +486,7 @@ if ( cn->dbgl != DBGL_ALL ) { syslog( LOG_ERR, "failed %d times writing %d instead of %d/%d bytes (%s)! Giving up: %s\n", - i, w, strlen(s+out), strlen(s), strerror(errno), s+out ); + i, (int)w, (int)strlen(s+out), (int)strlen(s), strerror(errno), s+out ); } break; @@ -1740,7 +1740,7 @@ p_track = NULL; - dbgf_all( DBGT_INFO, "p_val:%s c:%x", patch->p_val, (uint32_t)c ); + dbgf_all( DBGT_INFO, "p_val:%s", patch->p_val ); if ( (p_track = get_opt_parent_val( opt, val )) ) c_track = get_opt_child( c->c_opt, p_track ); @@ -2993,7 +2993,7 @@ } else { - dbgf( DBGL_SYS, DBGT_ERR, "called with out %s and in %d %s", out, (uint32_t)in, in ); + dbgf( DBGL_SYS, DBGT_ERR, "called with out: %s and in: %s", out, in ); cleanup_all( -500017 ); }
Modified: trunk/batman-experimental/hna.c =================================================================== --- trunk/batman-experimental/hna.c 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/hna.c 2009-11-27 14:42:32 UTC (rev 1484) @@ -246,8 +246,8 @@ { dbgf( DBGL_SYS, DBGT_ERR, "invalid hna information on %x, hal %d, ha %x, ohna_data %x ohal %d, oha %x!", - (uint32_t)on, len, (uint32_t)array, (uint32_t)orig_hna, - orig_hna?orig_hna->hna_array_len:0, (uint32_t)(orig_hna?orig_hna->hna_array:0) ); + (uint64_t)on, len, (uint64_t)array, (uint64_t)orig_hna, + orig_hna?orig_hna->hna_array_len:0, (uint64_t)(orig_hna?orig_hna->hna_array:0) ); cleanup_all( -500024 ); }
Modified: trunk/batman-experimental/lib/Makefile =================================================================== --- trunk/batman-experimental/lib/Makefile 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/lib/Makefile 2009-11-27 14:42:32 UTC (rev 1484) @@ -1,5 +1,5 @@
-PLUGINS = $(shell find -maxdepth 1 -type d | grep -e '^./bmx_' ) +PLUGINS = $(shell find -maxdepth 1 -type d | grep -e '^./bmx_' | sort)
%: for d in $(PLUGINS); do $(MAKE) -C $$d $@ || echo compiling $$d failed; echo;echo; done
Modified: trunk/batman-experimental/lib/bmx_gsf_map/Makefile =================================================================== --- trunk/batman-experimental/lib/bmx_gsf_map/Makefile 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/lib/bmx_gsf_map/Makefile 2009-11-27 14:42:32 UTC (rev 1484) @@ -1,5 +1,5 @@
-CFLAGS += -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ +CFLAGS += -fpic -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ LDFLAGS += -shared #-Wl,-soname,bmxd_config
Modified: trunk/batman-experimental/lib/bmx_howto_plugin/Makefile =================================================================== --- trunk/batman-experimental/lib/bmx_howto_plugin/Makefile 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/lib/bmx_howto_plugin/Makefile 2009-11-27 14:42:32 UTC (rev 1484) @@ -1,5 +1,5 @@
-CFLAGS += -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ +CFLAGS += -fpic -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ LDFLAGS += -shared #-Wl,-soname,bmxd_config
Modified: trunk/batman-experimental/lib/bmx_http_info/Makefile =================================================================== --- trunk/batman-experimental/lib/bmx_http_info/Makefile 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/lib/bmx_http_info/Makefile 2009-11-27 14:42:32 UTC (rev 1484) @@ -1,5 +1,5 @@
-CFLAGS += -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ +CFLAGS += -fpic -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ LDFLAGS += -shared #-Wl,-soname,bmxd_config
Modified: trunk/batman-experimental/lib/bmx_uci_config/Makefile =================================================================== --- trunk/batman-experimental/lib/bmx_uci_config/Makefile 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/lib/bmx_uci_config/Makefile 2009-11-27 14:42:32 UTC (rev 1484) @@ -1,5 +1,5 @@
-CFLAGS += -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ +CFLAGS += -fpic -pedantic -Wall -W -Wno-unused-parameter -O1 -g3 -std=gnu99 -I../../ LDFLAGS += -shared -luci #-Wl,-soname,bmx_config
Modified: trunk/batman-experimental/linux/route.c =================================================================== --- trunk/batman-experimental/linux/route.c 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/linux/route.c 2009-11-27 14:42:32 UTC (rev 1484) @@ -947,11 +947,17 @@ bif->if_conf_hard_changed = NO; - //reschedule if_reconfigure_soft( bif ); done from check_interfaces() bif->if_conf_soft_changed = YES; - + bif->if_active = YES; + + //reschedule if_reconfigure_soft( bif ) also called from check_interfaces() + // but should also be called here + // - before first schedule_own_ogm() + // - after if_active=YES + if_reconfigure_soft( bif ); + if ( !bif->if_scheduling ) schedule_own_ogm( bif );
Modified: trunk/batman-experimental/originator.c =================================================================== --- trunk/batman-experimental/originator.c 2009-11-14 06:11:37 UTC (rev 1483) +++ trunk/batman-experimental/originator.c 2009-11-27 14:42:32 UTC (rev 1484) @@ -1159,7 +1159,8 @@ if ( ogm->ogm_pws < MIN_PWS || ogm->ogm_pws > MAX_PWS ) { - dbgf_all( DBGT_INFO, "drop OGM: unsopported path window size!" ); + dbg_mute( 30, DBGL_SYS, DBGT_WARN, "drop OGM: %s unsopported path window size %d !", + ipStr( ogm->orig ), ogm->ogm_pws ); goto process_ogm_end; } @@ -1177,7 +1178,7 @@ if ( neigh == bif->if_broad ) { - dbgf_all( DBGT_INFO, "drop OGM: ignoring all packets with broadcast source IP (sender: %s)", + dbg_mute( 30, DBGL_SYS, DBGT_WARN, "drop OGM: %s ignoring all packets with broadcast source IP", mb->neigh_str ); goto process_ogm_end; }