Extend --ra-param mtu: field to allow an interface name.

This commit is contained in:
Vladislav Grishenko
2017-04-24 22:34:45 +01:00
committed by Simon Kelley
parent 5a7212c70e
commit 6ec5f5c427
6 changed files with 20 additions and 6 deletions

View File

@@ -408,7 +408,8 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad
available from SIOCGIFMTU */
if (mtu == 0)
{
sprintf(daemon->namebuff, "/proc/sys/net/ipv6/conf/%s/mtu", iface_name);
char *mtu_name = ra_param ? ra_param->mtu_name : NULL;
sprintf(daemon->namebuff, "/proc/sys/net/ipv6/conf/%s/mtu", mtu_name ? : iface_name);
if ((f = fopen(daemon->namebuff, "r")))
{
if (fgets(daemon->namebuff, MAXDNAME, f))