Revision 10d807d0 sysdep/unix/sync-if.c

View differences:

sysdep/unix/sync-if.c
1 1
/*
2 2
 *	BIRD -- Unix Interface Scanning and Syncing
3 3
 *
4
 *	(c) 1998 Martin Mares <mj@ucw.cz>
4
 *	(c) 1998--1999 Martin Mares <mj@ucw.cz>
5 5
 *
6 6
 *	Can be freely distributed and used under the terms of the GNU GPL.
7 7
 */
......
174 174
void
175 175
krt_if_start(struct krt_proto *p)
176 176
{
177
  if_scan_timer = tm_new(&root_pool);
177
  struct krt_config *c = (struct krt_config *) p->p.cf;
178

  
179
  if_scan_timer = tm_new(p->p.pool);
178 180
  if_scan_timer->hook = scan_if;
179 181
  if_scan_timer->data = p;
180
  if_scan_timer->recurrent = p->ifopt.scan_time;
182
  if_scan_timer->recurrent = c->ifopt.scan_time;
181 183
  scan_if(if_scan_timer);
182
  tm_start(if_scan_timer, p->ifopt.scan_time);
184
  tm_start(if_scan_timer, c->ifopt.scan_time);
183 185
}
184 186

  
185 187
void
186
krt_if_preconfig(struct krt_proto *p)
188
krt_if_preconfig(struct krt_config *c)
187 189
{
188
  p->ifopt.scan_time = 60;
190
  c->ifopt.scan_time = 60;
189 191
}
190 192

  
191 193
void
192 194
krt_if_shutdown(struct krt_proto *p)
193 195
{
194 196
  tm_stop(if_scan_timer);
195
  rfree(if_scan_timer);
196 197
  /* FIXME: What should we do with interfaces? */
197 198
}
198 199

  

Also available in: Unified diff