replace parsing to use getopt (safer), change count opt behavior, close socket when needed
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/24 22:49:22 by tomoron #+# #+# */
|
||||
/* Updated: 2025/08/08 22:19:52 by tomoron ### ########.fr */
|
||||
/* Updated: 2025/08/13 16:35:29 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#include "includes/ft_ping.h"
|
||||
@ -125,7 +125,7 @@ void ttl_exceeded(t_icmp_ip_reply *res,t_settings *settings, size_t len)
|
||||
sent->header.ttl, sent->header.protocol, htons(sent->header.check),\
|
||||
convert_ip(sent->header.saddr));
|
||||
printf(" %s\nICMP: ", convert_ip(sent->header.daddr));
|
||||
printf("type %d, code %d, size %zu, id 0x%04x, seq 0x%04x\n", sent->icmp.type, sent->icmp.code, sent->header.tot_len - sizeof(struct iphdr), sent->icmp.identifier, sent->icmp.sequence);
|
||||
printf("type %d, code %d, size %zu, id 0x%04x, seq 0x%04x\n", sent->icmp.type, sent->icmp.code, htons(sent->header.tot_len) - sizeof(struct iphdr), sent->icmp.identifier, sent->icmp.sequence);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user