File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ getdnsify_addressdict(PyObject *pydict)
351351 unsigned char buf [sizeof (struct in6_addr )];
352352 int domain ;
353353 getdns_bindata tls_auth_name ;
354+ getdns_bindata scope_id ;
354355 uint32_t tls_port ;
355356
356357 if (!PyDict_Check (pydict )) {
@@ -374,6 +375,15 @@ getdnsify_addressdict(PyObject *pydict)
374375 tls_auth_name .size = (size_t )strlen ((char * )tls_auth_name .data );
375376 getdns_dict_set_bindata (addr_dict , "tls_auth_name" , & tls_auth_name );
376377 }
378+ if ((str = PyDict_GetItemString (pydict , "scope_id" )) != NULL ) {
379+ #if PY_MAJOR_VERSION >= 3
380+ scope_id .data = (uint8_t * )strdup (PyBytes_AsString (PyUnicode_AsEncodedString (str , "ascii" , NULL )));
381+ #else
382+ scope_id .data = (uint8_t * )strdup (PyString_AsString (str ));
383+ #endif
384+ scope_id .size = (size_t )strlen ((char * )scope_id .data );
385+ getdns_dict_set_bindata (addr_dict , "scope_id" , & scope_id );
386+ }
377387 if ((str = PyDict_GetItemString (pydict , "tls_port" )) != NULL ) {
378388 if (!PyInt_Check (str )) {
379389 PyErr_SetString (getdns_error , GETDNS_RETURN_INVALID_PARAMETER_TEXT );
You can’t perform that action at this time.
0 commit comments