Revision f4a60a9b proto/rip/rip.c

View differences:

proto/rip/rip.c
143 143
  if (rt)
144 144
  {
145 145
    /* Update */
146
    net *n = net_get(p->p.table, en->n.addr);
146
    net *n = net_get(p->p.main_channel->table, en->n.addr);
147 147

  
148 148
    rta a0 = {
149 149
      .src = p->p.main_source,
......
212 212
  else
213 213
  {
214 214
    /* Withdraw */
215
    net *n = net_find(p->p.table, en->n.addr);
215
    net *n = net_find(p->p.main_channel->table, en->n.addr);
216 216
    rte_update(&p->p, n, NULL);
217 217
  }
218 218
}
......
1027 1027
  return 0;
1028 1028
}
1029 1029

  
1030
static int
1031
rip_reload_routes(struct proto *P)
1030
static void
1031
rip_reload_routes(struct channel *C)
1032 1032
{
1033
  struct rip_proto *p = (struct rip_proto *) P;
1033
  struct rip_proto *p = (struct rip_proto *) C->proto;
1034 1034

  
1035 1035
  if (p->rt_reload)
1036
    return 1;
1036
    return;
1037 1037

  
1038 1038
  TRACE(D_EVENTS, "Scheduling route reload");
1039 1039
  p->rt_reload = 1;
1040 1040
  rip_kick_timer(p);
1041

  
1042
  return 1;
1043 1041
}
1044 1042

  
1045 1043
static struct ea_list *
......
1070 1068
}
1071 1069

  
1072 1070

  
1071
static void
1072
rip_postconfig(struct proto_config *CF)
1073
{
1074
  // struct rip_config *cf = (void *) CF;
1075

  
1076
  /* Define default channel */
1077
  if (EMPTY_LIST(CF->channels))
1078
    channel_config_new(NULL, CF->net_type, CF);
1079
}
1080

  
1073 1081
static struct proto *
1074
rip_init(struct proto_config *cfg)
1082
rip_init(struct proto_config *CF)
1075 1083
{
1076
  struct proto *P = proto_new(cfg, sizeof(struct rip_proto));
1084
  struct proto *P = proto_new(CF);
1085

  
1086
  P->main_channel = proto_add_channel(P, proto_cf_main_channel(CF));
1077 1087

  
1078
  P->accept_ra_types = RA_OPTIMAL;
1079 1088
  P->if_notify = rip_if_notify;
1080 1089
  P->rt_notify = rip_rt_notify;
1081 1090
  P->neigh_notify = rip_neigh_notify;
......
1115 1124
}
1116 1125

  
1117 1126
static int
1118
rip_reconfigure(struct proto *P, struct proto_config *c)
1127
rip_reconfigure(struct proto *P, struct proto_config *CF)
1119 1128
{
1120 1129
  struct rip_proto *p = (void *) P;
1121
  struct rip_config *new = (void *) c;
1130
  struct rip_config *new = (void *) CF;
1122 1131
  // struct rip_config *old = (void *) (P->cf);
1123 1132

  
1124 1133
  if (new->rip2 != p->rip2)
......
1127 1136
  if (new->infinity != p->infinity)
1128 1137
    return 0;
1129 1138

  
1139
  if (!proto_configure_channel(P, &P->main_channel, proto_cf_main_channel(CF)))
1140
    return 0;
1141

  
1130 1142
  TRACE(D_EVENTS, "Reconfiguring");
1131 1143

  
1132
  p->p.cf = c;
1144
  p->p.cf = CF;
1133 1145
  p->ecmp = new->ecmp;
1134 1146
  rip_reconfigure_ifaces(p, new);
1135 1147

  
......
1270 1282
  .template =		"rip%d",
1271 1283
  .attr_class =		EAP_RIP,
1272 1284
  .preference =		DEF_PREF_RIP,
1285
  .channel_mask =	NB_IP,
1286
  .proto_size =		sizeof(struct rip_proto),
1273 1287
  .config_size =	sizeof(struct rip_config),
1288
  .postconfig =		rip_postconfig,
1274 1289
  .init =		rip_init,
1275 1290
  .dump =		rip_dump,
1276 1291
  .start =		rip_start,

Also available in: Unified diff