Commit graph

135 commits

Author SHA1 Message Date
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
W.C.A. Wijngaards
ca39cfd6ae - Fix #333: Unbound Segmentation Fault w/ log_info Functions From
Python Mod.
2020-10-22 08:47:40 +02:00
W.C.A. Wijngaards
c8390e390d - Fix python documentation warning on functions.rst inplace_cb_reply. 2020-10-19 10:41:03 +02:00
George Thessalonikefs
d55084ea9e - Fix that if there are reply callbacks for the given rcode, those
are called per reply and a new message created if that was modified
  by the call.
- Pass the comm_reply information to the inplace_cb_reply* functions
  during the mesh state and update the documentation on that.
2020-10-15 17:17:59 +02:00
George Thessalonikefs
a912786ca9 - Update documentation in python example code. 2020-08-26 11:59:09 +02:00