Revision cf98be7b nest/proto.c

View differences:

nest/proto.c
414 414
      p->main_ahook->out_filter = nc->out_filter;
415 415
      p->main_ahook->in_limit = nc->in_limit;
416 416
      p->main_ahook->out_limit = nc->out_limit;
417
      p->main_ahook->in_keep_rejected = nc->in_keep_rejected;
417 418
    }
418 419

  
419 420
  /* Update routes when filters changed. If the protocol in not UP,
......
719 720
{
720 721
  DBG("Protocol %s down\n", p->name);
721 722

  
722
  if (p->stats.imp_routes != 0)
723
    log(L_ERR "Protocol %s is down but still has %d routes", p->name, p->stats.imp_routes);
723
  u32 all_routes = p->stats.imp_routes + p->stats.rej_routes;
724
  if (all_routes != 0)
725
    log(L_ERR "Protocol %s is down but still has %d routes", p->name, all_routes);
724 726

  
725 727
  bzero(&p->stats, sizeof(struct proto_stats));
726 728
  proto_free_ahooks(p);
......
796 798
      p->main_ahook->out_filter = p->cf->out_filter;
797 799
      p->main_ahook->in_limit = p->cf->in_limit;
798 800
      p->main_ahook->out_limit = p->cf->out_limit;
801
      p->main_ahook->in_keep_rejected = p->cf->in_keep_rejected;
799 802
      proto_reset_limit(p->main_ahook->in_limit);
800 803
      proto_reset_limit(p->main_ahook->out_limit);
801 804
    }
......
1093 1096
}
1094 1097

  
1095 1098
static void
1096
proto_show_stats(struct proto_stats *s)
1099
proto_show_stats(struct proto_stats *s, int in_keep_rejected)
1097 1100
{
1098
  cli_msg(-1006, "  Routes:         %u imported, %u exported, %u preferred", 
1099
	  s->imp_routes, s->exp_routes, s->pref_routes);
1101
  if (in_keep_rejected)
1102
    cli_msg(-1006, "  Routes:         %u imported, %u rejected, %u exported, %u preferred", 
1103
	    s->imp_routes, s->rej_routes, s->exp_routes, s->pref_routes);
1104
  else
1105
    cli_msg(-1006, "  Routes:         %u imported, %u exported, %u preferred", 
1106
	    s->imp_routes, s->exp_routes, s->pref_routes);
1107

  
1100 1108
  cli_msg(-1006, "  Route change stats:     received   rejected   filtered    ignored   accepted");
1101 1109
  cli_msg(-1006, "    Import updates:     %10u %10u %10u %10u %10u",
1102 1110
	  s->imp_updates_received, s->imp_updates_invalid,
......
1134 1142
  proto_show_limit(p->cf->out_limit, "Export limit:");
1135 1143

  
1136 1144
  if (p->proto_state != PS_DOWN)
1137
    proto_show_stats(&p->stats);
1145
    proto_show_stats(&p->stats, p->cf->in_keep_rejected);
1138 1146
}
1139 1147

  
1140 1148
void

Also available in: Unified diff