From 54480d649ff0b2948983c1fff3e26cc3ddfca534 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 17:38:37 +0100 Subject: [PATCH 1/4] cap-list: use missing_capabilty.h to generate list of capabilities --- src/basic/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/basic/meson.build b/src/basic/meson.build index 78e69feb4df..417daee06eb 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -210,6 +210,7 @@ basic_sources = files(''' '''.split()) missing_h = files('missing.h') +missing_capability_h = files('missing_capability.h') generate_af_list = find_program('generate-af-list.sh') af_list_txt = custom_target( @@ -229,7 +230,7 @@ generate_cap_list = find_program('generate-cap-list.sh') cap_list_txt = custom_target( 'cap-list.txt', output : 'cap-list.txt', - command : [generate_cap_list, cpp, config_h, missing_h], + command : [generate_cap_list, cpp, config_h, missing_capability_h], capture : true) generate_errno_list = find_program('generate-errno-list.sh') From 18bf324ab53665f803ea5580ef9be6d99b7e78ca Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 7 Dec 2018 11:48:37 +0900 Subject: [PATCH 2/4] journal: use missing_audit.h to generate audit_type-list.txt --- src/basic/meson.build | 5 +++-- src/journal/audit-type.c | 10 ++-------- src/journal/audit-type.h | 3 +++ src/journal/meson.build | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/basic/meson.build b/src/basic/meson.build index 417daee06eb..67acdd2bf9a 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -91,6 +91,7 @@ basic_sources = files(''' memfd-util.h mempool.c mempool.h + missing.h missing_audit.h missing_btrfs.h missing_btrfs_tree.h @@ -209,7 +210,7 @@ basic_sources = files(''' xattr-util.h '''.split()) -missing_h = files('missing.h') +missing_audit_h = files('missing_audit.h') missing_capability_h = files('missing_capability.h') generate_af_list = find_program('generate-af-list.sh') @@ -279,7 +280,7 @@ foreach item : [['af', af_list_txt, 'af', ''], generated_gperf_headers += [target1, target2] endforeach -basic_sources += [missing_h] + generated_gperf_headers +basic_sources += generated_gperf_headers basic_gcrypt_sources = files( 'gcrypt-util.c', 'gcrypt-util.h') diff --git a/src/journal/audit-type.c b/src/journal/audit-type.c index b30963da667..7b3dc1e9ab0 100644 --- a/src/journal/audit-type.c +++ b/src/journal/audit-type.c @@ -1,12 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#include -#include -#if HAVE_AUDIT -# include -#endif - -#include "missing.h" #include "audit-type.h" +#include "missing_audit.h" + #include "audit_type-to-name.h" -#include "macro.h" diff --git a/src/journal/audit-type.h b/src/journal/audit-type.h index 965b044cbf0..069a883490d 100644 --- a/src/journal/audit-type.h +++ b/src/journal/audit-type.h @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once +#include +#include + #include "macro.h" const char *audit_type_to_string(int type); diff --git a/src/journal/meson.build b/src/journal/meson.build index 807dece545c..e03d6dc2327 100644 --- a/src/journal/meson.build +++ b/src/journal/meson.build @@ -34,7 +34,7 @@ endif ############################################################ audit_type_includes = [config_h, - missing_h, + missing_audit_h, 'linux/audit.h'] if conf.get('HAVE_AUDIT') == 1 audit_type_includes += 'libaudit.h' From 0b7d48f5f4b1187cef617ced8b8ba6d8cb7c38b0 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 17:42:21 +0100 Subject: [PATCH 3/4] af-list,arphrd-list: also include relevant missing_*.h headers --- src/basic/arphrd-list.c | 1 + src/basic/generate-af-list.sh | 2 +- src/basic/generate-arphrd-list.sh | 2 +- src/basic/meson.build | 6 ++++-- src/test/test-arphrd-list.c | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/basic/arphrd-list.c b/src/basic/arphrd-list.c index 8652863cac5..b6e2486b67b 100644 --- a/src/basic/arphrd-list.c +++ b/src/basic/arphrd-list.c @@ -6,6 +6,7 @@ #include "arphrd-list.h" #include "macro.h" +#include "missing_network.h" static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len); diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh index 39e2dad5e7a..5bf244c49d1 100755 --- a/src/basic/generate-af-list.sh +++ b/src/basic/generate-af-list.sh @@ -1,6 +1,6 @@ #!/bin/sh set -eu -$1 -E -dM -include sys/socket.h - #include "macro.h" +#include "missing_network.h" #include "string-util.h" -#include "util.h" _unused_ \ static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len); From 925fb1e1ec4ecb84ecd12138dcc2a8fb3f7549e1 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 Dec 2018 17:42:44 +0100 Subject: [PATCH 4/4] missing: add ARPHRD_IP6GRE This fixes TYPE field of networkctl's output for ip6gre devices. --- src/basic/missing_network.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/basic/missing_network.h b/src/basic/missing_network.h index d9c73c54a96..59a8cd2c608 100644 --- a/src/basic/missing_network.h +++ b/src/basic/missing_network.h @@ -50,6 +50,11 @@ #define IFA_F_MCAUTOJOIN 0x400 #endif +/* if_arp.h */ +#ifndef ARPHRD_IP6GRE +#define ARPHRD_IP6GRE 823 +#endif + /* if_bonding.h */ #ifndef BOND_XMIT_POLICY_ENCAP23 #define BOND_XMIT_POLICY_ENCAP23 3