Commit Graph

139 Commits

Author SHA1 Message Date
W.C.A. Wijngaards
1e0cf1e86b - Merge patch to fix for glue that is outside of zone, with
`harden-unverified-glue`, from Karthik Umashankar (Microsoft).
  Enabling this option protects the Unbound resolver against bad
  glue, that is unverified out of zone glue, by resolving them.
  It uses the records as last resort if there is no other working
  glue.
2024-08-23 08:56:48 +02:00
W.C.A. Wijngaards
a335e601e4 ipset-pf-support, move startup and destartup to the front of the module
func block functions, modstack call deinit function names, and detect
module change when no startup functions are needed.
2024-07-03 13:53:44 +02:00
W.C.A. Wijngaards
ff653a7ef8 Call module init init again, and new function startup and destartup.
NULL can be used if the function is not used. Open shared ports during
reload. Deinit is called during reload.
2024-07-01 16:10:07 +02:00
W.C.A. Wijngaards
fd11cd9182 ipset-pf-support, fix compilation, close of pf socket. 2024-07-01 14:54:45 +02:00
Wouter Wijngaards
ced9762b14
Merge pull request #1041 from NLnetLabs/stubfwd-unshare
Stub and Forward unshare
2024-04-25 11:11:00 +02:00
Yorgos Thessalonikefs
9b9bba9f02
Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.

Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
2024-04-25 11:05:58 +02:00
Petr Mensik
b11d234f77 Py_NoSiteFlag is not needed since Python 3.8
Python since 3.12 prints warning about Py_NoSiteFlag is deprecated. It
seems that variable is not needed since Python 3.8, since it sets in
such cases directly config.site_import variable few moments later.
Move using deprecated variable to versions before that flag in config
could be used only.

This should fix warning like:

pythonmod/pythonmod.c: In function 'pythonmod_init':
pythonmod/pythonmod.c:359:7: warning: 'Py_NoSiteFlag' is deprecated [-Wdeprecated-declarations]
  359 |       Py_NoSiteFlag = 1;
      |       ^~~~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:48,
                 from pythonmod/pythonmod.c:54:
/usr/include/python3.12/cpython/pydebug.h:14:37: note: declared here
   14 | Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_NoSiteFlag;
      |                                     ^~~~~~~~~~~~~

https://docs.python.org/3/c-api/init.html#c.Py_NoSiteFlag
2024-04-15 13:52:41 +02:00
W.C.A. Wijngaards
48113cfaba - fast-reload, unshared stub hints, making the structure locked, with an rwlock. 2024-04-03 13:55:57 +02:00
George Thessalonikefs
e4510c76e5 - For multi Python module setups, clean previously parsed module
functions in __main__'s dictionary, if any, so that only current
  module functions are registered.
2023-10-16 16:03:11 +02:00
George Thessalonikefs
122dd6c11e - Expose the configured listening and outgoing interfaces, if any, as
a list of strings in the Python 'config_file' class instead of the
  current Swig object proxy; fixes #79.
2023-10-16 15:53:47 +02:00
George Thessalonikefs
63a5280f8f - Expose the script filename in the Python module environment 'mod_env'
instead of the config_file structure which includes the linked list
  of scripts in a multi Python module setup; fixes #79.
2023-10-16 15:47:18 +02:00
W.C.A. Wijngaards
67153f897e - Fix for #949: Fix pythonmod/ubmodule-tst.py for Python 3.x. 2023-10-11 13:47:28 +02:00
George Thessalonikefs
51c189394d - Cleaner failure code for callback functions in interface.i. 2023-07-21 16:53:36 +02:00
George Thessalonikefs
4776f749be Merge branch 'python_add_missing_callbacks' of https://github.com/fhriley/unbound into fhriley-python_add_missing_callbacks 2023-07-21 15:19:12 +02:00
W.C.A. Wijngaards
48a6ff14a4 - Fix #906: warning: ‘Py_SetProgramName’ is deprecated. 2023-07-03 10:23:37 +02:00
George Thessalonikefs
380e3de140 - Merge #827 from rcmcdonald91: Eliminate unnecessary Python reloading
which causes memory leaks.
2023-06-29 13:02:27 +02:00
George Thessalonikefs
fc8bf269e9 - More fixes for reference counting for python module and clean up
failure code.
2023-06-29 12:26:49 +02:00
W.C.A. Wijngaards
7696074fa9 - Fix python modules with multiple scripts, by incrementing reference
counts.
2023-06-29 10:16:37 +02:00
Коренберг Марк
a25fc52818 Fix: #895: pythonmodule: add all site-packages directories to sys.path 2023-06-11 10:39:13 +03:00
George Thessalonikefs
e1ec3cf893 Merge branch 'nat64' of https://github.com/eqvinox/unbound into eqvinox-nat64 2023-04-26 15:14:39 +02:00
Christian McDonald
60304f972e #827 review response 2023-02-24 09:31:19 -05:00
Christian McDonald
0bf55e6063 set modinfo to null last 2023-02-01 15:17:59 -05:00
R. Christian McDonald
45142868ec
Fix copyright date 2023-01-28 14:02:51 -05:00
R. Christian McDonald
55a28d6946
cleanup callbacks that might have been registered by Python script 2023-01-19 16:30:47 -05:00
Christian McDonald
cfd3bcb21e eliminate unnecessary Python reloading which causes memory leaks 2023-01-13 16:39:28 -05:00
W.C.A. Wijngaards
4517dcd439 - Fix python module install path detection. 2023-01-09 15:03:38 +01:00
George Thessalonikefs
4e305e644b - Complementary fix for distutils.sysconfig deprecation in Python 3.10
to commit 62c5039ab9.
2022-11-09 11:41:28 +01:00
David Lamparter
64fb06f892 NAT64 support
This implements #721.  Includes documentation and some very basic tests.
Please refer to doc for further detail.
2022-11-07 11:37:50 +00:00
Yorgos Thessalonikefs
c4e51a4cfe
PROXYv2 downstream support (#760) 2022-10-03 15:29:47 +02:00
W.C.A. Wijngaards
f6753a0f10 - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699. 2022-08-01 13:24:40 +02:00
George Thessalonikefs
daf316ea1b - Fix #417: prefetch and ECS causing cache corruption when used
together.
2022-05-12 00:56:01 +02:00
W.C.A. Wijngaards
99a3f5ee85 - Fix pythonmod for change in iter_dp_is_useless function prototype. 2022-03-01 10:27:24 +01:00
George Thessalonikefs
f857af873e - Update ratelimit code for recent serviced_query changes and more
accurate ratelimit calculation.
2022-01-29 23:49:38 +01:00
W.C.A. Wijngaards
2921ce9e61 - Fix to make python module opt_list use opt_list_in. 2021-11-29 11:57:45 +01:00
Wouter Wijngaards
9645228f03
Merge pull request #570 from rex4539/typos
Fix typos
2021-11-29 11:39:48 +01:00
Tom Carpay
e899b4cefe Make explicit whether edns options are parsed from queries or responses 2021-11-15 13:40:51 +00:00
Dimitris Apostolou
c21d6af617
Fix typos 2021-11-13 16:56:15 +02:00
W.C.A. Wijngaards
2f828ec720 - For #519: yacc and lex. And fix python bindings, and test program
unbound-dnstap-socket.
2021-08-12 15:12:55 +02:00
W.C.A. Wijngaards
f62994f6ea - Fix #506: Python Module Seems to Leak Memory if it Experiences an
Unhandled Exception.
2021-07-02 09:42:31 +02:00
W.C.A. Wijngaards
79209823ac - Fix a number of warnings reported by the gcc analyzer. 2021-06-18 18:12:26 +02:00
George Thessalonikefs
a13d935153 - Reformat pythonmod/pythonmod_utils.{c,h}. 2021-03-22 18:45:31 +01:00
W.C.A. Wijngaards
3b24d845ff - Fix doxygen and pydoc warnings. 2021-02-18 11:39:06 +01:00
Victor Stinner
92d01d8265 Fix #426: Replace _Py_fopen() with fopen() in pythonmod.c
The private _Py_fopen() function has been removed in Python 3.10.

Fix build on Python 3.10.
2021-02-16 11:27:52 +01:00
W.C.A. Wijngaards
e0d426ebb1 - Fix for Python 3.9, no longer use deprecated functions of
PyEval_CallObject (now PyObject_Call), PyEval_InitThreads (now
  none), PyParser_SimpleParseFile (now Py_CompileString).
2021-02-09 10:38:55 +01:00
W.C.A. Wijngaards
1aa7168c6a - For #391: more double casts in python start time calculation. 2021-01-08 09:55:55 +01:00
W.C.A. Wijngaards
ee2545d939 - For #391: fix indentation. 2021-01-08 09:53:52 +01:00
W.C.A. Wijngaards
3e03e2c26d - For #391: use struct timeval* start_time for callback information. 2021-01-08 09:47:46 +01:00
Frank Riley
e3abd772f7 Add start_time to reply callbacks so modules can compute the response time. 2021-01-01 15:44:21 -07:00
Frank Riley
28b45e1d87 Add missing callbacks to the python module 2021-01-01 10:19:32 -07:00
W.C.A. Wijngaards
811cf6db0c - Fix missing prototypes in the code. 2020-12-11 14:34:39 +01:00