@@ -1312,6 +1312,7 @@ static mdns_tx_packet_t * _mdns_create_probe_packet(tcpip_adapter_if_t tcpip_if,
1312
1312
q -> domain = MDNS_DEFAULT_DOMAIN ;
1313
1313
if (!q -> host || _mdns_question_exists (q , packet -> questions )) {
1314
1314
free (q );
1315
+ continue ;
1315
1316
} else {
1316
1317
queueToEnd (mdns_out_question_t , packet -> questions , q );
1317
1318
}
@@ -2801,7 +2802,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
2801
2802
col = 1 ;
2802
2803
} else if (!clas ) {
2803
2804
col = -1 ;
2804
- } else {
2805
+ } else if ( service ) { // only detect srv collision if service existed
2805
2806
col = _mdns_check_srv_collision (service -> service , priority , weight , port , name -> host , name -> domain );
2806
2807
}
2807
2808
if (col && (parsed_packet -> probe || parsed_packet -> authoritative )) {
@@ -3831,23 +3832,25 @@ static void _mdns_execute_action(mdns_action_t * action)
3831
3832
break ;
3832
3833
case ACTION_SERVICE_DEL :
3833
3834
a = _mdns_server -> services ;
3834
- if (_mdns_server -> services == action -> data .srv_del .service ) {
3835
- _mdns_server -> services = a -> next ;
3836
- _mdns_send_bye (& a , 1 , false);
3837
- _mdns_remove_scheduled_service_packets (a -> service );
3838
- _mdns_free_service (a -> service );
3839
- free (a );
3840
- } else {
3841
- while (a -> next && a -> next != action -> data .srv_del .service ) {
3842
- a = a -> next ;
3843
- }
3844
- if (a -> next == action -> data .srv_del .service ) {
3845
- mdns_srv_item_t * b = a -> next ;
3846
- a -> next = a -> next -> next ;
3847
- _mdns_send_bye (& b , 1 , false);
3848
- _mdns_remove_scheduled_service_packets (b -> service );
3849
- _mdns_free_service (b -> service );
3850
- free (b );
3835
+ if (action -> data .srv_del .service ) {
3836
+ if (_mdns_server -> services == action -> data .srv_del .service ) {
3837
+ _mdns_server -> services = a -> next ;
3838
+ _mdns_send_bye (& a , 1 , false);
3839
+ _mdns_remove_scheduled_service_packets (a -> service );
3840
+ _mdns_free_service (a -> service );
3841
+ free (a );
3842
+ } else {
3843
+ while (a -> next && a -> next != action -> data .srv_del .service ) {
3844
+ a = a -> next ;
3845
+ }
3846
+ if (a -> next == action -> data .srv_del .service ) {
3847
+ mdns_srv_item_t * b = a -> next ;
3848
+ a -> next = a -> next -> next ;
3849
+ _mdns_send_bye (& b , 1 , false);
3850
+ _mdns_remove_scheduled_service_packets (b -> service );
3851
+ _mdns_free_service (b -> service );
3852
+ free (b );
3853
+ }
3851
3854
}
3852
3855
}
3853
3856
0 commit comments