Commit bac2cd6
committed
server: null-check public IP before the DNS/Source NAT guard in createPublicLoadBalancerRule
createPublicLoadBalancerRule resolved ipVO only when an ipAddrId was supplied,
then at the port-53 check did (srcPortStart == DNS_PORT && ipVO.isSourceNat()).
For an elastic-LB rule created without an explicit IP (ipAddrId == null) the
system IP is allocated later, so ipVO was still null and creating a rule on
port 53 threw a NullPointerException. The ipVO == null validation only runs
further down.
Guard the check with ipVO != null so the DNS/Source NAT conflict test is
skipped when there is no IP yet; the flow then reaches the existing
can't-find-source-IP parameter error.
Adds a regression test creating a port-53 rule with a null ipAddrId
(NullPointerException before the fix).1 parent 3a79799 commit bac2cd6
2 files changed
Lines changed: 37 additions & 1 deletion
File tree
- server/src
- main/java/com/cloud/network/lb
- test/java/com/cloud/network/lb
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1706 | 1706 | | |
1707 | 1707 | | |
1708 | 1708 | | |
1709 | | - | |
| 1709 | + | |
1710 | 1710 | | |
1711 | 1711 | | |
1712 | 1712 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
51 | 72 | | |
52 | 73 | | |
53 | 74 | | |
| |||
101 | 122 | | |
102 | 123 | | |
103 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
104 | 140 | | |
0 commit comments