Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option 82 + 83 #65

Merged
merged 10 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions .github/workflows/build-release-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,75 +55,6 @@ jobs:
path: ./*.rpm
retention-days: 1

repo-debian:
runs-on: ubuntu-latest
needs: [build-debian]
env:
dist: debian
steps:
- uses: actions/checkout@v2
# get binaries created by other jobs
- uses: actions/download-artifact@v2
# build container image for repo packaging, using the same as for building
- run: /usr/bin/docker build -t ${{ github.job }} -f build/Dockerfile-${{ env.dist }} .
# make entrypoints executable
- run: chmod +x build/entrypoint-*.sh
# get secret signing key
- run: echo "${{ secrets.DHCPY6D_SIGNING_KEY }}" > signing_key.asc
# organize SSH deploy key for dhcp6d-jekyll repo
- run: mkdir ~/.ssh
- run: echo "${{ secrets.DHCPY6D_REPO_SSH_KEY }}" > ~/.ssh/id_ed25519
- run: chmod -R go-rwx ~/.ssh
# get and prepare dhcpy6d-jekyll
- run: git clone [email protected]:HenriWahl/dhcpy6d-jekyll.git
- run: rm -rf ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
- run: mkdir -p ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
# execute container with matching entrypoint
- run: |
/usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \
--volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \
--entrypoint /entrypoint.sh \
--env RELEASE=${{ env.release }} \
${{ github.job }}
# commit and push new binaries to dhcpyd-jekyll
- run: git config --global user.email "[email protected]" && git config --global user.name "Dhcpy6d Repository"
- run: cd ${{ env.repo_dir }} && git add . && git commit -am "new ${{ env.release }} repo ${{ env.dist }}" && git push

repo-centos:
runs-on: ubuntu-latest
# has to wait for repo-debian to avoid parallel processing of git repo dhcpy6d-jekyll
needs: [build-centos, repo-debian]
env:
dist: centos
steps:
- uses: actions/checkout@v2
# get binaries created by other jobs
- uses: actions/download-artifact@v2
# build container image for repo packaging, using the same as for building
- run: /usr/bin/docker build -t ${{ github.job }} -f build/Dockerfile-${{ env.dist }} .
# make entrypoints executable
- run: chmod +x build/entrypoint-*.sh
# get secret signing key
- run: echo "${{ secrets.DHCPY6D_SIGNING_KEY }}" > signing_key.asc
# organize SSH deploy key for dhcp6d-jekyll repo
- run: mkdir ~/.ssh
- run: echo "${{ secrets.DHCPY6D_REPO_SSH_KEY }}" > ~/.ssh/id_ed25519
- run: chmod -R go-rwx ~/.ssh
# get and prepare dhcpy6d-jekyll
- run: git clone [email protected]:HenriWahl/dhcpy6d-jekyll.git
- run: rm -rf ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
- run: mkdir -p ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
# execute container with matching entrypoint
- run: |
/usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \
--volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \
--entrypoint /entrypoint.sh \
--env RELEASE=${{ env.release }} \
${{ github.job }}
# commit and push new binaries to dhcpyd-jekyll
- run: git config --global user.email "[email protected]" && git config --global user.name "Dhcpy6d Repository"
- run: cd ${{ env.repo_dir }} && git add . && git commit -am "new ${{ env.release }} repo ${{ env.dist }}" && git push

github-release:
runs-on: ubuntu-latest
needs: [build-debian, build-centos]
Expand Down
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog for dhcpy6d

2023-07-02 1.6.0

added option 82 support
added option 83 support
added partly option 20 support

2023-07-02 1.4.0

added prefix_route_link_local for client config
Expand Down
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
dhcpy6d (1.6.0-1) stable; urgency=medium

* New upstream release
+ added option 82 support
+ added option 83 support
+ added partly option 20 support

-- Henri Wahl <[email protected]> Sat, 27 Jul 2024 00:00:00 +0200

dhcpy6d (1.4.0-1) stable; urgency=medium

* New upstream release
Expand Down
4 changes: 2 additions & 2 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Upstream-Name: dhcpy6d
Source: https://dhcpy6d.de/

Files: *
Copyright: 2012-2022 Henri Wahl <[email protected]>
Copyright: 2012-2024 Henri Wahl <[email protected]>
License: GPL-2+

Files: debian/*
Copyright: 2012-2022 Henri Wahl <[email protected]>
Copyright: 2012-2024 Henri Wahl <[email protected]>
2014 Axel Beckert <[email protected]>
License: GPL-2+

Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/client/default.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/client/from_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/client/parse_pattern.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/client/reuse_lease.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
15 changes: 13 additions & 2 deletions dhcpy6d/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -121,7 +121,11 @@ def __init__(self):

# INFORMATION REFRESH TIME option 32 for option 11 (INFORMATION REQUEST)
# see RFC http://tools.ietf.org/html/rfc4242
self.INFORMATION_REFRESH_TIME = '6000'
self.INFORMATION_REFRESH_TIME = '600'

# SOL_MAX_RT Option 82
# see https://www.rfc-editor.org/rfc/rfc8415.html#page-127
self.SOLICITATION_REFRESH_TIME = '1200'

# config type
# one of file, mysql, sqlite or none
Expand Down Expand Up @@ -727,6 +731,13 @@ def read_config(self, configfile):
error_exit(f"{msg_prefix} Information refresh time preference "
f"'{self.INFORMATION_REFRESH_TIME}' is pretty short.")

# check max solicitation refresh time
if not self.SOLICITATION_REFRESH_TIME.isdigit():
error_exit(f"{msg_prefix} Max solicitation refresh time '{self.SOLICITATION_REFRESH_TIME}' is invalid.")
elif not 60 <= int(self.SOLICITATION_REFRESH_TIME) <= 86400:
error_exit(f"{msg_prefix} Max solicitation refresh time preference "
f"'{self.SOLICITATION_REFRESH_TIME}' is not greater or equal to 60 and neither smaller or equal to 86400.")

# check validity of configuration source
if self.STORE_CONFIG not in ['mysql', 'postgresql', 'sqlite', 'file', False]:
error_exit(f"{msg_prefix} Unknown config storage type '{self.STORAGE}' is invalid.")
Expand Down
8 changes: 5 additions & 3 deletions dhcpy6d/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -92,8 +92,10 @@
57: 'V6_ACCESS_DOMAIN',
58: 'SIP_UA_CS_LIST',
59: 'BOOTFILE_URL',
60: 'OPT_BOOTFILE_PARAM',
61: 'OPTION_CLIENT_ARCH_TYPE'
60: 'BOOTFILE_PARAM',
61: 'CLIENT_ARCH_TYPE',
82: 'SOL_MAX_RT',
83: 'INF_MAX_RT'
}

STATUS = {0: 'Success',
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/domain.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions dhcpy6d/globals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -126,7 +126,7 @@ def time(self, new_time):
CONST.OPTION.IA_PD)

# options to be ignored when logging
IGNORED_LOG_OPTIONS = ['options_raw', 'client', 'client_config_dicts', 'timestamp', 'iat1', 'iat2', 'id']
IGNORED_LOG_OPTIONS = ['options', 'client', 'client_config_dicts', 'timestamp', 'iat1', 'iat2', 'id']

# empty options string test
EMPTY_OPTIONS = [None, False, '', []]
Expand Down
13 changes: 11 additions & 2 deletions dhcpy6d/handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -421,6 +421,13 @@ def build_response(self, message_type_response, transaction, options_request, st
# list of options in answer to be logged
options_answer = []

# Option 20 reconfigure accept - for client compatibility, actually
# not really supported, added here to add to options
# https://github.com/HenriWahl/dhcpy6d/issues/64
if CONST.OPTION.RECONF_ACCEPT in transaction.options.keys() and \
not CONST.OPTION.RECONF_ACCEPT in options_request:
options_request.append(CONST.OPTION.RECONF_ACCEPT)

# build all requested options if they are handled
for number in options_request:
if number in OPTIONS:
Expand All @@ -447,7 +454,7 @@ def build_response(self, message_type_response, transaction, options_request, st
volatile_store.db_connect()

# create error handler - headers have to be recreated because
# problems may have arisen while processing and these information
# problems may have arisen while processing and this information
# is not valid anymore
# handler type + transaction id
response_string = f'{CONST.MESSAGE.REPLY:02x}'
Expand Down Expand Up @@ -497,6 +504,7 @@ def build_response(self, message_type_response, transaction, options_request, st
# Option 13 Status Code Option - statuscode is 2: 'No Addresses available'
response_string += build_option(CONST.OPTION.STATUS_CODE,
f'{CONST.STATUS.NO_ADDRESSES_AVAILABLE:04x}')

# options in answer to be logged
options_answer.append(CONST.OPTION.STATUS_CODE)

Expand All @@ -521,6 +529,7 @@ def build_response(self, message_type_response, transaction, options_request, st
log.info(f'{CONST.MESSAGE_DICT[message_type_response]} | '
f'transaction: {transaction.id} | '
f'options: {options_answer}')

# handler
self.response = binascii.unhexlify(response_string)

Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/log.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/macs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/options/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/options/option_1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/options/option_12.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/options/option_13.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/options/option_14.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/options/option_15.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/options/option_16.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHCPy6d DHCPv6 Daemon
#
# Copyright (C) 2009-2022 Henri Wahl <[email protected]>
# Copyright (C) 2009-2024 Henri Wahl <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
Loading
Loading