mirror of
https://github.com/systemd/systemd
synced 2026-03-13 16:44:48 +01:00
Compare commits
9 Commits
4e947bd049
...
88c2c8a0ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88c2c8a0ba | ||
|
|
4bd7e99232 | ||
|
|
96ae72ce1a | ||
|
|
2ff739a6ac | ||
|
|
65a245c3ef | ||
|
|
5aa87ec7ec | ||
|
|
2775e1c578 | ||
|
|
7653a9dcd3 | ||
|
|
ae8e3c2b25 |
@ -35,7 +35,7 @@
|
||||
<citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
|
||||
a handler for core dumps invoked by the kernel. Whether <command>systemd-coredump</command> is used
|
||||
is determined by the kernel's
|
||||
<varname>kernel.core_pattern</varname> <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
<varname>kernel.core_pattern</varname> <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
setting. See
|
||||
<citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
and
|
||||
@ -86,7 +86,9 @@
|
||||
<listitem><para>The maximum size in bytes of a core
|
||||
which will be processed. Core dumps exceeding this size
|
||||
may be stored, but the backtrace will not be generated.
|
||||
</para>
|
||||
Like other sizes in this same config file, the usual
|
||||
suffixes to the base of 1024 are allowed (B, K, M,
|
||||
G, T, P, and E.)</para>
|
||||
|
||||
<para>Setting <varname>Storage=none</varname> and <varname>ProcessSizeMax=0</varname>
|
||||
disables all coredump handling except for a log entry.</para>
|
||||
@ -98,15 +100,18 @@
|
||||
<term><varname>JournalSizeMax=</varname></term>
|
||||
|
||||
<listitem><para>The maximum (uncompressed) size in bytes of a
|
||||
core to be saved.</para></listitem>
|
||||
core to be saved. Unit suffixes are allowed just as in
|
||||
<option>ProcessSizeMax=</option></para></listitem>.
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>MaxUse=</varname></term>
|
||||
<term><varname>KeepFree=</varname></term>
|
||||
|
||||
<listitem><para>Enforce limits on the disk space taken up by
|
||||
externally stored core dumps. <option>MaxUse=</option> makes
|
||||
<listitem><para>Enforce limits on the disk space, specified
|
||||
in bytes, taken up by externally stored core dumps.
|
||||
Unit suffixes are allowed just as in <option>ProcessSizeMax=</option>.
|
||||
<option>MaxUse=</option> makes
|
||||
sure that old core dumps are removed as soon as the total disk
|
||||
space taken up by core dumps grows beyond this limit (defaults
|
||||
to 10% of the total disk size). <option>KeepFree=</option>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, and provides the implementation for
|
||||
<citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
|
||||
<command>pull-raw</command>, <command>pull-tar</command>, <command>import-raw</command>,
|
||||
<command>import-tar</command>, <command>export-raw</command>, and <command>export-tar</command> commands.</para>
|
||||
<command>import-tar</command>, <command>import-fs</command>, <command>export-raw</command>, and <command>export-tar</command> commands.</para>
|
||||
|
||||
<para>See
|
||||
<citerefentry><refentrytitle>org.freedesktop.import1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||
|
||||
@ -43,6 +43,22 @@ char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR
|
||||
return buffer;
|
||||
}
|
||||
|
||||
int ether_addr_to_string_alloc(const struct ether_addr *addr, char **ret) {
|
||||
char *buf;
|
||||
|
||||
assert(addr);
|
||||
assert(ret);
|
||||
|
||||
buf = new(char, ETHER_ADDR_TO_STRING_MAX);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
ether_addr_to_string(addr, buf);
|
||||
|
||||
*ret = buf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ether_addr_compare(const struct ether_addr *a, const struct ether_addr *b) {
|
||||
return memcmp(a, b, ETH_ALEN);
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ char* hw_addr_to_string(const hw_addr_data *addr, char buffer[HW_ADDR_TO_STRING_
|
||||
|
||||
#define ETHER_ADDR_TO_STRING_MAX (3*6)
|
||||
char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR_TO_STRING_MAX]);
|
||||
int ether_addr_to_string_alloc(const struct ether_addr *addr, char **ret);
|
||||
|
||||
int ether_addr_compare(const struct ether_addr *a, const struct ether_addr *b);
|
||||
static inline bool ether_addr_equal(const struct ether_addr *a, const struct ether_addr *b) {
|
||||
|
||||
@ -36,7 +36,11 @@ MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
|
||||
|
||||
BOOT_ROOT=${ENTRY_DIR_ABS%/$MACHINE_ID/$KERNEL_VERSION}
|
||||
BOOT_MNT=$(stat -c %m $BOOT_ROOT)
|
||||
ENTRY_DIR=${ENTRY_DIR_ABS#$BOOT_MNT}
|
||||
if [[ $BOOT_MNT == '/' ]]; then
|
||||
ENTRY_DIR=$ENTRY_DIR_ABS
|
||||
else
|
||||
ENTRY_DIR=${ENTRY_DIR_ABS#$BOOT_MNT}
|
||||
fi
|
||||
|
||||
if [[ $COMMAND == remove ]]; then
|
||||
rm -f "$BOOT_ROOT/loader/entries/$MACHINE_ID-$KERNEL_VERSION.conf"
|
||||
|
||||
@ -486,37 +486,38 @@ int link_has_ipv6_address(Link *link, const struct in6_addr *address) {
|
||||
}
|
||||
|
||||
static void log_address_debug(const Address *address, const char *str, const Link *link) {
|
||||
_cleanup_free_ char *addr = NULL, *peer = NULL;
|
||||
char valid_buf[FORMAT_TIMESPAN_MAX], preferred_buf[FORMAT_TIMESPAN_MAX];
|
||||
const char *valid_str = NULL, *preferred_str = NULL;
|
||||
bool has_peer;
|
||||
|
||||
assert(address);
|
||||
assert(str);
|
||||
assert(link);
|
||||
|
||||
if (DEBUG_LOGGING) {
|
||||
_cleanup_free_ char *addr = NULL, *peer = NULL;
|
||||
char valid_buf[FORMAT_TIMESPAN_MAX], preferred_buf[FORMAT_TIMESPAN_MAX];
|
||||
const char *valid_str = NULL, *preferred_str = NULL;
|
||||
bool has_peer;
|
||||
if (!DEBUG_LOGGING)
|
||||
return;
|
||||
|
||||
(void) in_addr_to_string(address->family, &address->in_addr, &addr);
|
||||
has_peer = in_addr_is_set(address->family, &address->in_addr_peer);
|
||||
if (has_peer)
|
||||
(void) in_addr_to_string(address->family, &address->in_addr_peer, &peer);
|
||||
(void) in_addr_to_string(address->family, &address->in_addr, &addr);
|
||||
has_peer = in_addr_is_set(address->family, &address->in_addr_peer);
|
||||
if (has_peer)
|
||||
(void) in_addr_to_string(address->family, &address->in_addr_peer, &peer);
|
||||
|
||||
if (address->cinfo.ifa_valid != CACHE_INFO_INFINITY_LIFE_TIME)
|
||||
valid_str = format_timespan(valid_buf, FORMAT_TIMESPAN_MAX,
|
||||
address->cinfo.ifa_valid * USEC_PER_SEC,
|
||||
USEC_PER_SEC);
|
||||
if (address->cinfo.ifa_valid != CACHE_INFO_INFINITY_LIFE_TIME)
|
||||
valid_str = format_timespan(valid_buf, FORMAT_TIMESPAN_MAX,
|
||||
address->cinfo.ifa_valid * USEC_PER_SEC,
|
||||
USEC_PER_SEC);
|
||||
|
||||
if (address->cinfo.ifa_prefered != CACHE_INFO_INFINITY_LIFE_TIME)
|
||||
preferred_str = format_timespan(preferred_buf, FORMAT_TIMESPAN_MAX,
|
||||
address->cinfo.ifa_prefered * USEC_PER_SEC,
|
||||
USEC_PER_SEC);
|
||||
if (address->cinfo.ifa_prefered != CACHE_INFO_INFINITY_LIFE_TIME)
|
||||
preferred_str = format_timespan(preferred_buf, FORMAT_TIMESPAN_MAX,
|
||||
address->cinfo.ifa_prefered * USEC_PER_SEC,
|
||||
USEC_PER_SEC);
|
||||
|
||||
log_link_debug(link, "%s address: %s%s%s/%u (valid %s%s, preferred %s%s)",
|
||||
str, strnull(addr), has_peer ? " peer " : "",
|
||||
has_peer ? strnull(peer) : "", address->prefixlen,
|
||||
valid_str ? "for " : "forever", strempty(valid_str),
|
||||
preferred_str ? "for " : "forever", strempty(preferred_str));
|
||||
}
|
||||
log_link_debug(link, "%s address: %s%s%s/%u (valid %s%s, preferred %s%s)",
|
||||
str, strnull(addr), has_peer ? " peer " : "",
|
||||
has_peer ? strnull(peer) : "", address->prefixlen,
|
||||
valid_str ? "for " : "forever", strempty(valid_str),
|
||||
preferred_str ? "for " : "forever", strempty(preferred_str));
|
||||
}
|
||||
|
||||
static int address_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
|
||||
|
||||
@ -213,6 +213,29 @@ static bool neighbor_equal(const Neighbor *n1, const Neighbor *n2) {
|
||||
return neighbor_compare_func(n1, n2) == 0;
|
||||
}
|
||||
|
||||
static void log_neighbor_debug(const Neighbor *neighbor, const char *str, const Link *link) {
|
||||
_cleanup_free_ char *lladdr = NULL, *dst = NULL;
|
||||
|
||||
assert(neighbor);
|
||||
assert(str);
|
||||
|
||||
if (!DEBUG_LOGGING)
|
||||
return;
|
||||
|
||||
if (neighbor->lladdr_size == sizeof(struct ether_addr))
|
||||
(void) ether_addr_to_string_alloc(&neighbor->lladdr.mac, &lladdr);
|
||||
else if (neighbor->lladdr_size == sizeof(struct in_addr))
|
||||
(void) in_addr_to_string(AF_INET, &neighbor->lladdr.ip, &lladdr);
|
||||
else if (neighbor->lladdr_size == sizeof(struct in6_addr))
|
||||
(void) in_addr_to_string(AF_INET6, &neighbor->lladdr.ip, &lladdr);
|
||||
|
||||
(void) in_addr_to_string(neighbor->family, &neighbor->in_addr, &dst);
|
||||
|
||||
log_link_debug(link,
|
||||
"%s neighbor: lladdr: %s, dst: %s",
|
||||
str, strna(lladdr), strna(dst));
|
||||
}
|
||||
|
||||
static int neighbor_configure_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
|
||||
int r;
|
||||
|
||||
@ -249,6 +272,8 @@ static int neighbor_configure(Neighbor *neighbor, Link *link) {
|
||||
assert(link->manager);
|
||||
assert(link->manager->rtnl);
|
||||
|
||||
log_neighbor_debug(neighbor, "Configuring", link);
|
||||
|
||||
r = sd_rtnl_message_new_neigh(link->manager->rtnl, &req, RTM_NEWNEIGH,
|
||||
link->ifindex, neighbor->family);
|
||||
if (r < 0)
|
||||
@ -340,6 +365,8 @@ static int neighbor_remove(Neighbor *neighbor, Link *link) {
|
||||
assert(link->manager);
|
||||
assert(link->manager->rtnl);
|
||||
|
||||
log_neighbor_debug(neighbor, "Removing", link);
|
||||
|
||||
r = sd_rtnl_message_new_neigh(link->manager->rtnl, &req, RTM_DELNEIGH,
|
||||
link->ifindex, neighbor->family);
|
||||
if (r < 0)
|
||||
@ -410,50 +437,9 @@ int link_drop_neighbors(Link *link) {
|
||||
return r;
|
||||
}
|
||||
|
||||
static int manager_rtnl_process_neighbor_lladdr(sd_netlink_message *message, union lladdr_union *lladdr, size_t *size, char **str) {
|
||||
int r;
|
||||
|
||||
assert(message);
|
||||
assert(lladdr);
|
||||
assert(size);
|
||||
assert(str);
|
||||
|
||||
*str = NULL;
|
||||
|
||||
r = sd_netlink_message_read(message, NDA_LLADDR, sizeof(lladdr->ip.in6), &lladdr->ip.in6);
|
||||
if (r >= 0) {
|
||||
*size = sizeof(lladdr->ip.in6);
|
||||
if (in_addr_to_string(AF_INET6, &lladdr->ip, str) < 0)
|
||||
log_warning_errno(r, "Could not print lower address: %m");
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_netlink_message_read(message, NDA_LLADDR, sizeof(lladdr->mac), &lladdr->mac);
|
||||
if (r >= 0) {
|
||||
*size = sizeof(lladdr->mac);
|
||||
*str = new(char, ETHER_ADDR_TO_STRING_MAX);
|
||||
if (!*str) {
|
||||
log_oom();
|
||||
return r;
|
||||
}
|
||||
ether_addr_to_string(&lladdr->mac, *str);
|
||||
return r;
|
||||
}
|
||||
|
||||
r = sd_netlink_message_read(message, NDA_LLADDR, sizeof(lladdr->ip.in), &lladdr->ip.in);
|
||||
if (r >= 0) {
|
||||
*size = sizeof(lladdr->ip.in);
|
||||
if (in_addr_to_string(AF_INET, &lladdr->ip, str) < 0)
|
||||
log_warning_errno(r, "Could not print lower address: %m");
|
||||
return r;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m) {
|
||||
_cleanup_(neighbor_freep) Neighbor *tmp = NULL;
|
||||
_cleanup_free_ char *addr_str = NULL, *lladdr_str = NULL;
|
||||
_cleanup_free_ void *lladdr = NULL;
|
||||
Neighbor *neighbor = NULL;
|
||||
uint16_t type, state;
|
||||
int ifindex, r;
|
||||
@ -523,44 +509,36 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (in_addr_to_string(tmp->family, &tmp->in_addr, &addr_str) < 0)
|
||||
log_link_warning_errno(link, r, "Could not print address: %m");
|
||||
|
||||
r = manager_rtnl_process_neighbor_lladdr(message, &tmp->lladdr, &tmp->lladdr_size, &lladdr_str);
|
||||
r = sd_netlink_message_read_data(message, NDA_LLADDR, &tmp->lladdr_size, &lladdr);
|
||||
if (r < 0) {
|
||||
log_link_warning_errno(link, r, "rtnl: received neighbor message with invalid lladdr, ignoring: %m");
|
||||
log_link_warning_errno(link, r, "rtnl: received neighbor message without valid lladdr, ignoring: %m");
|
||||
return 0;
|
||||
} else if (!IN_SET(tmp->lladdr_size, sizeof(struct ether_addr), sizeof(struct in_addr), sizeof(struct in6_addr))) {
|
||||
log_link_warning(link, "rtnl: received neighbor message with invalid lladdr size (%zu), ignoring: %m", tmp->lladdr_size);
|
||||
return 0;
|
||||
}
|
||||
memcpy(&tmp->lladdr, lladdr, tmp->lladdr_size);
|
||||
|
||||
(void) neighbor_get(link, tmp, &neighbor);
|
||||
|
||||
switch (type) {
|
||||
case RTM_NEWNEIGH:
|
||||
if (neighbor)
|
||||
log_link_debug(link, "Received remembered neighbor: %s->%s",
|
||||
strnull(addr_str), strnull(lladdr_str));
|
||||
log_neighbor_debug(tmp, "Received remembered", link);
|
||||
else {
|
||||
/* A neighbor appeared that we did not request */
|
||||
log_neighbor_debug(tmp, "Remembering foreign", link);
|
||||
r = neighbor_add_foreign(link, tmp, NULL);
|
||||
if (r < 0) {
|
||||
log_link_warning_errno(link, r, "Failed to remember foreign neighbor %s->%s, ignoring: %m",
|
||||
strnull(addr_str), strnull(lladdr_str));
|
||||
log_link_warning_errno(link, r, "Failed to remember foreign neighbor, ignoring: %m");
|
||||
return 0;
|
||||
} else
|
||||
log_link_debug(link, "Remembering foreign neighbor: %s->%s",
|
||||
strnull(addr_str), strnull(lladdr_str));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RTM_DELNEIGH:
|
||||
if (neighbor) {
|
||||
log_link_debug(link, "Forgetting neighbor: %s->%s",
|
||||
strnull(addr_str), strnull(lladdr_str));
|
||||
(void) neighbor_free(neighbor);
|
||||
} else
|
||||
log_link_debug(link, "Kernel removed a neighbor we don't remember: %s->%s, ignoring.",
|
||||
strnull(addr_str), strnull(lladdr_str));
|
||||
log_neighbor_debug(tmp, neighbor ? "Forgetting" : "Kernel removed unknown", link);
|
||||
neighbor_free(neighbor);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@ -336,23 +336,24 @@ set_manager:
|
||||
}
|
||||
|
||||
static void log_nexthop_debug(const NextHop *nexthop, uint32_t id, const char *str, const Link *link) {
|
||||
_cleanup_free_ char *gw = NULL;
|
||||
|
||||
assert(nexthop);
|
||||
assert(str);
|
||||
|
||||
/* link may be NULL. */
|
||||
|
||||
if (DEBUG_LOGGING) {
|
||||
_cleanup_free_ char *gw = NULL;
|
||||
if (!DEBUG_LOGGING)
|
||||
return;
|
||||
|
||||
(void) in_addr_to_string(nexthop->family, &nexthop->gw, &gw);
|
||||
(void) in_addr_to_string(nexthop->family, &nexthop->gw, &gw);
|
||||
|
||||
if (nexthop->id == id)
|
||||
log_link_debug(link, "%s nexthop: id: %"PRIu32", gw: %s, blackhole: %s",
|
||||
str, nexthop->id, strna(gw), yes_no(nexthop->blackhole));
|
||||
else
|
||||
log_link_debug(link, "%s nexthop: id: %"PRIu32"→%"PRIu32", gw: %s, blackhole: %s",
|
||||
str, nexthop->id, id, strna(gw), yes_no(nexthop->blackhole));
|
||||
}
|
||||
if (nexthop->id == id)
|
||||
log_link_debug(link, "%s nexthop: id: %"PRIu32", gw: %s, blackhole: %s",
|
||||
str, nexthop->id, strna(gw), yes_no(nexthop->blackhole));
|
||||
else
|
||||
log_link_debug(link, "%s nexthop: id: %"PRIu32"→%"PRIu32", gw: %s, blackhole: %s",
|
||||
str, nexthop->id, id, strna(gw), yes_no(nexthop->blackhole));
|
||||
}
|
||||
|
||||
static int nexthop_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {
|
||||
|
||||
@ -605,35 +605,36 @@ static bool route_type_is_reject(const Route *route) {
|
||||
}
|
||||
|
||||
static void log_route_debug(const Route *route, const char *str, const Link *link, const Manager *m) {
|
||||
_cleanup_free_ char *dst = NULL, *src = NULL, *gw = NULL, *prefsrc = NULL,
|
||||
*table = NULL, *scope = NULL, *proto = NULL;
|
||||
|
||||
assert(route);
|
||||
assert(str);
|
||||
assert(m);
|
||||
|
||||
/* link may be NULL. */
|
||||
|
||||
if (DEBUG_LOGGING) {
|
||||
_cleanup_free_ char *dst = NULL, *src = NULL, *gw = NULL, *prefsrc = NULL,
|
||||
*table = NULL, *scope = NULL, *proto = NULL;
|
||||
if (!DEBUG_LOGGING)
|
||||
return;
|
||||
|
||||
if (in_addr_is_set(route->family, &route->dst))
|
||||
(void) in_addr_prefix_to_string(route->family, &route->dst, route->dst_prefixlen, &dst);
|
||||
if (in_addr_is_set(route->family, &route->src))
|
||||
(void) in_addr_to_string(route->family, &route->src, &src);
|
||||
if (in_addr_is_set(route->gw_family, &route->gw))
|
||||
(void) in_addr_to_string(route->gw_family, &route->gw, &gw);
|
||||
if (in_addr_is_set(route->family, &route->prefsrc))
|
||||
(void) in_addr_to_string(route->family, &route->prefsrc, &prefsrc);
|
||||
(void) route_scope_to_string_alloc(route->scope, &scope);
|
||||
(void) manager_get_route_table_to_string(m, route->table, &table);
|
||||
(void) route_protocol_full_to_string_alloc(route->protocol, &proto);
|
||||
if (in_addr_is_set(route->family, &route->dst))
|
||||
(void) in_addr_prefix_to_string(route->family, &route->dst, route->dst_prefixlen, &dst);
|
||||
if (in_addr_is_set(route->family, &route->src))
|
||||
(void) in_addr_to_string(route->family, &route->src, &src);
|
||||
if (in_addr_is_set(route->gw_family, &route->gw))
|
||||
(void) in_addr_to_string(route->gw_family, &route->gw, &gw);
|
||||
if (in_addr_is_set(route->family, &route->prefsrc))
|
||||
(void) in_addr_to_string(route->family, &route->prefsrc, &prefsrc);
|
||||
(void) route_scope_to_string_alloc(route->scope, &scope);
|
||||
(void) manager_get_route_table_to_string(m, route->table, &table);
|
||||
(void) route_protocol_full_to_string_alloc(route->protocol, &proto);
|
||||
|
||||
log_link_debug(link,
|
||||
"%s route: dst: %s, src: %s, gw: %s, prefsrc: %s, scope: %s, table: %s, proto: %s, type: %s, nexthop: %"PRIu32", priority: %"PRIu32,
|
||||
str, strna(dst), strna(src), strna(gw), strna(prefsrc),
|
||||
strna(scope), strna(table), strna(proto),
|
||||
strna(route_type_to_string(route->type)),
|
||||
route->nexthop_id, route->priority);
|
||||
}
|
||||
log_link_debug(link,
|
||||
"%s route: dst: %s, src: %s, gw: %s, prefsrc: %s, scope: %s, table: %s, proto: %s, type: %s, nexthop: %"PRIu32", priority: %"PRIu32,
|
||||
str, strna(dst), strna(src), strna(gw), strna(prefsrc),
|
||||
strna(scope), strna(table), strna(proto),
|
||||
strna(route_type_to_string(route->type)),
|
||||
route->nexthop_id, route->priority);
|
||||
}
|
||||
|
||||
static int route_set_netlink_message(const Route *route, sd_netlink_message *req, Link *link) {
|
||||
|
||||
@ -391,6 +391,8 @@ static int routing_policy_rule_consume_foreign(Manager *m, RoutingPolicyRule *ru
|
||||
}
|
||||
|
||||
static void log_routing_policy_rule_debug(const RoutingPolicyRule *rule, int family, const char *str, const Link *link, const Manager *m) {
|
||||
_cleanup_free_ char *from = NULL, *to = NULL, *table = NULL;
|
||||
|
||||
assert(rule);
|
||||
assert(IN_SET(family, AF_INET, AF_INET6));
|
||||
assert(str);
|
||||
@ -398,18 +400,17 @@ static void log_routing_policy_rule_debug(const RoutingPolicyRule *rule, int fam
|
||||
|
||||
/* link may be NULL. */
|
||||
|
||||
if (DEBUG_LOGGING) {
|
||||
_cleanup_free_ char *from = NULL, *to = NULL, *table = NULL;
|
||||
if (!DEBUG_LOGGING)
|
||||
return;
|
||||
|
||||
(void) in_addr_prefix_to_string(family, &rule->from, rule->from_prefixlen, &from);
|
||||
(void) in_addr_prefix_to_string(family, &rule->to, rule->to_prefixlen, &to);
|
||||
(void) manager_get_route_table_to_string(m, rule->table, &table);
|
||||
(void) in_addr_prefix_to_string(family, &rule->from, rule->from_prefixlen, &from);
|
||||
(void) in_addr_prefix_to_string(family, &rule->to, rule->to_prefixlen, &to);
|
||||
(void) manager_get_route_table_to_string(m, rule->table, &table);
|
||||
|
||||
log_link_debug(link,
|
||||
"%s routing policy rule: priority: %"PRIu32", %s -> %s, iif: %s, oif: %s, table: %s",
|
||||
str, rule->priority, strna(from), strna(to),
|
||||
strna(rule->iif), strna(rule->oif), strna(table));
|
||||
}
|
||||
log_link_debug(link,
|
||||
"%s routing policy rule: priority: %"PRIu32", %s -> %s, iif: %s, oif: %s, table: %s",
|
||||
str, rule->priority, strna(from), strna(to),
|
||||
strna(rule->iif), strna(rule->oif), strna(table));
|
||||
}
|
||||
|
||||
static int routing_policy_rule_set_netlink_message(const RoutingPolicyRule *rule, sd_netlink_message *m, Link *link) {
|
||||
|
||||
@ -4,7 +4,10 @@ Name=server
|
||||
Address=192.168.5.1/24
|
||||
IPForward=ipv4
|
||||
DHCPServer=yes
|
||||
|
||||
[DHCPServer]
|
||||
BindToInterface=no
|
||||
PoolOffset=150
|
||||
PoolSize=1
|
||||
DNS=192.168.5.1
|
||||
NTP=192.168.5.1
|
||||
|
||||
@ -11,3 +11,5 @@ PoolOffset=10
|
||||
PoolSize=50
|
||||
EmitRouter=yes
|
||||
Timezone=Europe/Berlin
|
||||
DNS=192.168.5.1
|
||||
NTP=192.168.5.1
|
||||
|
||||
@ -9,3 +9,7 @@ IPv6SendRA=yes
|
||||
|
||||
[IPv6Prefix]
|
||||
Prefix=2002:da8:1:0::/64
|
||||
|
||||
[DHCPServer]
|
||||
DNS=192.168.5.1
|
||||
NTP=192.168.5.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user