mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 10:48:02 +00:00
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:
parent
12487c7243
commit
ce0d4434ae
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329750
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue