aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parse-events.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/parse-events.c b/parse-events.c
index fe683c9..df6ad6e 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -463,6 +463,26 @@ static enum event_type get_type(int ch)
463 return EVENT_OP; 463 return EVENT_OP;
464} 464}
465 465
466static void __push_char(char c)
467{
468 if (input_buf_ptr <= 0)
469 die("too much pushback");
470 input_buf[--input_buf_ptr] = c;
471}
472
473static void __push_str(char *s)
474{
475 char *e = s;
476
477 while (*e++)
478 /* nothing */;
479 e--;
480 while (s != e) {
481 e--;
482 __push_char(*e);
483 }
484}
485
466static int __read_char(void) 486static int __read_char(void)
467{ 487{
468 if (input_buf_ptr >= input_buf_siz) 488 if (input_buf_ptr >= input_buf_siz)
@@ -622,6 +642,33 @@ static enum event_type __read_token(char **tok)
622 if (!*tok) 642 if (!*tok)
623 return EVENT_NONE; 643 return EVENT_NONE;
624 644
645 if (type == EVENT_ITEM) {
646 /*
647 * Older versions of the kernel has a bug that
648 * creates invalid symbols and will break the mac80211
649 * parsing. This is a work around to that bug.
650 *
651 * See Linux kernel commit:
652 * 811cb50baf63461ce0bdb234927046131fc7fa8b
653 */
654 if (strcmp(*tok, "LOCAL_PR_FMT") == 0) {
655 free(*tok);
656 *tok = NULL;
657 __push_str("\"\%s\" ");
658 return __read_token(tok);
659 } else if (strcmp(*tok, "STA_PR_FMT") == 0) {
660 free(*tok);
661 *tok = NULL;
662 __push_str("\" sta:%pM\" ");
663 return __read_token(tok);
664 } else if (strcmp(*tok, "VIF_PR_FMT") == 0) {
665 free(*tok);
666 *tok = NULL;
667 __push_str("\" vif:%p(%d)\" ");
668 return __read_token(tok);
669 }
670 }
671
625 return type; 672 return type;
626} 673}
627 674
@@ -2015,7 +2062,7 @@ static int event_read_print(struct event *event)
2015 if (type == EVENT_NONE) 2062 if (type == EVENT_NONE)
2016 return 0; 2063 return 0;
2017 2064
2018 /* Handle concatination of print lines */ 2065 /* Handle concatenation of print lines */
2019 if (type == EVENT_DQUOTE) { 2066 if (type == EVENT_DQUOTE) {
2020 char *cat; 2067 char *cat;
2021 2068