net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directive

オープン 初心者向け
#5,973 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

os-haproxy プラグインのコードで、実サーバーの「Source address」フィールドを検証し、HAProxy のサーバーディレクティブを生成する箇所から始めます。issue では具体的なファイルが指定されていないため、このフィールドと source ディレクティブを検索してください。IPv6 リテラルがどのように認識されるか、生成される値が角括弧で囲まれるかを確認します。IPv6 のソースアドレスが検証を通過し、HAProxy 用の角括弧付き形式で出力され、設定テストが成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

incomplete

Describe the bug

Setting an IPv6 address in the "Source address" field of a real server produces a source directive that HAProxy rejects, so the configuration test fails and the service cannot be reloaded.

The plugin writes the address expanded and without brackets. HAProxy treats everything after the last colon as the port.

To Reproduce

  1. Services → HAProxy → Real Servers: create a server with an IPv6 address (e.g. fd00:445d:0:4f::eb1, port 443).
  2. Enable advanced mode and set "Source address" to fd00:445d:0:4f::fe.
  3. Add the server to a backend pool and run the config test.

Generated line:

server hu-web1_HTTPS6 fd00:445d:0:4f::eb1:443 source fd00:445d:0000:004f:0000:0000:0000:00fe send-proxy-v2 check-send-proxy

Result:

[ALERT] config : [/usr/local/etc/haproxy.conf.staging:453] : 'server wp.hmu.com.ar_HTTPS/hu-web1_HTTPS6' : 'source fd00:445d:0000:004f:0000:0000:0000:00fe' : invalid character 'f' in port number '00fe' in 'fd00:445d:0000:004f:0000:0000:0000:00fe'.
[ALERT] config : Fatal errors found in configuration.

Entering the address with brackets ([fd00:445d:0:4f::fe]) is rejected by the form validation ("Please specify a valid source address, i.e. 10.0.0.1 or loadbalancer.example.com:50000…").

image

Expected behavior

An IPv6 source address should be written in bracketed form, which HAProxy accepts:

source [fd00:445d:0:4f::fe]

Either the template could add the brackets for IPv6 literals, or the field validation could accept bracketed input.

Workaround

Leave "Source address" empty and put source [fd00:445d:0:4f::fe] in the server's "Option pass-through" field. The config test passes with that.

Environment

  • OPNsense 26.7.8_2-amd64
  • os-haproxy 5.1
  • HAProxy 3.2.26-3e0f11a
主要言語
PHP
スター
1.2k
フォーク
926
平均マージ
1日 10時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opnsense/plugins のほかの issue

opnsense/plugins の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。