Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a34a5f5 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Steve Kondik
Browse files

libnetutils: add ifc_set_mtu

Change-Id: I3031e9ee38583648350f2c46baa7a9a714b9ea1e
parent 157bc39f
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -985,3 +985,19 @@ int ifc_get_mtu(const char *name, int *mtuSz)

    return -1;
}

// Required for Broadcom RILD
int ifc_set_mtu(const char *name, int mtuSz)
{
    struct ifreq ifr;
    int ret;
    ifc_init_ifr(name, &ifr);
    ifr.ifr_mtu = mtuSz;

    ret = ioctl(ifc_ctl_sock, SIOCSIFMTU, &ifr);
    if (ret < 0) {
        printerr("ifc_set_mtu: SIOCSIFMTU failed: %d\n", ret);
    }

    return ret;
}