libifconfig: fix ifconfig_set_metric

Due to a copy/paste error, ifconfig_set_metric actually set the mtu, not the
metric.

See Also: https://github.com/Savagedlight/libifconfig/issues/48

MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
This commit is contained in:
Alan Somers 2018-02-21 20:45:43 +00:00
parent 12487c7243
commit ce0d4434ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329750

View file

@ -377,13 +377,13 @@ ifconfig_get_mtu(ifconfig_handle_t *h, const char *name, int *mtu)
}
int
ifconfig_set_metric(ifconfig_handle_t *h, const char *name, const int mtu)
ifconfig_set_metric(ifconfig_handle_t *h, const char *name, const int metric)
{
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
(void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
ifr.ifr_mtu = mtu;
ifr.ifr_metric = metric;
if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCSIFMETRIC,
&ifr) < 0) {