On 06/25/17 23:47, Remi Locherer wrote: > Hi, > > ospfd does not react nicely when running "sh /etc/netstart if". > > This is because adding the same address again do an interface results > in RTM_DELADDR and RTM_NEWADDR. ospfd handles the former but the later. > If this happens ospfd says "interface vether0:192.168.250.1 gone". > Adjacencies on that interface are down and ospfd can not recover. > > The below patch adds IMSG_IFADDRADD to deal with that. With it ospfd > logs the following after "ifconfig vether0 192.168.250.1/24" (same address > as active before): >
Hi Remi, thanks for your report and your patch. I think it is the right approach, but unfortunately it doesn't work in my setup. If I run 'sh /etc/netstart vio1' vio1 goes down and stays down. Please have a look to my config / logs. What is the differece between your and my test? Beside that: - I would rename 'struct ifaddrdel' to 'struct ifaddr' and extend it. So we can use it in if_newaddr() and if_deladdr() and avoid 'struct ifaddrnew'. Thanks & Regards friehm Before sh /etc/netstart vio1: ospfctl show int Interface Address State HelloTimer Linkstate Uptime nc ac vio2 10.88.12.1/24 OTHER 00:00:08 active 00:00:30 2 2 vio1 10.88.10.2/24 BCKUP 00:00:01 active 00:00:30 1 1 After (Waiting doesn't fix the problem): Interface Address State HelloTimer Linkstate Uptime nc ac vio2 10.88.12.1/24 OTHER 00:00:06 active 00:24:18 2 2 vio1 10.88.10.2/24 DOWN - active 00:00:00 1 0 ospfd -dv: startup orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: stub net, interface vio2 orig_rtr_lsa: stub net, interface vio1 if_fsm: event UP resulted in action START and changing state for interface vio2 from DOWN to WAIT orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: stub net, interface vio2 orig_rtr_lsa: stub net, interface vio1 if_fsm: event UP resulted in action START and changing state for interface vio1 from DOWN to WAIT spf_calc: area 51.0.0.0 calculated nbr_fsm: event HELLO_RECEIVED resulted in action START_INACTIVITY_TIMER and changing state for neighbor ID 192.168.30.101 from DOWN to INIT nbr_fsm: event 2_WAY_RECEIVED resulted in action EVAL and changing state for neighbor ID 192.168.30.101 from INIT to 2-WAY if_act_elect: interface vio1 old dr none new dr 10.88.10.1, old bdr none new bdr 10.88.10.2 nbr_fsm: event ADJ_OK resulted in action EVAL and changing state for neighbor ID 192.168.30.101 from 2-WAY to EXSTA orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: stub net, interface vio2 orig_rtr_lsa: stub net, interface vio1 orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: stub net, interface vio2 orig_rtr_lsa: stub net, interface vio1 if_fsm: event BACKUPSEEN resulted in action ELECT and changing state for interface vio1 from WAIT to BCKUP if_act_elect: interface vio1 old dr 10.88.10.1 new dr 10.88.10.1, old bdr 10.88.10.2 new bdr 10.88.10.2 if_fsm: event NEIGHBORCHANGE resulted in action ELECT and changing state for interface vio1 from BCKUP to BCKUP nbr_fsm: event NEGOTIATION_DONE resulted in action SNAPSHOT and changing state for neighbor ID 192.168.30.101 from EXSTA to SNAP nbr_fsm: event SNAPSHOT_DONE resulted in action SNAPSHOT_DONE and changing state for neighbor ID 192.168.30.101 from SNAP to EXCHG nbr_fsm: event EXCHANGE_DONE resulted in action EXCHANGE_DONE and changing state for neighbor ID 192.168.30.101 from EXCHG to LOAD orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: stub net, interface vio2 orig_rtr_lsa: transit net, interface vio1 nbr_fsm: event LOADING_DONE resulted in action NOTHING and changing state for neighbor ID 192.168.30.101 from LOAD to FULL spf_calc: area 51.0.0.0 calculated nbr_fsm: event HELLO_RECEIVED resulted in action START_INACTIVITY_TIMER and changing state for neighbor ID 192.168.30.104 from DOWN to INIT nbr_fsm: event 2_WAY_RECEIVED resulted in action EVAL and changing state for neighbor ID 192.168.30.104 from INIT to 2-WAY if_fsm: event NEIGHBORCHANGE resulted in action NOTHING and changing state for interface vio2 from WAIT to WAIT nbr_fsm: event HELLO_RECEIVED resulted in action START_INACTIVITY_TIMER and changing state for neighbor ID 192.168.30.105 from DOWN to INIT nbr_fsm: event 2_WAY_RECEIVED resulted in action EVAL and changing state for neighbor ID 192.168.30.105 from INIT to 2-WAY if_fsm: event NEIGHBORCHANGE resulted in action NOTHING and changing state for interface vio2 from WAIT to WAIT recv_db_description: neighbor ID 192.168.30.105: packet ignored in state 2-WAY recv_db_description: neighbor ID 192.168.30.104: packet ignored in state 2-WAY recv_db_description: neighbor ID 192.168.30.104: packet ignored in state 2-WAY recv_db_description: neighbor ID 192.168.30.105: packet ignored in state 2-WAY if_act_elect: interface vio2 old dr none new dr 10.88.12.3, old bdr none new bdr 10.88.12.2 nbr_fsm: event ADJ_OK resulted in action EVAL and changing state for neighbor ID 192.168.30.105 from 2-WAY to EXSTA nbr_fsm: event ADJ_OK resulted in action EVAL and changing state for neighbor ID 192.168.30.104 from 2-WAY to EXSTA orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: stub net, interface vio2 orig_rtr_lsa: transit net, interface vio1 orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: stub net, interface vio2 orig_rtr_lsa: transit net, interface vio1 if_fsm: event BACKUPSEEN resulted in action ELECT and changing state for interface vio2 from WAIT to OTHER nbr_fsm: event NEGOTIATION_DONE resulted in action SNAPSHOT and changing state for neighbor ID 192.168.30.105 from EXSTA to SNAP nbr_fsm: event SNAPSHOT_DONE resulted in action SNAPSHOT_DONE and changing state for neighbor ID 192.168.30.105 from SNAP to EXCHG nbr_fsm: event EXCHANGE_DONE resulted in action EXCHANGE_DONE and changing state for neighbor ID 192.168.30.105 from EXCHG to LOAD orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: transit net, interface vio2 orig_rtr_lsa: transit net, interface vio1 nbr_fsm: event LOADING_DONE resulted in action NOTHING and changing state for neighbor ID 192.168.30.105 from LOAD to FULL nbr_fsm: event NEGOTIATION_DONE resulted in action SNAPSHOT and changing state for neighbor ID 192.168.30.104 from EXSTA to SNAP nbr_fsm: event SNAPSHOT_DONE resulted in action SNAPSHOT_DONE and changing state for neighbor ID 192.168.30.104 from SNAP to EXCHG nbr_fsm: event EXCHANGE_DONE resulted in action EXCHANGE_DONE and changing state for neighbor ID 192.168.30.104 from EXCHG to LOAD spf_calc: w id 10.88.12.3 type 2 has no link to v id 192.168.30.102 type 1 spf_calc: area 51.0.0.0 calculated orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: transit net, interface vio2 orig_rtr_lsa: transit net, interface vio1 nbr_fsm: event LOADING_DONE resulted in action NOTHING and changing state for neighbor ID 192.168.30.104 from LOAD to FULL spf_calc: area 51.0.0.0 calculated if_fsm: event WAITTIMER resulted in action NOTHING and changing state for interface vio2 from OTHER to OTHER if_fsm: event WAITTIMER resulted in action NOTHING and changing state for interface vio1 from BCKUP to BCKUP if_leave_group: error IP_DROP_MEMBERSHIP, interface vio1 address 224.0.0.5: Can't assign requested address orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: transit net, interface vio2 orig_rtr_lsa: stub net, interface vio1 if_act_elect: interface vio1 old dr 10.88.10.1 new dr 10.88.10.2, old bdr 10.88.10.2 new bdr none orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: transit net, interface vio2 orig_rtr_lsa: stub net, interface vio1 orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: transit net, interface vio2 orig_rtr_lsa: stub net, interface vio1 if_fsm: event NEIGHBORCHANGE resulted in action ELECT and changing state for interface vio1 from BCKUP to DR nbr_fsm: event KILL_NBR resulted in action DELETE and changing state for neighbor ID 192.168.30.101 from FULL to DOWN orig_rtr_lsa: area 51.0.0.0 orig_rtr_lsa: transit net, interface vio2 orig_rtr_lsa: stub net, interface vio1 if_fsm: event DOWN resulted in action RESET and changing state for interface vio1 from BCKUP to DOWN interface vio1:10.88.10.2 gone if_join_group: error IP_ADD_MEMBERSHIP, interface vio1 address 224.0.0.5: Address already in use if_fsm: error changing state for interface vio1, event UP, state DOWN interface vio1:10.88.10.2 returned nbr_fsm: event HELLO_RECEIVED resulted in action START_INACTIVITY_TIMER and changing state for neighbor ID 192.168.30.101 from DOWN to INIT nbr_fsm: event 2_WAY_RECEIVED resulted in action EVAL and changing state for neighbor ID 192.168.30.101 from INIT to 2-WAY if_fsm: event NEIGHBORCHANGE resulted in action NOTHING and changing state for interface vio1 from DOWN to DOWN spf_calc: area 51.0.0.0 calculated if_fsm: event NEIGHBORCHANGE resulted in action NOTHING and changing state for interface vio1 from DOWN to DOWN nbr_fsm: event 1_WAY_RECEIVED resulted in action CLEAR_LISTS and changing state for neighbor ID 192.168.30.101 from 2-WAY to INIT orig_rtr_lsa: area 51.0.0.0 My config: hostname.vio1: inet 10.88.10.2 255.255.255.0 inet6 fd88:10::2 64 hostname.vio2: inet 10.88.12.1 255.255.255.0 inet6 fd88:12::1 64 ospfd.conf: router-id 192.168.30.102 fib-update yes stub router no area 51.0.0.0 { interface vio1 { } interface vio2 { } }