Projet

Général

Profil

« Précédent | Suivant » 

Révision be32a003

Ajouté par Renato Botelho il y a plus de 9 ans

Delete IP Alias on CARP VIP interface on secondary node when it's deleted on primary. It fixes #3855

Voir les différences:

usr/local/www/xmlrpc.php
203 203
				if ($vip['mode'] == "carp")
204 204
					$oldvips["{$vip['interface']}_vip{$vip['vhid']}"] = "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}";
205 205
				else if ($vip['mode'] == "ipalias" && (strstr($vip['interface'], "_vip") || strstr($vip['interface'], "lo0")))
206
					$oldvips[$vip['subnet']] = "{$vip['interface']}{$vip['subnet']}{$vip['subnet_bits']}";
206
					$oldvips[$vip['subnet']] = $vip;
207 207
				else if (($vip['mode'] == "ipalias" || $vip['mode'] == 'proxyarp') && !(strstr($vip['interface'], "_vip") || strstr($vip['interface'], "lo0")))
208 208
					$vipbackup[] = $vip;
209 209
			}
......
244 244
				}
245 245
				unset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"]);
246 246
			} else if ($vip['mode'] == "ipalias" && strstr($vip['interface'], "_vip") && isset($oldvips[$vip['subnet']])) {
247
				if ($oldvips[$vip['subnet']] == "{$vip['interface']}{$vip['subnet']}{$vip['subnet_bits']}") {
248
					if (does_vip_exist($vip)) {
247
				if ($oldvips[$vip['subnet']]['interface'] == $vip['interface'] &&
248
				    $oldvips[$vip['subnet']]['subnet'] == $vip['subnet'] &&
249
				    $oldvips[$vip['subnet']]['subnet_bits'] == $vip['subnet_bits'] &&
250
				    does_vip_exist($vip)) {
249 251
						unset($oldvips[$vip['subnet']]);
250 252
						continue; // Skip reconfiguring this vips since nothing has changed.
251
					}
252 253
				}
253 254
				unset($oldvips[$vip['subnet']]);
254 255
			}
......
267 268
				break;
268 269
			}
269 270
		}
270
		/* Cleanup remaining old carps */
271
		/* Cleanup remaining old carps and ipalias */
271 272
		foreach ($oldvips as $oldvipif => $oldvippar) {
272
			if (!is_ipaddr($oldvipif) && does_interface_exist($oldvipif))
273
					pfSense_interface_destroy($oldvipif);
273
			if (is_ipaddr($oldvipif))
274
				interface_vip_bring_down($oldvippar);
275
			else if (does_interface_exist($oldvipif))
276
				pfSense_interface_destroy($oldvipif);
274 277
		}
275 278
		if ($carp_setuped == true)
276 279
			interfaces_carp_setup();

Formats disponibles : Unified diff