<term><varname>UseDNS=</varname></term>
<term><varname>UseNTP=</varname></term>
<listitem>
- <para>As in the <literal>[DHCP]</literal> section.</para>
+ <para>As in the <literal>[DHCPv4]</literal> section.</para>
</listitem>
</varlistentry>
* for the application itself.
*/
-assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1)
+assert_cc(STRLEN(__FILE__) > STRLEN(RELATIVE_SOURCE_PATH) + 1);
#define PROJECT_FILE (__FILE__ + STRLEN(RELATIVE_SOURCE_PATH) + 1)
int log_open(void);
#endif
#define assert_not_reached(t) \
- do { \
- log_assert_failed_unreachable(t, PROJECT_FILE, __LINE__, __PRETTY_FUNCTION__); \
- } while (false)
+ log_assert_failed_unreachable(t, PROJECT_FILE, __LINE__, __PRETTY_FUNCTION__)
#if defined(static_assert)
#define assert_cc(expr) \
- static_assert(expr, #expr);
+ static_assert(expr, #expr)
#else
#define assert_cc(expr) \
struct CONCATENATE(_assert_struct_, __COUNTER__) { \
char x[(expr) ? 0 : -1]; \
- };
+ }
#endif
#define assert_return(expr, r) \
* type for the array, in the hope that checkers such as ubsan don't complain that the initializers for \
* the array are not representable by the base type. Ideally we'd use typeof(x) as base type, but that \
* doesn't work, as we want to use this on bitfields and gcc refuses typeof() on bitfields.) */ \
- assert_cc((sizeof((long double[]){__VA_ARGS__})/sizeof(long double)) <= 20); \
+ static const long double __assert_in_set[] _unused_ = { __VA_ARGS__ }; \
+ assert_cc(ELEMENTSOF(__assert_in_set) <= 20); \
switch(x) { \
FOR_EACH_MAKE_CASE(__VA_ARGS__) \
_found = true; \
#error "Unknown pid_t size"
#endif
-assert_cc(TASKS_MAX <= (unsigned long) PID_T_MAX)
+assert_cc(TASKS_MAX <= (unsigned long) PID_T_MAX);
/* Like TAKE_PTR() but for child PIDs, resetting them to 0 */
#define TAKE_PID(pid) \
#include "list.h"
#include "sparse-endian.h"
-assert_cc(SD_RADV_DEFAULT_MIN_TIMEOUT_USEC <= SD_RADV_DEFAULT_MAX_TIMEOUT_USEC)
+assert_cc(SD_RADV_DEFAULT_MIN_TIMEOUT_USEC <= SD_RADV_DEFAULT_MAX_TIMEOUT_USEC);
#define SD_RADV_MAX_INITIAL_RTR_ADVERT_INTERVAL_USEC (16*USEC_PER_SEC)
#define SD_RADV_MAX_INITIAL_RTR_ADVERTISEMENTS 3
r = sd_netlink_message_get_errno(m);
if (r < 0 && r != -EEXIST) {
- if (link->rtnl_extended_attrs) {
- log_link_warning(link, "Could not set extended netlink attributes, reverting to fallback mechanism");
-
- link->rtnl_extended_attrs = false;
- dhcp6_lease_address_acquired(link->dhcp6_client, link);
-
- return 1;
- }
-
log_link_error_errno(link, r, "Could not set DHCPv6 address: %m");
-
link_enter_failed(link);
return 1;
- }
- if (r >= 0)
+ } else if (r >= 0)
(void) manager_rtnl_process_address(rtnl, m, link->manager);
r = link_request_set_routes(link);
addr->family = AF_INET6;
addr->in_addr.in6 = *ip6_addr;
-
addr->flags = IFA_F_NOPREFIXROUTE;
addr->prefixlen = 128;
-
addr->cinfo.ifa_prefered = lifetime_preferred;
addr->cinfo.ifa_valid = lifetime_valid;
(void) dhcp6_lease_pd_prefix_lost(client, link);
(void) dhcp6_prefix_remove_all(link->manager, link);
+ link_dirty(link);
link->dhcp6_configured = false;
break;
return;
}
+ link_dirty(link);
link->dhcp6_configured = true;
break;
.n_ref = 1,
.manager = manager,
.state = LINK_STATE_PENDING,
- .rtnl_extended_attrs = true,
.ifindex = ifindex,
.iftype = iftype,
.sysctl_ipv6_enabled = -1,
sd_radv *radv;
sd_dhcp6_client *dhcp6_client;
- bool rtnl_extended_attrs;
/* This is about LLDP reception */
sd_lldp *lldp;
while ((a = hashmap_first_key(m->dhcp6_prefixes)))
(void) dhcp6_prefix_remove(m, a);
- hashmap_free(m->dhcp6_prefixes);
+ m->dhcp6_prefixes = hashmap_free(m->dhcp6_prefixes);
while ((link = hashmap_steal_first(m->links))) {
if (link->dhcp6_client)
#define EDNS0_OPT_DO (1<<15)
-assert_cc(DNS_PACKET_SIZE_START > DNS_PACKET_HEADER_SIZE)
+assert_cc(DNS_PACKET_SIZE_START > DNS_PACKET_HEADER_SIZE);
typedef struct DnsPacketRewinder {
DnsPacket *packet;
int json_dispatch_uint32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata);
int json_dispatch_int32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata);
-assert_cc(sizeof(uintmax_t) == sizeof(uint64_t))
+assert_cc(sizeof(uintmax_t) == sizeof(uint64_t));
#define json_dispatch_uint64 json_dispatch_unsigned
-assert_cc(sizeof(intmax_t) == sizeof(int64_t))
+assert_cc(sizeof(intmax_t) == sizeof(int64_t));
#define json_dispatch_int64 json_dispatch_integer
static inline int json_dispatch_level(JsonDispatchFlags flags) {
self.wait_address('veth99', r'inet 192.168.5.[0-9]*/24 brd 192.168.5.255 scope global dynamic', ipv='-4')
self.wait_address('veth99', r'inet6 2600::[0-9a-f]*/128 scope global (?:dynamic noprefixroute|noprefixroute dynamic)', ipv='-6')
- time.sleep(10)
+ time.sleep(3)
output = check_output(*resolvectl_cmd, 'dns', 'veth99', env=env)
print(output)
self.assertRegex(output, '192.168.5.1')
self.wait_address('veth99', r'inet 192.168.5.[0-9]*/24 brd 192.168.5.255 scope global dynamic', ipv='-4')
self.wait_address('veth99', r'inet6 2600::[0-9a-f]*/128 scope global (?:dynamic noprefixroute|noprefixroute dynamic)', ipv='-6')
- time.sleep(10)
+ time.sleep(3)
output = check_output(*resolvectl_cmd, 'dns', 'veth99', env=env)
print(output)
self.assertNotRegex(output, '192.168.5.1')
self.wait_address('veth99', r'inet 192.168.5.[0-9]*/24 brd 192.168.5.255 scope global dynamic', ipv='-4')
self.wait_address('veth99', r'inet6 2600::[0-9a-f]*/128 scope global (?:dynamic noprefixroute|noprefixroute dynamic)', ipv='-6')
- time.sleep(10)
+ time.sleep(3)
output = check_output(*resolvectl_cmd, 'dns', 'veth99', env=env)
print(output)
self.assertRegex(output, '192.168.5.1')
self.wait_address('veth99', r'inet 192.168.5.[0-9]*/24 brd 192.168.5.255 scope global dynamic', ipv='-4')
self.wait_address('veth99', r'inet6 2600::[0-9a-f]*/128 scope global (?:dynamic noprefixroute|noprefixroute dynamic)', ipv='-6')
- time.sleep(10)
+ time.sleep(3)
output = check_output(*resolvectl_cmd, 'dns', 'veth99', env=env)
print(output)
self.assertRegex(output, '192.168.5.1')