Skip to content

Commit

Permalink
Don't overwrite already defined EDNS options
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Pion committed Oct 12, 2022
1 parent 56ed543 commit a8ccdb7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/LDNS.xs
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,11 @@ packet_nsid(obj)
ldns_edns_option_list* edns_list;
ldns_edns_option* edns_opt;

edns_list = ldns_edns_option_list_new();
edns_list = ldns_pkt_edns_get_option_list(obj);

if ( !edns_list )
edns_list = ldns_edns_option_list_new();

edns_opt = ldns_edns_new_from_data(LDNS_EDNS_NSID, 0, NULL);
if ( edns_list == NULL || edns_opt == NULL )
croak("Could not allocate EDNS option");
Expand Down

0 comments on commit a8ccdb7

Please sign in to comment.