diff options
Diffstat (limited to 'lib/route/cls/ematch')
-rw-r--r-- | lib/route/cls/ematch/cmp.c | 8 | ||||
-rw-r--r-- | lib/route/cls/ematch/container.c | 8 | ||||
-rw-r--r-- | lib/route/cls/ematch/meta.c | 12 | ||||
-rw-r--r-- | lib/route/cls/ematch/nbyte.c | 8 | ||||
-rw-r--r-- | lib/route/cls/ematch/text.c | 12 |
5 files changed, 9 insertions, 39 deletions
diff --git a/lib/route/cls/ematch/cmp.c b/lib/route/cls/ematch/cmp.c index 2e380c39..f5758669 100644 --- a/lib/route/cls/ematch/cmp.c +++ b/lib/route/cls/ematch/cmp.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/cmp.c Simple packet data comparison ematch - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2013 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/route/cls/ematch/container.c b/lib/route/cls/ematch/container.c index 813391ab..b23169bb 100644 --- a/lib/route/cls/ematch/container.c +++ b/lib/route/cls/ematch/container.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/container.c Container Ematch - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2008-2013 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/route/cls/ematch/meta.c b/lib/route/cls/ematch/meta.c index a26ed4c8..3f63cdea 100644 --- a/lib/route/cls/ematch/meta.c +++ b/lib/route/cls/ematch/meta.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/meta.c Metadata Match - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ @@ -246,9 +240,9 @@ static void dump_value(struct rtnl_meta_value *v, struct nl_dump_params *p) nl_dump(p, " >> %u", v->mv_shift); if (v->mv_len == 4) - nl_dump(p, " & %#x", *(uint32_t *) (v + 1)); + nl_dump(p, " & %#lx", (long unsigned) *(uint32_t *) (v + 1)); else if (v->mv_len == 8) - nl_dump(p, " & %#x", *(uint64_t *) (v + 1)); + nl_dump(p, " & %#llx", (long long unsigned) (*(uint64_t *) (v + 1))); } break; diff --git a/lib/route/cls/ematch/nbyte.c b/lib/route/cls/ematch/nbyte.c index 2942c0da..735dfc86 100644 --- a/lib/route/cls/ematch/nbyte.c +++ b/lib/route/cls/ematch/nbyte.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/nbyte.c Nbyte comparison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ diff --git a/lib/route/cls/ematch/text.c b/lib/route/cls/ematch/text.c index 4dcd4f05..b5248332 100644 --- a/lib/route/cls/ematch/text.c +++ b/lib/route/cls/ematch/text.c @@ -1,11 +1,5 @@ +/* SPDX-License-Identifier: LGPL-2.1-only */ /* - * lib/route/cls/ematch/text.c Text Search - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation version 2.1 - * of the License. - * * Copyright (c) 2010-2013 Thomas Graf <tgraf@suug.ch> */ @@ -17,6 +11,7 @@ */ #include <netlink-private/netlink.h> +#include <netlink-private/utils.h> #include <netlink-private/tc.h> #include <netlink/netlink.h> #include <netlink/route/cls/ematch.h> @@ -91,8 +86,7 @@ void rtnl_ematch_text_set_algo(struct rtnl_ematch *e, const char *algo) { struct text_data *t = rtnl_ematch_data(e); - strncpy(t->cfg.algo, algo, sizeof(t->cfg.algo)); - t->cfg.algo[sizeof(t->cfg.algo) - 1] = '\0'; + _nl_strncpy_trunc(t->cfg.algo, algo, sizeof(t->cfg.algo)); } char *rtnl_ematch_text_get_algo(struct rtnl_ematch *e) |