net/icmpv4: Normalize input function signature with ipv6 counter-part

Length parameter was always useless, only used in debugging, so that can
be removed.

Change-Id: If597f424840f37955202fa5fe827dd992e4cf776
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2017-03-24 09:19:55 +01:00 committed by Jukka Rissanen
commit 850efc270c
3 changed files with 5 additions and 8 deletions

View file

@ -278,13 +278,11 @@ void net_icmpv4_unregister_handler(struct net_icmpv4_handler *handler)
sys_slist_find_and_remove(&handlers, &handler->node);
}
enum net_verdict net_icmpv4_input(struct net_buf *buf, uint16_t len,
enum net_verdict net_icmpv4_input(struct net_buf *buf,
uint8_t type, uint8_t code)
{
struct net_icmpv4_handler *cb;
ARG_UNUSED(len);
net_stats_update_icmp_recv();
SYS_SLIST_FOR_EACH_CONTAINER(&handlers, cb, node) {

View file

@ -73,7 +73,7 @@ void net_icmpv4_register_handler(struct net_icmpv4_handler *handler);
void net_icmpv4_unregister_handler(struct net_icmpv4_handler *handler);
enum net_verdict net_icmpv4_input(struct net_buf *buf, uint16_t len,
enum net_verdict net_icmpv4_input(struct net_buf *buf,
uint8_t type, uint8_t code);
#if defined(CONFIG_NET_IPV4)

View file

@ -412,12 +412,11 @@ static inline enum net_verdict process_icmpv4_pkt(struct net_buf *buf,
struct net_ipv4_hdr *ipv4)
{
struct net_icmp_hdr *hdr = NET_ICMP_BUF(buf);
uint16_t len = (ipv4->len[0] << 8) + ipv4->len[1];
NET_DBG("ICMPv4 packet received length %d type %d code %d",
len, hdr->type, hdr->code);
NET_DBG("ICMPv4 packet received type %d code %d",
hdr->type, hdr->code);
return net_icmpv4_input(buf, len, hdr->type, hdr->code);
return net_icmpv4_input(buf, hdr->type, hdr->code);
}
#endif /* CONFIG_NET_IPV4 */