diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2015-07-20 23:45:40 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2015-07-20 23:45:40 +0000 |
commit | 6b8aadbd6449454477a1492e79acfdfface84215 (patch) | |
tree | 3491442bd6fca25fcb68b33eedf457bb7a85b241 /usr.sbin/ospfd/kroute.c | |
parent | 14071a0c75a36d39e8d34aa808b9aa4c3bc6d02f (diff) |
Fix a segfault at startup when if_change() ist called before
imsg_init() exposed by the second part of this diff which makes
carp(4) interfaces be recognized to be in "backup" mode on start-up.
Problem analyzed and fix provided by Johan Ymerson, thanks!
ok claudio@, mpi@
Diffstat (limited to 'usr.sbin/ospfd/kroute.c')
-rw-r--r-- | usr.sbin/ospfd/kroute.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c index a200d994206..101d6ca53c3 100644 --- a/usr.sbin/ospfd/kroute.c +++ b/usr.sbin/ospfd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.101 2015/07/19 01:59:32 benno Exp $ */ +/* $OpenBSD: kroute.c,v 1.102 2015/07/20 23:45:39 benno Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -1019,6 +1019,9 @@ if_change(u_short ifindex, int flags, struct if_data *ifd, return; } + /* notify ospfe about interface link state */ + main_imsg_compose_ospfe(IMSG_IFINFO, 0, kif, sizeof(struct kif)); + reachable = (kif->flags & IFF_UP) && LINK_STATE_IS_UP(kif->link_state); @@ -1027,9 +1030,6 @@ if_change(u_short ifindex, int flags, struct if_data *ifd, kif->nh_reachable = reachable; - /* notify ospfe about interface link state */ - main_imsg_compose_ospfe(IMSG_IFINFO, 0, kif, sizeof(struct kif)); - /* update redistribute list */ RB_FOREACH(kr, kroute_tree, &krt) { for (tkr = kr; tkr != NULL; tkr = tkr->next) { |