Commit 9b00a97
committed
fix: reorder struct fields to ensure proper cleanup order
Rust drops struct fields in declaration order (top to bottom). Reordered
LinuxJail fields so cleanup happens in reverse order of creation:
1. DNS server stopped (explicit in Drop::drop)
2. netns_resolv cleaned (unmount bind-mount, remove /etc/netns dir)
3. nftables cleaned (remove firewall rules)
4. veth_pair cleaned (delete veth pair)
5. namespace cleaned (delete network namespace)
This ensures the bind-mount unmount happens BEFORE the namespace is deleted,
making cleanup more robust and predictable.
All 23 tests pass on ml-1 ✓1 parent e06724b commit 9b00a97
1 file changed
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
| |||
602 | 609 | | |
603 | 610 | | |
604 | 611 | | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
609 | 616 | | |
610 | 617 | | |
611 | 618 | | |
| |||
0 commit comments