diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-06-09 12:11:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-09 12:11:38 +0100 |
commit | 34b07a49c052631e58401fd06c218701ad36d0ce (patch) | |
tree | 01208307f9d9a90f6e476ced35a7315ec5841fb4 /src/migration-scripts | |
parent | 6c8054a9ad223de9aba3646ef8a041c1f8f16839 (diff) | |
parent | 08421b277b1f460ebc51673571bab975aece2215 (diff) | |
download | vyos-1x-34b07a49c052631e58401fd06c218701ad36d0ce.tar.gz vyos-1x-34b07a49c052631e58401fd06c218701ad36d0ce.zip |
Merge pull request #4548 from c-po/T7202-conntrack
conntrack: T7208: nf_conntrack_buckets defaults and behavior
Diffstat (limited to 'src/migration-scripts')
-rw-r--r-- | src/migration-scripts/conntrack/5-to-6 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/migration-scripts/conntrack/5-to-6 b/src/migration-scripts/conntrack/5-to-6 new file mode 100644 index 000000000..1db2e78b4 --- /dev/null +++ b/src/migration-scripts/conntrack/5-to-6 @@ -0,0 +1,30 @@ +# Copyright 2025 VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# T7202: fix lower limit of supported conntrack hash-size to match Kernel +# lower limit. + +from vyos.configtree import ConfigTree + +base = ['system', 'conntrack'] +def migrate(config: ConfigTree) -> None: + if not config.exists(base): + # Nothing to do + return + + if config.exists(base + ['hash-size']): + tmp = config.return_value(base + ['hash-size']) + if int(tmp) < 1024: + config.set(base + ['hash-size'], value=1024) |