path: root/Logger.cpp
diff options
authorTobias Klauser <>2013-02-22 16:28:11 +0100
committerTobias Klauser <>2013-02-22 16:28:11 +0100
commit4b64fef4c41ae4432eb00b8b814ed4d4d746f794 (patch)
tree6fcf6fa13f946de4f0ab641a46ef684d2f1726be /Logger.cpp
parent97b46a1192352c564eabb841c21ad1284ad1d51b (diff)
Logger: Add warn() method
Diffstat (limited to 'Logger.cpp')
1 files changed, 12 insertions, 0 deletions
diff --git a/Logger.cpp b/Logger.cpp
index b0850a6..b4f6bbf 100644
--- a/Logger.cpp
+++ b/Logger.cpp
@@ -45,6 +45,18 @@ int Logger::log(const char *fmt, ...)
return ret;
+int Logger::warn(const char *fmt, ...)
+ va_list ap;
+ int ret;
+ va_start(ap, fmt);
+ ret = _log_vfprintf(_f_err, "Warning", fmt, ap);
+ va_end(ap);
+ return ret;
int Logger::err(const char *fmt, ...)
va_list ap;
now they're in a 'raid6' directory.David Woodhouse1-42/+39 class='logmsg'> The sk_unattached_filter_create() API is used by BPF filters that are not directly attached or related to sockets, and are used in team, ptp, xt_bpf, cls_bpf, etc. As such all users do their own internal managment of obtaining filter blocks and thus already have them in kernel memory and set up before calling into sk_unattached_filter_create(). As a result, due to __user annotation in sock_fprog, sparse triggers false positives (incorrect type in assignment [different address space]) when filters are set up before passing them to sk_unattached_filter_create(). Therefore, let sk_unattached_filter_create() API use sock_fprog_kern to overcome this issue. Signed-off-by: Daniel Borkmann <> Acked-by: Alexei Starovoitov <> Signed-off-by: David S. Miller <> 2014-05-13net: ptp: mark filter as __initdataMathias Krause1-1/+1 sk_unattached_filter_create() will copy the filter's instructions so we don't need to have the master copy hanging around after initialization. Signed-off-by: Mathias Krause <> Acked-by: Alexei Starovoitov <> Signed-off-by: David S. Miller <> 2014-04-01net: ptp: move PTP classifier in its own fileDaniel Borkmann1-0/+141 This commit fixes a build error reported by Fengguang, that is triggered when CONFIG_NETWORK_PHY_TIMESTAMPING is not set: ERROR: "ptp_classify_raw" [drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.ko] undefined! The fix is to introduce its own file for the PTP BPF classifier, so that PTP_1588_CLOCK and/or NETWORK_PHY_TIMESTAMPING can select it independently from each other. IXP4xx driver on ARM needs to select it as well since it does not seem to select PTP_1588_CLOCK or similar that would pull it in automatically. This also allows for hiding all of the internals of the BPF PTP program inside that file, and only exporting relevant API bits to drivers. This patch also adds a kdoc documentation of ptp_classify_raw() API to make it clear that it can return PTP_CLASS_* defines. Also, the BPF program has been translated into bpf_asm code, so that it can be more easily read and altered (extensively documented in [1]). In the kernel tree under tools/net/ we have bpf_asm and bpf_dbg tools, so the commented program can simply be translated via `./bpf_asm -c prog` where prog is a file that contains the commented code. This makes it easily readable/verifiable and when there's a need to change something, jump offsets etc do not need to be replaced manually which can be very error prone. Instead, a newly translated version via bpf_asm can simply replace the old code. I have checked opcode diffs before/after and it's the very same filter. [1] Documentation/networking/filter.txt Fixes: 164d8c666521 ("net: ptp: do not reimplement PTP/BPF classifier") Reported-by: Fengguang Wu <> Signed-off-by: Daniel Borkmann <> Signed-off-by: Alexei Starovoitov <> Cc: Richard Cochran <> Cc: Jiri Benc <> Acked-by: Richard Cochran <> Signed-off-by: David S. Miller <>