mirror of
https://github.com/systemd/systemd.git
synced 2024-12-14 04:33:37 +08:00
parent
288a4787a5
commit
21a925a4ac
@ -574,7 +574,7 @@ static int parse_netmask_or_prefixlen(int family, const char **value, unsigned c
|
|||||||
|
|
||||||
static int parse_cmdline_ip_address(Context *context, int family, const char *value) {
|
static int parse_cmdline_ip_address(Context *context, int family, const char *value) {
|
||||||
union in_addr_union addr = {}, peer = {}, gateway = {};
|
union in_addr_union addr = {}, peer = {}, gateway = {};
|
||||||
const char *hostname, *ifname, *dhcp_type, *dns, *p;
|
const char *hostname = NULL, *ifname, *dhcp_type, *dns, *p;
|
||||||
unsigned char prefixlen;
|
unsigned char prefixlen;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -599,9 +599,11 @@ static int parse_cmdline_ip_address(Context *context, int family, const char *va
|
|||||||
if (!p)
|
if (!p)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (p != value) {
|
||||||
hostname = strndupa(value, p - value);
|
hostname = strndupa(value, p - value);
|
||||||
if (!hostname_is_valid(hostname, false))
|
if (!hostname_is_valid(hostname, false))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
value = p + 1;
|
value = p + 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user