Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:Update
resource-agents.34044
0001-Azure-lb-fails-if-IPv6-disabled.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Azure-lb-fails-if-IPv6-disabled.patch of Package resource-agents.34044
From ff657a8f4e5c59b559ac15036332140a32598e0c Mon Sep 17 00:00:00 2001 From: Peter Varkoly <varkoly@suse.com> Date: Tue, 30 Apr 2024 19:21:09 +0200 Subject: [PATCH] Azure-lb fails if IPv6 disabled Add a new parameter: listen This parameter can have following walues: default: Neither -4 nor -6 will be used. The default behavior of socat and nc will be used. socat: Listen only on IPv4 addresses nc: If net.ipv6.bindv6only = 0 => Listen on both IPv4 and IP6 addresses If net.ipv6.bindv6only = 1 => Listen only on IPv4 addresses ipv4only: Listen only on IPv4 addresses. ipv6enable: Enable TCP6 support. nc: Listen only on IPv6 adresses independent of net.ipv6.bindv6only socat: If net.ipv6.bindv6only = 0 => Listen on both IPv4 and IP6 addresses. If net.ipv6.bindv6only = 1 => Listen only on IPv6 adresses. diff --git a/heartbeat/azure-lb b/heartbeat/azure-lb index 198e71c5..64225264 100755 --- a/heartbeat/azure-lb +++ b/heartbeat/azure-lb @@ -24,9 +24,13 @@ else fi OCF_RESKEY_port_default="61000" +OCF_RESKEY_listen_default="default" + +[ "$(cat /sys/module/ipv6/parameters/disable)" = "1" ] && OCF_RESKEY_listen_default="ipv4only" : ${OCF_RESKEY_nc=${OCF_RESKEY_nc_default}} : ${OCF_RESKEY_port=${OCF_RESKEY_port_default}} +: ${OCF_RESKEY_listen=${OCF_RESKEY_listen_default}} process="$OCF_RESOURCE_INSTANCE" pidfile="/var/run/$OCF_RESOURCE_INSTANCE.pid" @@ -73,6 +77,25 @@ Port to listen to. <content type="string" default="${OCF_RESKEY_port_default}"/> </parameter> +<parameter name="listen"> +<longdesc lang="en"> +This parameter can have following walues: +default: Neither -4 nor -6 will be used. The default behavior of socat and nc will be used. + socat: Listen only on IPv4 addresses + nc: If net.ipv6.bindv6only = 0 => Listen on both IPv4 and IP6 addresses + If net.ipv6.bindv6only = 1 => Listen only on IPv4 addresses +ipv4only: Listen only on IPv4 addresses. +ipv6enable: Enable TCP6 support. + nc: Listen only on IPv6 adresses independent of net.ipv6.bindv6only + socat: If net.ipv6.bindv6only = 0 => Listen on both IPv4 and IP6 addresses. + If net.ipv6.bindv6only = 1 => Listen only on IPv6 adresses. +</longdesc> +<shortdesc lang="en">Usage of IPv4 and IPv6 addresses.</shortdesc> +<content type="string" default="${OCF_RESKEY_listen_default}"/> +</parameter> + + + </parameters> <actions> @@ -111,10 +134,24 @@ lb_monitor() { } lb_start() { - cmd="$OCF_RESKEY_nc -l -k $OCF_RESKEY_port" - if [ $( basename $OCF_RESKEY_nc ) = 'socat' ]; then - #socat has different parameters - cmd="$OCF_RESKEY_nc -U TCP6-LISTEN:$OCF_RESKEY_port,backlog=10,fork,reuseaddr /dev/null" + if [ "$( basename $OCF_RESKEY_nc )" = 'socat' ]; then + case "${OCF_RESKEY_listen,,}" in + ipv4only) + cmd="$OCF_RESKEY_nc -4 -U TCP4-LISTEN:$OCF_RESKEY_port,backlog=10,fork,reuseaddr /dev/null" ;; + ipv6enable) + cmd="$OCF_RESKEY_nc -U TCP6-LISTEN:$OCF_RESKEY_port,backlog=10,fork,reuseaddr /dev/null" ;; + *) + cmd="$OCF_RESKEY_nc -U TCP-LISTEN:$OCF_RESKEY_port,backlog=10,fork,reuseaddr /dev/null" ;; + esac + else + case "${OCF_RESKEY_listen,,}" in + ipv4only) + cmd="$OCF_RESKEY_nc -4 -l -k $OCF_RESKEY_port" ;; + ipv6enable) + cmd="$OCF_RESKEY_nc -6 -l -k $OCF_RESKEY_port" ;; + *) + cmd="$OCF_RESKEY_nc -l -k $OCF_RESKEY_port" ;; + esac fi if ! lb_monitor; then ocf_log debug "Starting $process: $cmd" -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor