net: ppp: ipcp: negotiate DNS servers and optionally use them

We now negotiate DNS servers in the IPCP configuration. This has been
observed to speed up the connection setup. The received DNS servers
are used by the DNS resolver library, but we leave it optional since
the static server list might be preferable.

Increase MAX_IPCP_OPTIONS to 4 so that we can nack all RFC 1877
options.

Signed-off-by: Göran Weinholt <goran.weinholt@endian.se>
This commit is contained in:
Göran Weinholt 2020-02-17 14:40:32 +01:00 committed by Jukka Rissanen
commit 091f630014
5 changed files with 139 additions and 27 deletions

View file

@ -175,6 +175,20 @@ enum ipcp_option_type {
/** IP Address */
IPCP_OPTION_IP_ADDRESS = 3,
/* RFC 1877 */
/** Primary DNS Server Address */
IPCP_OPTION_DNS1 = 129,
/** Primary NBNS Server Address */
IPCP_OPTION_NBNS1 = 130,
/** Secondary DNS Server Address */
IPCP_OPTION_DNS2 = 131,
/** Secondary NBNS Server Address */
IPCP_OPTION_NBNS2 = 132,
} __packed;
/**
@ -358,6 +372,8 @@ struct lcp_options {
struct ipcp_options {
/** IPv4 address */
struct in_addr address;
struct in_addr dns1_address;
struct in_addr dns2_address;
};
struct ipv6cp_options {