summaryrefslogtreecommitdiff
path: root/src/network/networkd-ndisc.c
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@users.noreply.github.com>2016-11-24 03:02:19 +0530
committerLennart Poettering <lennart@poettering.net>2016-11-23 22:32:19 +0100
commitd6fceaf1f7ff765bdc3b135f3d3676ec689da312 (patch)
treec460650afe13fa5f2e6a95373afa32355daf9bcc /src/network/networkd-ndisc.c
parent99245111ac4b2b4275c8caeb03c14f7870afbb85 (diff)
networkd: handle MTU field in IPv6 RA (#4719)
This patch handles the custom MTU field in IPv6 RA. fixes RFE #4464
Diffstat (limited to 'src/network/networkd-ndisc.c')
-rw-r--r--src/network/networkd-ndisc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index 70283e5347..5320592f7a 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -56,6 +56,7 @@ static void ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
struct in6_addr gateway;
uint16_t lifetime;
unsigned preference;
+ uint32_t mtu;
usec_t time_now;
int r;
Address *address;
@@ -116,6 +117,12 @@ static void ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
return;
}
+ r = sd_ndisc_router_get_mtu(rt, &mtu);
+ if (r < 0) {
+ log_link_warning_errno(link, r, "Failed to get default router MTU from RA: %m");
+ return;
+ }
+
r = route_new(&route);
if (r < 0) {
log_link_error_errno(link, r, "Could not allocate route: %m");
@@ -128,6 +135,7 @@ static void ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
route->pref = preference;
route->gw.in6 = gateway;
route->lifetime = time_now + lifetime * USEC_PER_SEC;
+ route->mtu = mtu;
r = route_configure(route, link, ndisc_netlink_handler);
if (r < 0) {