Skip to content

Commit

Permalink
mxrouter: Create interfaces before applying settings
Browse files Browse the repository at this point in the history
Interface-specific settings (ipv4_send_redirects, ipv4_rp_filter,
ipv6_accept_ra) were applied to early, when new vlan interfaces
not yet existed.

Change order of code blocks.
  • Loading branch information
donald committed Mar 12, 2018
1 parent 5a1d993 commit 0b2b426
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions mxrouter/mxrouterctl
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,17 @@ sub start {
set_ipv4_routing(1);
}

stop_process_if($process_ulogd);
stop_process_if($process_dhcrelay);
stop_process_if($process_radvd);
unconfigure_route($del_route);
unconfigure_ip($del_addr);
unconfigure_vlans($del_vlan,{});

configure_vlans($new_vlan,{});
configure_ip($new_addr);
configure_route($new_route);

for my $dev ('all','default',network_devices()) {
if (get_ipv4_send_redirects($dev)>0) {
warn "disable IPV4 send redirects on $dev\n" unless $opt_quiet;
Expand All @@ -502,16 +513,6 @@ sub start {
}
}

stop_process_if($process_ulogd);
stop_process_if($process_dhcrelay);
stop_process_if($process_radvd);
unconfigure_route($del_route);
unconfigure_ip($del_addr);
unconfigure_vlans($del_vlan,{});

configure_vlans($new_vlan,{});
configure_ip($new_addr);
configure_route($new_route);
start_process_if($process_ulogd);
start_process_if($process_dhcrelay);
start_process_if($process_radvd);
Expand Down

0 comments on commit 0b2b426

Please sign in to comment.