Browse Source

Merge pull request #4266 from A-Paul/shell_ping6_addrerr

ping6: dedicated message at address parsing error
cc430
Lucas Jenß 7 years ago
parent
commit
80b771af5e
  1. 10
      sys/shell/commands/sc_icmpv6_echo.c

10
sys/shell/commands/sc_icmpv6_echo.c

@ -150,8 +150,7 @@ int _icmpv6_ping(int argc, char **argv)
ipv6_addr_t addr;
msg_t msg;
gnrc_netreg_entry_t *ipv6_entry, my_entry = { NULL, ICMPV6_ECHO_REP,
thread_getpid()
};
thread_getpid() };
uint32_t min_rtt = UINT32_MAX, max_rtt = 0;
uint64_t sum_rtt = 0;
uint64_t ping_start;
@ -182,11 +181,16 @@ int _icmpv6_ping(int argc, char **argv)
stat_interval = atoi(argv[4 + param_offset]);
}
if ((ipv6_addr_from_str(&addr, addr_str) == NULL) || (((int)payload_len) < 0)) {
if ((int)payload_len < 0) {
usage(argv);
return 1;
}
if (ipv6_addr_from_str(&addr, addr_str) == NULL) {
puts("error: malformed address");
return 1;
}
if (gnrc_netreg_register(GNRC_NETTYPE_ICMPV6, &my_entry) < 0) {
puts("error: network registry is full");
return 1;

Loading…
Cancel
Save