linux integration; annotated tag, v2.6.37-rc4, created. v2.6.37-rc4
by postmaster@open-mesh.org
The annotated tag, v2.6.37-rc4 has been created
at 78d3494aa9e5cbd28600b5440655b263ab1c0efd (tag)
tagging e8a7e48bb248a1196484d3f8afa53bded2b24e71 (commit)
replaces v2.6.37-rc3
tagged by Linus Torvalds
on Mon Nov 29 20:42:18 2010 -0800
- Shortlog ------------------------------------------------------------
Linux 2.6.37-rc4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAkz0gLAACgkQF3YsRnbiHLsxRwCcDffYyBLcJI+woCU64dmR++YZ
7sQAn1vvWvjtNVWz6bi0F/wP6pXFI1ZW
=Ge2j
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
11 years, 6 months
bmx; test conversation; branch, bmx-0.3.x, updated. 395c2edcd51c79d2e5b5b82b6c00acf89f3a27ae
by postmaster@open-mesh.org
The following commit has been merged in the bmx-0.3.x branch:
commit 97509432fb0e27775117ef55c122f966bc4abda5
Author: Axel Neumann <axel(a)open-mesh.net>
Date: Mon Nov 29 16:10:18 2010 +0100
bmx-0.3.x/batman.c: quick vis_packet->seq_range fix
diff --git a/batman.c b/batman.c
index 5d33f12..f978e50 100644
--- a/batman.c
+++ b/batman.c
@@ -205,7 +205,7 @@ static void send_vis_packet( void *unused ) {
((struct vis_packet *)vis_packet)->sender_ip = primary_addr;
((struct vis_packet *)vis_packet)->version = VIS_COMPAT_VERSION;
((struct vis_packet *)vis_packet)->gw_class = Gateway_class;
- ((struct vis_packet *)vis_packet)->seq_range = local_lws;
+ ((struct vis_packet *)vis_packet)->seq_range = (PROBE_RANGE/PROBE_TO100);
/* iterate link list */
--
bmx; test conversation
11 years, 6 months
bmx; test conversation; branch, bmx-0.3.x, updated. 395c2edcd51c79d2e5b5b82b6c00acf89f3a27ae
by postmaster@open-mesh.org
The following commit has been merged in the bmx-0.3.x branch:
commit 395c2edcd51c79d2e5b5b82b6c00acf89f3a27ae
Author: Axel Neumann <axel(a)open-mesh.net>
Date: Mon Nov 29 16:17:14 2010 +0100
bmx-0.3.x/batman.c: cleanup opt_vis(), send_vis_packet()
diff --git a/batman.c b/batman.c
index f978e50..1095e5a 100644
--- a/batman.c
+++ b/batman.c
@@ -180,7 +180,6 @@ static int32_t vis_port = DEF_VIS_PORT;
static void send_vis_packet( void *unused ) {
struct vis_if *vis = vis_if;
- struct vis_data *vis_data;
struct list_head *list_pos;
struct batman_if *batman_if;
//struct hna_node *hna_node;
@@ -207,6 +206,8 @@ static void send_vis_packet( void *unused ) {
((struct vis_packet *)vis_packet)->gw_class = Gateway_class;
((struct vis_packet *)vis_packet)->seq_range = (PROBE_RANGE/PROBE_TO100);
+ dbgf_all(DBGT_INFO, "sender_ip=%s version=%d gw_class=%d seq_range=%d",
+ ipStr(primary_addr), VIS_COMPAT_VERSION, Gateway_class, (PROBE_RANGE/PROBE_TO100));
/* iterate link list */
list_for_each( link_pos, &link_list ) {
@@ -217,14 +218,17 @@ static void send_vis_packet( void *unused ) {
continue;
uint32_t q_max = 0;
+ struct vis_data *vis_data = NULL;
list_for_each( lndev_pos, &link_node->lndev_list ) {
struct link_node_dev *lndev = list_entry( lndev_pos, struct link_node_dev, list );
-
- q_max = MAX( lndev->rq_sqr.wa_val , q_max) ;
-
- if ( q_max ) {
+
+ if (!lndev->rq_sqr.wa_val)
+ continue;
+
+ if ( !vis_data ) {
+
vis_packet_size += sizeof(struct vis_data);
vis_packet = debugRealloc( vis_packet, vis_packet_size, 105 );
@@ -232,11 +236,21 @@ static void send_vis_packet( void *unused ) {
vis_data = (struct vis_data *)
(vis_packet + vis_packet_size - sizeof(struct vis_data));
+ }
+
+ if (vis_data && lndev->rq_sqr.wa_val > q_max) {
+
vis_data->ip = link_node->orig_node->orig;
-
- vis_data->data = q_max/PROBE_TO100;
+ vis_data->data = lndev->rq_sqr.wa_val/PROBE_TO100;
vis_data->type = DATA_TYPE_NEIGH;
+
+ dbgf_all(DBGT_INFO, "link to NB=%s lq=%d (dev=%s)",
+ ipStr(link_node->orig_node->orig), lndev->rq_sqr.wa_val, lndev->bif->dev);
+
}
+
+ q_max = MAX(lndev->rq_sqr.wa_val, q_max);
+
}
}
@@ -249,17 +263,22 @@ static void send_vis_packet( void *unused ) {
if ( ((struct vis_packet *)vis_packet)->sender_ip == batman_if->if_addr )
continue;
-
+
+ if (!batman_if->if_active)
+ continue;
+
vis_packet_size += sizeof(struct vis_data);
vis_packet = debugRealloc( vis_packet, vis_packet_size, 106 );
-
- vis_data = (struct vis_data *)(vis_packet + vis_packet_size - sizeof(struct vis_data));
+
+ struct vis_data *vis_data = (struct vis_data *) (vis_packet + vis_packet_size - sizeof (struct vis_data));
vis_data->ip = batman_if->if_addr;
vis_data->data = 0;
vis_data->type = DATA_TYPE_SEC_IF;
+
+ dbgf_all(DBGT_INFO, "interface %s (dev=%s)", ipStr(batman_if->if_addr), batman_if->dev);
}
@@ -307,18 +326,18 @@ static void send_vis_packet( void *unused ) {
static int32_t opt_vis ( uint8_t cmd, uint8_t _save, struct opt_type *opt, struct opt_parent *patch, struct ctrl_node *cn ) {
- uint32_t test_ip = 0;
+ uint32_t vis_ip = 0;
if ( cmd == OPT_CHECK || cmd == OPT_APPLY ) {
if ( patch->p_diff == DEL )
- test_ip = 0;
+ vis_ip = 0;
- else if ( str2netw( patch->p_val, &test_ip, '/', cn, NULL, 0 ) == FAILURE )
+ else if ( str2netw( patch->p_val, &vis_ip, '/', cn, NULL, 0 ) == FAILURE )
return FAILURE;
}
- if ( cmd == OPT_APPLY && test_ip ) {
+ if ( cmd == OPT_APPLY && vis_ip ) {
remove_task( send_vis_packet, NULL );
@@ -332,14 +351,14 @@ static int32_t opt_vis ( uint8_t cmd, uint8_t _save, struct opt_type *opt, struc
vis_if->addr.sin_family = AF_INET;
vis_if->addr.sin_port = htons( vis_port );
- vis_if->addr.sin_addr.s_addr = test_ip;
+ vis_if->addr.sin_addr.s_addr = vis_ip;
vis_if->sock = socket( PF_INET, SOCK_DGRAM, 0 );
register_task( 1000, send_vis_packet, NULL );
}
- if ( ( cmd == OPT_APPLY && !test_ip ) || cmd == OPT_UNREGISTER ) {
+ if ( ( cmd == OPT_APPLY && !vis_ip ) || cmd == OPT_UNREGISTER ) {
remove_task( send_vis_packet, NULL );
--
bmx; test conversation
11 years, 6 months
batctl; branch, next, updated. v2010.2.0-82-gb84133d
by postmaster@open-mesh.org
The following commit has been merged in the next branch:
commit 1fe642496403d468251259b829378f1d73116dbe
Author: Linus Lüssing <linus.luessing(a)ascom.ch>
Date: Sun Nov 28 16:17:14 2010 +0100
batctl: Fix bisecting of OGMs with 32bit seqno
This patch increases the size of the seqno variable for bisect and now
uses UINT32_MAX for format checking. To be consistent, also "255"s got
substituted by UINT8_MAX
Signed-off-by: Linus Lüssing <linus.luessing(a)ascom.ch>
diff --git a/bisect.c b/bisect.c
index b7d8969..bdb51a8 100644
--- a/bisect.c
+++ b/bisect.c
@@ -385,7 +385,7 @@ err:
return 0;
}
-static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char *neigh, int seqno, int tq, int ttl)
+static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char *neigh, long long seqno, int tq, int ttl)
{
struct bat_node *orig_node, *neigh_node, *prev_sender_node;
struct orig_event *orig_event;
@@ -406,17 +406,17 @@ static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char
goto err;
}
- if ((seqno < 0) || (seqno > 65535)) {
- fprintf(stderr, "Invalid sequence number found (%i) - skipping", seqno);
+ if ((seqno < 0) || (seqno > UINT32_MAX)) {
+ fprintf(stderr, "Invalid sequence number found (%lli) - skipping", seqno);
goto err;
}
- if ((tq < 0) || (tq > 255)) {
+ if ((tq < 0) || (tq > UINT8_MAX)) {
fprintf(stderr, "Invalid tq value found (%i) - skipping", tq);
goto err;
}
- if ((ttl < 0) || (ttl > 255)) {
+ if ((ttl < 0) || (ttl > UINT8_MAX)) {
fprintf(stderr, "Invalid ttl value found (%i) - skipping", ttl);
goto err;
}
@@ -468,7 +468,8 @@ static int parse_log_file(char *file_path)
FILE *fd;
char line_buff[MAX_LINE], *start_ptr, *start_ptr_safe, *tok_ptr;
char *neigh, *iface_addr, *orig, *prev_sender, rt_flag;
- int line_count = 0, tq, ttl, seqno, i, res, max;
+ int line_count = 0, tq, ttl, i, res, max;
+ long long seqno;
fd = fopen(file_path, "r");
@@ -510,7 +511,7 @@ static int parse_log_file(char *file_path)
prev_sender[strlen(prev_sender) - 1] = 0;
break;
case 16:
- seqno = strtol(tok_ptr, NULL, 10);
+ seqno = strtoll(tok_ptr, NULL, 10);
break;
case 18:
tq = strtol(tok_ptr, NULL, 10);
@@ -602,7 +603,7 @@ static int parse_log_file(char *file_path)
return 1;
}
-static struct rt_hist *get_rt_hist_by_seqno(struct orig_event *orig_event, int seqno)
+static struct rt_hist *get_rt_hist_by_seqno(struct orig_event *orig_event, long long seqno)
{
struct seqno_event *seqno_event;
struct rt_hist *rt_hist = NULL;
@@ -618,7 +619,7 @@ static struct rt_hist *get_rt_hist_by_seqno(struct orig_event *orig_event, int s
return rt_hist;
}
-static struct rt_hist *get_rt_hist_by_node_seqno(struct bat_node *bat_node, struct bat_node *orig_node, int seqno)
+static struct rt_hist *get_rt_hist_by_node_seqno(struct bat_node *bat_node, struct bat_node *orig_node, long long seqno)
{
struct orig_event *orig_event;
struct rt_hist *rt_hist;
@@ -632,7 +633,7 @@ static struct rt_hist *get_rt_hist_by_node_seqno(struct bat_node *bat_node, stru
}
static int print_rt_path_at_seqno(struct bat_node *src_node, struct bat_node *dst_node,
- struct bat_node *next_hop, int seqno, int seqno_rand, int read_opt)
+ struct bat_node *next_hop, long long seqno, long long seqno_rand, int read_opt)
{
struct bat_node *next_hop_tmp;
struct orig_event *orig_event;
@@ -640,10 +641,10 @@ static int print_rt_path_at_seqno(struct bat_node *src_node, struct bat_node *ds
char curr_loop_magic[LOOP_MAGIC_LEN];
memset(curr_loop_magic, 0, LOOP_MAGIC_LEN);
- snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%i%i", src_node->name,
+ snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%lli%lli", src_node->name,
dst_node->name, seqno, seqno_rand);
- printf("Path towards %s (seqno %i ",
+ printf("Path towards %s (seqno %lli ",
get_name_by_macstr(dst_node->name, read_opt), seqno);
printf("via neigh %s):", get_name_by_macstr(next_hop->name, read_opt));
@@ -694,13 +695,14 @@ out:
}
static int find_rt_table_change(struct bat_node *src_node, struct bat_node *dst_node,
- struct bat_node *curr_node, int seqno_min, int seqno_max,
- int seqno_rand, int read_opt)
+ struct bat_node *curr_node, long long seqno_min, long long seqno_max,
+ long long seqno_rand, int read_opt)
{
struct orig_event *orig_event;
struct rt_hist *rt_hist, *rt_hist_tmp;
char curr_loop_magic[LOOP_MAGIC_LEN], loop_check = 0;
- int res, seqno_tmp, seqno_min_tmp = seqno_min;
+ int res;
+ long long seqno_tmp, seqno_min_tmp = seqno_min;
/* printf("%i: curr_node: %s ", bla,
get_name_by_macstr(curr_node->name, read_opt));
@@ -719,7 +721,7 @@ static int find_rt_table_change(struct bat_node *src_node, struct bat_node *dst_
}
memset(curr_loop_magic, 0, LOOP_MAGIC_LEN);
- snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%i%i",
+ snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%lli%lli",
src_node->name, dst_node->name,
seqno_min_tmp, seqno_rand);
@@ -819,13 +821,14 @@ loop:
return -2;
}
-static void loop_detection(char *loop_orig, int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+static void loop_detection(char *loop_orig, long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct bat_node *bat_node;
struct orig_event *orig_event;
struct hash_it_t *hashit = NULL;
struct rt_hist *rt_hist, *prev_rt_hist;
- int last_seqno = -1, seqno_count = 0, res;
+ long long last_seqno = -1, seqno_count = 0;
+ int res;
char check_orig[NAME_LEN];
printf("\nAnalyzing routing tables ");
@@ -839,9 +842,9 @@ static void loop_detection(char *loop_orig, int seqno_min, int seqno_max, char *
if ((seqno_min == -1) && (seqno_max == -1))
printf("[all sequence numbers]");
else if (seqno_min == seqno_max)
- printf("[sequence number: %i]", seqno_min);
+ printf("[sequence number: %lli]", seqno_min);
else
- printf("[sequence number range: %i-%i]", seqno_min, seqno_max);
+ printf("[sequence number range: %lli-%lli]", seqno_min, seqno_max);
if (!compare_name(filter_orig, check_orig))
printf(" [filter originator: %s]",
@@ -915,7 +918,7 @@ static void loop_detection(char *loop_orig, int seqno_min, int seqno_max, char *
(rt_hist->seqno_event->seqno != prev_rt_hist->seqno_event->seqno)) {
if (rt_hist->seqno_event->seqno < prev_rt_hist->seqno_event->seqno) {
fprintf(stderr,
- "Smaller seqno (%i) than previously received seqno (%i) of orig %s triggered routing table change - skipping recursive check\n",
+ "Smaller seqno (%lli) than previously received seqno (%lli) of orig %s triggered routing table change - skipping recursive check\n",
rt_hist->seqno_event->seqno, prev_rt_hist->seqno_event->seqno,
get_name_by_macstr(rt_hist->seqno_event->orig->name, read_opt));
goto validate_path;
@@ -984,7 +987,7 @@ static void seqno_trace_print_neigh(struct seqno_trace_neigh *seqno_trace_neigh,
}
static void seqno_trace_print(struct list_head_first *trace_list, char *trace_orig,
- int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+ long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct seqno_trace *seqno_trace;
char head[MAX_LINE], check_orig[NAME_LEN];
@@ -999,9 +1002,9 @@ static void seqno_trace_print(struct list_head_first *trace_list, char *trace_or
if ((seqno_min == -1) && (seqno_max == -1))
printf("[all sequence numbers]");
else if (seqno_min == seqno_max)
- printf("[sequence number: %i]", seqno_min);
+ printf("[sequence number: %lli]", seqno_min);
else
- printf("[sequence number range: %i-%i]", seqno_min, seqno_max);
+ printf("[sequence number range: %lli-%lli]", seqno_min, seqno_max);
if (!compare_name(filter_orig, check_orig))
printf(" [filter originator: %s]",
@@ -1013,7 +1016,7 @@ static void seqno_trace_print(struct list_head_first *trace_list, char *trace_or
if (!seqno_trace->print)
continue;
- printf("+=> %s (seqno %i)\n",
+ printf("+=> %s (seqno %lli)\n",
get_name_by_macstr(trace_orig, read_opt),
seqno_trace->seqno);
@@ -1251,7 +1254,7 @@ err:
return 0;
}
-static void trace_seqnos(char *trace_orig, int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+static void trace_seqnos(char *trace_orig, long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct bat_node *bat_node;
struct orig_event *orig_event;
@@ -1315,7 +1318,7 @@ out:
return;
}
-static void print_rt_tables(char *rt_orig, int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+static void print_rt_tables(char *rt_orig, long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct bat_node *bat_node;
struct rt_table *rt_table;
@@ -1332,9 +1335,9 @@ static void print_rt_tables(char *rt_orig, int seqno_min, int seqno_max, char *f
if ((seqno_min == -1) && (seqno_max == -1))
printf("[all sequence numbers]");
else if (seqno_min == seqno_max)
- printf("[sequence number: %i]", seqno_min);
+ printf("[sequence number: %lli]", seqno_min);
else
- printf("[sequence number range: %i-%i]", seqno_min, seqno_max);
+ printf("[sequence number range: %lli-%lli]", seqno_min, seqno_max);
if (!compare_name(filter_orig, check_orig))
printf(" [filter originator: %s]",
@@ -1364,7 +1367,7 @@ static void print_rt_tables(char *rt_orig, int seqno_min, int seqno_max, char *f
continue;
if (seqno_event->seqno > -1) {
- printf("rt change triggered by OGM from: %s (tq: %i, ttl: %i, seqno %i",
+ printf("rt change triggered by OGM from: %s (tq: %i, ttl: %i, seqno %lli",
get_name_by_macstr(seqno_event->orig->name, read_opt),
seqno_event->tq, seqno_event->ttl, seqno_event->seqno);
printf(", neigh: %s",
@@ -1443,7 +1446,7 @@ int bisect(int argc, char **argv)
{
int ret = EXIT_FAILURE, res, optchar, found_args = 1;
int read_opt = USE_BAT_HOSTS, num_parsed_files;
- int tmp_seqno, seqno_max = -1, seqno_min = -1;
+ long long tmp_seqno, seqno_max = -1, seqno_min = -1;
char *trace_orig_ptr = NULL, *rt_orig_ptr = NULL, *loop_orig_ptr = NULL;
char orig[NAME_LEN], filter_orig[NAME_LEN], *dash_ptr, *filter_orig_ptr = NULL;
@@ -1477,17 +1480,17 @@ int bisect(int argc, char **argv)
*dash_ptr = 0;
tmp_seqno = strtol(optarg, NULL , 10);
- if ((tmp_seqno >= 0) && (tmp_seqno <= 65535))
+ if ((tmp_seqno >= 0) && (tmp_seqno <= UINT32_MAX))
seqno_min = tmp_seqno;
else
- fprintf(stderr, "Warning - given sequence number is out of range: %i\n", tmp_seqno);
+ fprintf(stderr, "Warning - given sequence number is out of range: %lli\n", tmp_seqno);
if (dash_ptr) {
tmp_seqno = strtol(dash_ptr + 1, NULL , 10);
- if ((tmp_seqno >= 0) && (tmp_seqno <= 65535))
+ if ((tmp_seqno >= 0) && (tmp_seqno <= UINT32_MAX))
seqno_max = tmp_seqno;
else
- fprintf(stderr, "Warning - given sequence number is out of range: %i\n", tmp_seqno);
+ fprintf(stderr, "Warning - given sequence number is out of range: %lli\n", tmp_seqno);
*dash_ptr = '-';
}
@@ -1551,7 +1554,7 @@ int bisect(int argc, char **argv)
seqno_max = seqno_min;
if (seqno_min > seqno_max) {
- printf("Error - the sequence range minimum (%i) should be smaller than the maximum (%i)\n",
+ printf("Error - the sequence range minimum (%lli) should be smaller than the maximum (%lli)\n",
seqno_min, seqno_max);
goto err;
}
diff --git a/bisect.h b/bisect.h
index 70673e8..56cb861 100644
--- a/bisect.h
+++ b/bisect.h
@@ -76,7 +76,7 @@ struct seqno_event {
struct bat_node *orig;
struct bat_node *neigh;
struct bat_node *prev_sender;
- int seqno;
+ long long seqno;
int tq;
int ttl;
struct rt_hist *rt_hist;
@@ -91,7 +91,7 @@ struct seqno_trace_neigh {
struct seqno_trace {
struct list_head list;
- int seqno;
+ long long seqno;
char print;
struct seqno_trace_neigh seqno_trace_neigh;
};
--
batctl
11 years, 7 months
batctl; branch, next, updated. v2010.2.0-82-gb84133d
by postmaster@open-mesh.org
The following commit has been merged in the next branch:
commit 6a9173fdca7b271115c719232b88f86891f6d336
Author: Linus Lüssing <linus.luessing(a)ascom.ch>
Date: Sun Nov 28 16:17:15 2010 +0100
batctl: Fix skipped substitutions of mac addresses with a following ', '
When batctl does not find a matching name for a given mac address in the
bat-hosts file, then it unfortunately removes the following ',' instead
of leaving the string unmodified. batctl bisect is then not able to find
the mac address anymore. This commit fixes this issue.
Signed-off-by: Linus Lüssing <linus.luessing(a)ascom.ch>
diff --git a/functions.c b/functions.c
index ce046ba..9b1e22b 100644
--- a/functions.c
+++ b/functions.c
@@ -201,16 +201,16 @@ read:
/* keep table format */
printf("%17s", bat_host->name);
- if (extra_char != '\0')
- printf("%c", extra_char);
-
- printf(" ");
goto written;
print_plain_buff:
- printf("%s ", buff_ptr);
+ printf("%s", buff_ptr);
written:
+ if (extra_char != '\0')
+ printf("%c", extra_char);
+
+ printf(" ");
buff_ptr = space_ptr + 1;
}
--
batctl
11 years, 7 months
batctl; branch, next, updated. v2010.2.0-82-gb84133d
by postmaster@open-mesh.org
The following commit has been merged in the next branch:
commit b84133dce161872604086bddc3b960da9b2dc04e
Author: Linus Lüssing <linus.luessing(a)ascom.ch>
Date: Sun Nov 28 16:17:16 2010 +0100
batctl: Fix substitution of mac addresses with a following ')'
So far, mac addresses which had a following closing bracket and not a
comma were ignored for the bat-hosts substitutions. This commit allows
the substitution of such mac addresses, too.
Signed-off-by: Linus Lüssing <linus.luessing(a)ascom.ch>
diff --git a/functions.c b/functions.c
index 9b1e22b..52cfe4b 100644
--- a/functions.c
+++ b/functions.c
@@ -177,9 +177,17 @@ read:
*space_ptr = '\0';
extra_char = '\0';
- if ((strlen(buff_ptr) == ETH_STR_LEN + 1) && (buff_ptr[ETH_STR_LEN] == ',')) {
- extra_char = ',';
- buff_ptr[ETH_STR_LEN] = '\0';
+ if (strlen(buff_ptr) == ETH_STR_LEN + 1) {
+ extra_char = buff_ptr[ETH_STR_LEN];
+ switch (extra_char) {
+ case ',':
+ case ')':
+ buff_ptr[ETH_STR_LEN] = '\0';
+ break;
+ default:
+ extra_char = '\0';
+ break;
+ }
}
if (strlen(buff_ptr) != ETH_STR_LEN)
--
batctl
11 years, 7 months
batctl; branch, master, updated. v2010.2.0-77-gebe3e81
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit 89cce17cef76894b391078a8b3a5a80eb59328cb
Author: Linus Lüssing <linus.luessing(a)ascom.ch>
Date: Sun Nov 28 16:17:15 2010 +0100
batctl: Fix skipped substitutions of mac addresses with a following ', '
When batctl does not find a matching name for a given mac address in the
bat-hosts file, then it unfortunately removes the following ',' instead
of leaving the string unmodified. batctl bisect is then not able to find
the mac address anymore. This commit fixes this issue.
Signed-off-by: Linus Lüssing <linus.luessing(a)ascom.ch>
diff --git a/functions.c b/functions.c
index ce046ba..9b1e22b 100644
--- a/functions.c
+++ b/functions.c
@@ -201,16 +201,16 @@ read:
/* keep table format */
printf("%17s", bat_host->name);
- if (extra_char != '\0')
- printf("%c", extra_char);
-
- printf(" ");
goto written;
print_plain_buff:
- printf("%s ", buff_ptr);
+ printf("%s", buff_ptr);
written:
+ if (extra_char != '\0')
+ printf("%c", extra_char);
+
+ printf(" ");
buff_ptr = space_ptr + 1;
}
--
batctl
11 years, 7 months
batctl; branch, master, updated. v2010.2.0-77-gebe3e81
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit ebe3e81baf183ff43aa1717b9b6d037b581ece76
Author: Linus Lüssing <linus.luessing(a)ascom.ch>
Date: Sun Nov 28 16:17:16 2010 +0100
batctl: Fix substitution of mac addresses with a following ')'
So far, mac addresses which had a following closing bracket and not a
comma were ignored for the bat-hosts substitutions. This commit allows
the substitution of such mac addresses, too.
Signed-off-by: Linus Lüssing <linus.luessing(a)ascom.ch>
diff --git a/functions.c b/functions.c
index 9b1e22b..52cfe4b 100644
--- a/functions.c
+++ b/functions.c
@@ -177,9 +177,17 @@ read:
*space_ptr = '\0';
extra_char = '\0';
- if ((strlen(buff_ptr) == ETH_STR_LEN + 1) && (buff_ptr[ETH_STR_LEN] == ',')) {
- extra_char = ',';
- buff_ptr[ETH_STR_LEN] = '\0';
+ if (strlen(buff_ptr) == ETH_STR_LEN + 1) {
+ extra_char = buff_ptr[ETH_STR_LEN];
+ switch (extra_char) {
+ case ',':
+ case ')':
+ buff_ptr[ETH_STR_LEN] = '\0';
+ break;
+ default:
+ extra_char = '\0';
+ break;
+ }
}
if (strlen(buff_ptr) != ETH_STR_LEN)
--
batctl
11 years, 7 months
batctl; branch, master, updated. v2010.2.0-77-gebe3e81
by postmaster@open-mesh.org
The following commit has been merged in the master branch:
commit caf55bc20a4221cee8bdb1ae28b0878df3c932c4
Author: Linus Lüssing <linus.luessing(a)ascom.ch>
Date: Sun Nov 28 16:17:14 2010 +0100
batctl: Fix bisecting of OGMs with 32bit seqno
This patch increases the size of the seqno variable for bisect and now
uses UINT32_MAX for format checking. To be consistent, also "255"s got
substituted by UINT8_MAX
Signed-off-by: Linus Lüssing <linus.luessing(a)ascom.ch>
diff --git a/bisect.c b/bisect.c
index b7d8969..bdb51a8 100644
--- a/bisect.c
+++ b/bisect.c
@@ -385,7 +385,7 @@ err:
return 0;
}
-static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char *neigh, int seqno, int tq, int ttl)
+static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char *neigh, long long seqno, int tq, int ttl)
{
struct bat_node *orig_node, *neigh_node, *prev_sender_node;
struct orig_event *orig_event;
@@ -406,17 +406,17 @@ static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char
goto err;
}
- if ((seqno < 0) || (seqno > 65535)) {
- fprintf(stderr, "Invalid sequence number found (%i) - skipping", seqno);
+ if ((seqno < 0) || (seqno > UINT32_MAX)) {
+ fprintf(stderr, "Invalid sequence number found (%lli) - skipping", seqno);
goto err;
}
- if ((tq < 0) || (tq > 255)) {
+ if ((tq < 0) || (tq > UINT8_MAX)) {
fprintf(stderr, "Invalid tq value found (%i) - skipping", tq);
goto err;
}
- if ((ttl < 0) || (ttl > 255)) {
+ if ((ttl < 0) || (ttl > UINT8_MAX)) {
fprintf(stderr, "Invalid ttl value found (%i) - skipping", ttl);
goto err;
}
@@ -468,7 +468,8 @@ static int parse_log_file(char *file_path)
FILE *fd;
char line_buff[MAX_LINE], *start_ptr, *start_ptr_safe, *tok_ptr;
char *neigh, *iface_addr, *orig, *prev_sender, rt_flag;
- int line_count = 0, tq, ttl, seqno, i, res, max;
+ int line_count = 0, tq, ttl, i, res, max;
+ long long seqno;
fd = fopen(file_path, "r");
@@ -510,7 +511,7 @@ static int parse_log_file(char *file_path)
prev_sender[strlen(prev_sender) - 1] = 0;
break;
case 16:
- seqno = strtol(tok_ptr, NULL, 10);
+ seqno = strtoll(tok_ptr, NULL, 10);
break;
case 18:
tq = strtol(tok_ptr, NULL, 10);
@@ -602,7 +603,7 @@ static int parse_log_file(char *file_path)
return 1;
}
-static struct rt_hist *get_rt_hist_by_seqno(struct orig_event *orig_event, int seqno)
+static struct rt_hist *get_rt_hist_by_seqno(struct orig_event *orig_event, long long seqno)
{
struct seqno_event *seqno_event;
struct rt_hist *rt_hist = NULL;
@@ -618,7 +619,7 @@ static struct rt_hist *get_rt_hist_by_seqno(struct orig_event *orig_event, int s
return rt_hist;
}
-static struct rt_hist *get_rt_hist_by_node_seqno(struct bat_node *bat_node, struct bat_node *orig_node, int seqno)
+static struct rt_hist *get_rt_hist_by_node_seqno(struct bat_node *bat_node, struct bat_node *orig_node, long long seqno)
{
struct orig_event *orig_event;
struct rt_hist *rt_hist;
@@ -632,7 +633,7 @@ static struct rt_hist *get_rt_hist_by_node_seqno(struct bat_node *bat_node, stru
}
static int print_rt_path_at_seqno(struct bat_node *src_node, struct bat_node *dst_node,
- struct bat_node *next_hop, int seqno, int seqno_rand, int read_opt)
+ struct bat_node *next_hop, long long seqno, long long seqno_rand, int read_opt)
{
struct bat_node *next_hop_tmp;
struct orig_event *orig_event;
@@ -640,10 +641,10 @@ static int print_rt_path_at_seqno(struct bat_node *src_node, struct bat_node *ds
char curr_loop_magic[LOOP_MAGIC_LEN];
memset(curr_loop_magic, 0, LOOP_MAGIC_LEN);
- snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%i%i", src_node->name,
+ snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%lli%lli", src_node->name,
dst_node->name, seqno, seqno_rand);
- printf("Path towards %s (seqno %i ",
+ printf("Path towards %s (seqno %lli ",
get_name_by_macstr(dst_node->name, read_opt), seqno);
printf("via neigh %s):", get_name_by_macstr(next_hop->name, read_opt));
@@ -694,13 +695,14 @@ out:
}
static int find_rt_table_change(struct bat_node *src_node, struct bat_node *dst_node,
- struct bat_node *curr_node, int seqno_min, int seqno_max,
- int seqno_rand, int read_opt)
+ struct bat_node *curr_node, long long seqno_min, long long seqno_max,
+ long long seqno_rand, int read_opt)
{
struct orig_event *orig_event;
struct rt_hist *rt_hist, *rt_hist_tmp;
char curr_loop_magic[LOOP_MAGIC_LEN], loop_check = 0;
- int res, seqno_tmp, seqno_min_tmp = seqno_min;
+ int res;
+ long long seqno_tmp, seqno_min_tmp = seqno_min;
/* printf("%i: curr_node: %s ", bla,
get_name_by_macstr(curr_node->name, read_opt));
@@ -719,7 +721,7 @@ static int find_rt_table_change(struct bat_node *src_node, struct bat_node *dst_
}
memset(curr_loop_magic, 0, LOOP_MAGIC_LEN);
- snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%i%i",
+ snprintf(curr_loop_magic, LOOP_MAGIC_LEN, "%s%s%lli%lli",
src_node->name, dst_node->name,
seqno_min_tmp, seqno_rand);
@@ -819,13 +821,14 @@ loop:
return -2;
}
-static void loop_detection(char *loop_orig, int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+static void loop_detection(char *loop_orig, long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct bat_node *bat_node;
struct orig_event *orig_event;
struct hash_it_t *hashit = NULL;
struct rt_hist *rt_hist, *prev_rt_hist;
- int last_seqno = -1, seqno_count = 0, res;
+ long long last_seqno = -1, seqno_count = 0;
+ int res;
char check_orig[NAME_LEN];
printf("\nAnalyzing routing tables ");
@@ -839,9 +842,9 @@ static void loop_detection(char *loop_orig, int seqno_min, int seqno_max, char *
if ((seqno_min == -1) && (seqno_max == -1))
printf("[all sequence numbers]");
else if (seqno_min == seqno_max)
- printf("[sequence number: %i]", seqno_min);
+ printf("[sequence number: %lli]", seqno_min);
else
- printf("[sequence number range: %i-%i]", seqno_min, seqno_max);
+ printf("[sequence number range: %lli-%lli]", seqno_min, seqno_max);
if (!compare_name(filter_orig, check_orig))
printf(" [filter originator: %s]",
@@ -915,7 +918,7 @@ static void loop_detection(char *loop_orig, int seqno_min, int seqno_max, char *
(rt_hist->seqno_event->seqno != prev_rt_hist->seqno_event->seqno)) {
if (rt_hist->seqno_event->seqno < prev_rt_hist->seqno_event->seqno) {
fprintf(stderr,
- "Smaller seqno (%i) than previously received seqno (%i) of orig %s triggered routing table change - skipping recursive check\n",
+ "Smaller seqno (%lli) than previously received seqno (%lli) of orig %s triggered routing table change - skipping recursive check\n",
rt_hist->seqno_event->seqno, prev_rt_hist->seqno_event->seqno,
get_name_by_macstr(rt_hist->seqno_event->orig->name, read_opt));
goto validate_path;
@@ -984,7 +987,7 @@ static void seqno_trace_print_neigh(struct seqno_trace_neigh *seqno_trace_neigh,
}
static void seqno_trace_print(struct list_head_first *trace_list, char *trace_orig,
- int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+ long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct seqno_trace *seqno_trace;
char head[MAX_LINE], check_orig[NAME_LEN];
@@ -999,9 +1002,9 @@ static void seqno_trace_print(struct list_head_first *trace_list, char *trace_or
if ((seqno_min == -1) && (seqno_max == -1))
printf("[all sequence numbers]");
else if (seqno_min == seqno_max)
- printf("[sequence number: %i]", seqno_min);
+ printf("[sequence number: %lli]", seqno_min);
else
- printf("[sequence number range: %i-%i]", seqno_min, seqno_max);
+ printf("[sequence number range: %lli-%lli]", seqno_min, seqno_max);
if (!compare_name(filter_orig, check_orig))
printf(" [filter originator: %s]",
@@ -1013,7 +1016,7 @@ static void seqno_trace_print(struct list_head_first *trace_list, char *trace_or
if (!seqno_trace->print)
continue;
- printf("+=> %s (seqno %i)\n",
+ printf("+=> %s (seqno %lli)\n",
get_name_by_macstr(trace_orig, read_opt),
seqno_trace->seqno);
@@ -1251,7 +1254,7 @@ err:
return 0;
}
-static void trace_seqnos(char *trace_orig, int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+static void trace_seqnos(char *trace_orig, long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct bat_node *bat_node;
struct orig_event *orig_event;
@@ -1315,7 +1318,7 @@ out:
return;
}
-static void print_rt_tables(char *rt_orig, int seqno_min, int seqno_max, char *filter_orig, int read_opt)
+static void print_rt_tables(char *rt_orig, long long seqno_min, long long seqno_max, char *filter_orig, int read_opt)
{
struct bat_node *bat_node;
struct rt_table *rt_table;
@@ -1332,9 +1335,9 @@ static void print_rt_tables(char *rt_orig, int seqno_min, int seqno_max, char *f
if ((seqno_min == -1) && (seqno_max == -1))
printf("[all sequence numbers]");
else if (seqno_min == seqno_max)
- printf("[sequence number: %i]", seqno_min);
+ printf("[sequence number: %lli]", seqno_min);
else
- printf("[sequence number range: %i-%i]", seqno_min, seqno_max);
+ printf("[sequence number range: %lli-%lli]", seqno_min, seqno_max);
if (!compare_name(filter_orig, check_orig))
printf(" [filter originator: %s]",
@@ -1364,7 +1367,7 @@ static void print_rt_tables(char *rt_orig, int seqno_min, int seqno_max, char *f
continue;
if (seqno_event->seqno > -1) {
- printf("rt change triggered by OGM from: %s (tq: %i, ttl: %i, seqno %i",
+ printf("rt change triggered by OGM from: %s (tq: %i, ttl: %i, seqno %lli",
get_name_by_macstr(seqno_event->orig->name, read_opt),
seqno_event->tq, seqno_event->ttl, seqno_event->seqno);
printf(", neigh: %s",
@@ -1443,7 +1446,7 @@ int bisect(int argc, char **argv)
{
int ret = EXIT_FAILURE, res, optchar, found_args = 1;
int read_opt = USE_BAT_HOSTS, num_parsed_files;
- int tmp_seqno, seqno_max = -1, seqno_min = -1;
+ long long tmp_seqno, seqno_max = -1, seqno_min = -1;
char *trace_orig_ptr = NULL, *rt_orig_ptr = NULL, *loop_orig_ptr = NULL;
char orig[NAME_LEN], filter_orig[NAME_LEN], *dash_ptr, *filter_orig_ptr = NULL;
@@ -1477,17 +1480,17 @@ int bisect(int argc, char **argv)
*dash_ptr = 0;
tmp_seqno = strtol(optarg, NULL , 10);
- if ((tmp_seqno >= 0) && (tmp_seqno <= 65535))
+ if ((tmp_seqno >= 0) && (tmp_seqno <= UINT32_MAX))
seqno_min = tmp_seqno;
else
- fprintf(stderr, "Warning - given sequence number is out of range: %i\n", tmp_seqno);
+ fprintf(stderr, "Warning - given sequence number is out of range: %lli\n", tmp_seqno);
if (dash_ptr) {
tmp_seqno = strtol(dash_ptr + 1, NULL , 10);
- if ((tmp_seqno >= 0) && (tmp_seqno <= 65535))
+ if ((tmp_seqno >= 0) && (tmp_seqno <= UINT32_MAX))
seqno_max = tmp_seqno;
else
- fprintf(stderr, "Warning - given sequence number is out of range: %i\n", tmp_seqno);
+ fprintf(stderr, "Warning - given sequence number is out of range: %lli\n", tmp_seqno);
*dash_ptr = '-';
}
@@ -1551,7 +1554,7 @@ int bisect(int argc, char **argv)
seqno_max = seqno_min;
if (seqno_min > seqno_max) {
- printf("Error - the sequence range minimum (%i) should be smaller than the maximum (%i)\n",
+ printf("Error - the sequence range minimum (%lli) should be smaller than the maximum (%lli)\n",
seqno_min, seqno_max);
goto err;
}
diff --git a/bisect.h b/bisect.h
index 70673e8..56cb861 100644
--- a/bisect.h
+++ b/bisect.h
@@ -76,7 +76,7 @@ struct seqno_event {
struct bat_node *orig;
struct bat_node *neigh;
struct bat_node *prev_sender;
- int seqno;
+ long long seqno;
int tq;
int ttl;
struct rt_hist *rt_hist;
@@ -91,7 +91,7 @@ struct seqno_trace_neigh {
struct seqno_trace {
struct list_head list;
- int seqno;
+ long long seqno;
char print;
struct seqno_trace_neigh seqno_trace_neigh;
};
--
batctl
11 years, 7 months
linux integration; annotated tag, v2.6.37-rc3, created. v2.6.37-rc3
by postmaster@open-mesh.org
The annotated tag, v2.6.37-rc3 has been created
at 8a198c8196ac3716e1856978d3e18cca5d800ef3 (tag)
tagging 3561d43fd289f590fdae672e5eb831b8d5cf0bf6 (commit)
replaces v2.6.37-rc2
tagged by Linus Torvalds
on Sun Nov 21 15:19:07 2010 -0800
- Shortlog ------------------------------------------------------------
Linux 2.6.37-rc3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEABECAAYFAkzpqPAACgkQF3YsRnbiHLulnwCeJmOe2Jr7xE1Qzx5vxoHiFVP7
B5YAnRcFFe7CcnlKcw9InHgj4wdJV2AM
=Vx8A
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
11 years, 7 months