GNOME Bugzilla – Bug 793261
[RFE] Platform: support netlink extended acks
Last modified: 2018-03-09 16:57:20 UTC
Recent kernel versions report an "extended ack" for netlink failures, that contains a text describing the reason for the failure. This is useful for debugging failures, for example -EINVAL errors, where the extended ack describes better what went wrong.
Created attachment 369484 [details] [review] [PATCH] platform: print error message from netlink extended ack
+ err = setsockopt (sk->s_fd, SOL_NETLINK, NETLINK_EXT_ACK, &enable, sizeof (enable)); gboolean is indeed a typedef of "int", and that won't change in glib. But could you still use an explicit "int" type variable to make that clear? - _LOGD ("netlink: recvmsg: error message from kernel: %s (%d) for request %d", + _LOGE ("netlink: recvmsg: error message from kernel: %s (%d)%s%s%s for request %d", The platform layer does not know whether a netlink failure is really a serious error or something that can happen under non-erroneous conditions. Only the caller can know that. Hence, logging from platform at this point should be at most at debug level.
(In reply to Thomas Haller from comment #2) > + err = setsockopt (sk->s_fd, SOL_NETLINK, NETLINK_EXT_ACK, &enable, > sizeof (enable)); > > gboolean is indeed a typedef of "int", and that won't change in glib. But > could you still use an explicit "int" type variable to make that clear? Fixed. > - _LOGD ("netlink: recvmsg: error message from kernel: %s > (%d) for request %d", > + _LOGE ("netlink: recvmsg: error message from kernel: %s > (%d)%s%s%s for request %d", > > The platform layer does not know whether a netlink failure is really a > serious error or something that can happen under non-erroneous conditions. > Only the caller can know that. Hence, logging from platform at this point > should be at most at debug level. Yeah, I forgot to change it back to _LOGD after debugging. Pushed with other commits to branch bg/extack-bgo793261.
lgtm
Merged: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=6a54f4279f792facb17a9c1dc3508ac155521256