File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ int net_icmpv4_finalize(struct net_pkt *pkt)
6060}
6161
6262static enum net_verdict icmpv4_handle_echo_request (struct net_pkt * pkt ,
63- struct net_ipv4_hdr * ip_hdr )
63+ struct net_ipv4_hdr * ip_hdr ,
64+ struct net_icmp_hdr * icmp_hdr )
6465{
6566 struct net_pkt * reply = NULL ;
6667 s16_t payload_len ;
@@ -319,7 +320,7 @@ enum net_verdict net_icmpv4_input(struct net_pkt *pkt,
319320 SYS_SLIST_FOR_EACH_CONTAINER (& handlers , cb , node ) {
320321 if (cb -> type == icmp_hdr -> type &&
321322 (cb -> code == icmp_hdr -> code || cb -> code == 0U )) {
322- return cb -> handler (pkt , ip_hdr );
323+ return cb -> handler (pkt , ip_hdr , icmp_hdr );
323324 }
324325 }
325326
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ struct net_icmpv4_echo_req {
3434
3535typedef enum net_verdict (* icmpv4_callback_handler_t )(
3636 struct net_pkt * pkt ,
37- struct net_ipv4_hdr * ip_hdr );
37+ struct net_ipv4_hdr * ip_hdr ,
38+ struct net_icmp_hdr * icmp_hdr );
3839
3940struct net_icmpv4_handler {
4041 sys_snode_t node ;
Original file line number Diff line number Diff line change @@ -2720,7 +2720,8 @@ static int ping_ipv6(const struct shell *shell, char *host)
27202720#if defined(CONFIG_NET_IPV4 )
27212721
27222722static enum net_verdict handle_ipv4_echo_reply (struct net_pkt * pkt ,
2723- struct net_ipv4_hdr * ip_hdr );
2723+ struct net_ipv4_hdr * ip_hdr ,
2724+ struct net_icmp_hdr * icmp_hdr );
27242725
27252726static struct net_icmpv4_handler ping4_handler = {
27262727 .type = NET_ICMPV4_ECHO_REPLY ,
@@ -2734,7 +2735,8 @@ static inline void remove_ipv4_ping_handler(void)
27342735}
27352736
27362737static enum net_verdict handle_ipv4_echo_reply (struct net_pkt * pkt ,
2737- struct net_ipv4_hdr * ip_hdr )
2738+ struct net_ipv4_hdr * ip_hdr ,
2739+ struct net_icmp_hdr * icmp_hdr )
27382740{
27392741 PR_SHELL (shell_for_ping , "Received echo reply from %s to %s\n" ,
27402742 net_sprint_ipv4_addr (& ip_hdr -> src ),
You can’t perform that action at this time.
0 commit comments