Re: [PATCH] nefilter: nfnetlink: add nfnetlink_set_err and use it in ctnetlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pablo Neira Ayuso wrote:
Patrick McHardy wrote:
Pablo Neira Ayuso wrote:
This patch adds nfnetlink_set_err() to propagate the error to netlink
broadcast listener in case of memory allocation errors in the
message building.
+void nfnetlink_set_err(u32 group, int error)
+{
+    netlink_set_err(nfnl, 0, group, error);
+}
+EXPORT_SYMBOL_GPL(nfnetlink_set_err);
Please make the pid argument controllable by the caller as well. This
is necessary to avoid double error notifications when an error occurs
in response to a user-request triggering notifications.

OK, I'll add it, but the pid passed as argument will be zero by now.
Note that, in the current code, user-requests ignore notification
errors, so there is no chance to get double error notifications.

I know. I have the same function in my nftables tree though (but
requiring the pid-argument), so we might as well add it in a
future-proof way.

I have another patch here to propagate errors of user-requests that
result in failing notifications, then the pid parameter in
nfnetlink_set_err() will be useful. That patch also includes the use of
NETLINK_BROADCAST_ERROR. I'll send you that patch soon.

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux