Revision 9a158361 proto/ospf/ospf.c
proto/ospf/ospf.c | ||
---|---|---|
155 | 155 |
{ |
156 | 156 |
debug(" OSPF: Changing state into DR.\n"); |
157 | 157 |
ifa->state=OSPF_IS_DR; |
158 |
ifa->drip=ifa->iface->ip; |
|
158 |
ifa->drip=ifa->iface->addr->ip;
|
|
159 | 159 |
/* FIXME: Set ifa->drid */ |
160 | 160 |
} |
161 | 161 |
else |
... | ... | |
221 | 221 |
} |
222 | 222 |
|
223 | 223 |
void |
224 |
ospf_if_notify(struct proto *p, unsigned flags, struct iface *new, struct iface *old)
|
|
224 |
ospf_if_notify(struct proto *p, unsigned flags, struct iface *iface)
|
|
225 | 225 |
{ |
226 | 226 |
struct ospf_iface *ifa; |
227 | 227 |
sock *mcsk, *newsk; |
... | ... | |
231 | 231 |
c=(struct ospf_config *)(p->cf); |
232 | 232 |
|
233 | 233 |
DBG(" OSPF: If notify called\n"); |
234 |
if (iface->flags & IF_IGNORE) |
|
235 |
return; |
|
234 | 236 |
|
235 |
if((flags & IF_CHANGE_UP) && is_good_iface(p, new))
|
|
237 |
if((flags & IF_CHANGE_UP) && is_good_iface(p, iface))
|
|
236 | 238 |
{ |
237 |
debug(" OSPF: using interface %s.\n", new->name);
|
|
239 |
debug(" OSPF: using interface %s.\n", iface->name);
|
|
238 | 240 |
/* FIXME: Latter I'll use config - this is incorrect */ |
239 | 241 |
ifa=mb_alloc(p->pool, sizeof(struct ospf_iface)); |
240 |
ifa->iface=new;
|
|
242 |
ifa->iface=iface;
|
|
241 | 243 |
add_tail(&((struct proto_ospf *)p)->iface_list, NODE ifa); |
242 | 244 |
ospf_iface_default(ifa); |
243 | 245 |
/* FIXME: This should read config */ |
... | ... | |
253 | 255 |
|
254 | 256 |
if(flags & IF_CHANGE_DOWN) |
255 | 257 |
{ |
256 |
if((ifa=find_iface((struct proto_ospf *)p, old))!=NULL)
|
|
258 |
if((ifa=find_iface((struct proto_ospf *)p, iface))!=NULL)
|
|
257 | 259 |
{ |
258 |
debug(" OSPF: killing interface %s.\n", old->name);
|
|
260 |
debug(" OSPF: killing interface %s.\n", iface->name);
|
|
259 | 261 |
} |
260 | 262 |
} |
261 | 263 |
|
262 | 264 |
if(flags & IF_CHANGE_MTU) |
263 | 265 |
{ |
264 |
if((ifa=find_iface((struct proto_ospf *)p, old))!=NULL)
|
|
266 |
if((ifa=find_iface((struct proto_ospf *)p, iface))!=NULL)
|
|
265 | 267 |
{ |
266 |
debug(" OSPF: changing MTU on interface %s.\n", old->name);
|
|
268 |
debug(" OSPF: changing MTU on interface %s.\n", iface->name);
|
|
267 | 269 |
} |
268 | 270 |
} |
269 | 271 |
} |
... | ... | |
321 | 323 |
start: ospf_start, |
322 | 324 |
preconfig: ospf_preconfig, |
323 | 325 |
postconfig: ospf_postconfig, |
324 |
|
|
325 | 326 |
}; |
326 |
|
Also available in: Unified diff