ipmonitor: decode DELNETCONF message
When device is deleted DELNETCONF is sent, but ipmonitor was unable to decode it. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
40443f49b3
commit
e09d21f675
|
|
@ -133,6 +133,7 @@ static int accept_msg(const struct sockaddr_nl *who,
|
|||
return 0;
|
||||
|
||||
case RTM_NEWNETCONF:
|
||||
case RTM_DELNETCONF:
|
||||
print_headers(fp, "[NETCONF]", ctrl);
|
||||
print_netconf(who, ctrl, n, arg);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -66,8 +66,10 @@ int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
|
|||
|
||||
if (n->nlmsg_type == NLMSG_ERROR)
|
||||
return -1;
|
||||
if (n->nlmsg_type != RTM_NEWNETCONF) {
|
||||
fprintf(stderr, "Not RTM_NEWNETCONF: %08x %08x %08x\n",
|
||||
|
||||
if (n->nlmsg_type != RTM_NEWNETCONF &&
|
||||
n->nlmsg_type != RTM_DELNETCONF) {
|
||||
fprintf(stderr, "Not a netconf message: %08x %08x %08x\n",
|
||||
n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
|
||||
|
||||
return -1;
|
||||
|
|
@ -91,6 +93,9 @@ int print_netconf(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
|
|||
return 0;
|
||||
|
||||
open_json_object(NULL);
|
||||
if (n->nlmsg_type == RTM_DELNETCONF)
|
||||
print_bool(PRINT_ANY, "deleted", "Deleted ", true);
|
||||
|
||||
print_string(PRINT_ANY, "family",
|
||||
"%s ", family_name(ncm->ncm_family));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue