X Tutup
Skip to content

Commit 3abdd4b

Browse files
TheJJyuwata
authored andcommitted
network-generator: support link6 network configuration
this just brings up an interface in order to have IPv6 link local connectivity.
1 parent 9ff2b35 commit 3abdd4b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/network/generator/network-generator.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
/*
1818
# .network
19-
ip={dhcp|on|any|dhcp6|auto6|either6}
20-
ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]]
21-
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<mtu>][:<macaddr>]]
22-
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
19+
ip={dhcp|on|any|dhcp6|auto6|either6|link6}
20+
ip=<interface>:{dhcp|on|any|dhcp6|auto6|link6}[:[<mtu>][:<macaddr>]]
21+
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|link6|ibft}[:[<mtu>][:<macaddr>]]
22+
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|link6|ibft}[:[<dns1>][:<dns2>]]
2323
rd.route=<net>/<netmask>:<gateway>[:<interface>]
2424
nameserver=<IP> [nameserver=<IP> ...]
2525
rd.peerdns=0
@@ -51,6 +51,7 @@ static const char * const dracut_dhcp_type_table[_DHCP_TYPE_MAX] = {
5151
[DHCP_TYPE_AUTO6] = "auto6",
5252
[DHCP_TYPE_EITHER6] = "either6",
5353
[DHCP_TYPE_IBFT] = "ibft",
54+
[DHCP_TYPE_LINK6] = "link6",
5455
};
5556

5657
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(dracut_dhcp_type, DHCPType);
@@ -65,6 +66,7 @@ static const char * const networkd_dhcp_type_table[_DHCP_TYPE_MAX] = {
6566
[DHCP_TYPE_AUTO6] = "no", /* TODO: enable other setting? */
6667
[DHCP_TYPE_EITHER6] = "ipv6", /* TODO: enable other setting? */
6768
[DHCP_TYPE_IBFT] = "no",
69+
[DHCP_TYPE_LINK6] = "no",
6870
};
6971

7072
DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(networkd_dhcp_type, DHCPType);
@@ -566,8 +568,8 @@ static int parse_cmdline_ip_address(Context *context, int family, const char *va
566568
unsigned char prefixlen;
567569
int r;
568570

569-
/* ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<mtu>][:<macaddr>]]
570-
* ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]] */
571+
/* ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft|link6}[:[<mtu>][:<macaddr>]]
572+
* ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft|link6}[:[<dns1>][:<dns2>]] */
571573

572574
r = parse_ip_address_one(family, &value, &addr);
573575
if (r < 0)
@@ -660,7 +662,7 @@ static int parse_cmdline_ip_interface(Context *context, const char *value) {
660662
const char *ifname, *dhcp_type, *p;
661663
int r;
662664

663-
/* ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] */
665+
/* ip=<interface>:{dhcp|on|any|dhcp6|auto6|link6}[:[<mtu>][:<macaddr>]] */
664666

665667
p = strchr(value, ':');
666668
if (!p)
@@ -694,7 +696,7 @@ static int parse_cmdline_ip(Context *context, const char *key, const char *value
694696

695697
p = strchr(value, ':');
696698
if (!p)
697-
/* ip={dhcp|on|any|dhcp6|auto6|either6} */
699+
/* ip={dhcp|on|any|dhcp6|auto6|either6|link6} */
698700
return network_set_dhcp_type(context, "", value);
699701

700702
if (value[0] == '[')

src/network/generator/network-generator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ typedef enum DHCPType {
1818
DHCP_TYPE_AUTO6,
1919
DHCP_TYPE_EITHER6,
2020
DHCP_TYPE_IBFT,
21+
DHCP_TYPE_LINK6,
2122
_DHCP_TYPE_MAX,
2223
_DHCP_TYPE_INVALID = -EINVAL,
2324
} DHCPType;

0 commit comments

Comments
 (0)
X Tutup