Lines Matching refs:ifreq
246 struct ifreq ifreq = { 0 }; in open_netdev() local
249 SAFE_IOCTL(pts, SIOCGIFNAME, ifreq.ifr_name); in open_netdev()
250 tst_res(TINFO, "Netdev is %s", ifreq.ifr_name); in open_netdev()
254 ifreq.ifr_mtu = ldisc->mtu; in open_netdev()
255 if (ioctl(sk, SIOCSIFMTU, &ifreq)) in open_netdev()
257 SAFE_IOCTL(sk, SIOCGIFMTU, &ifreq); in open_netdev()
258 mtu = ifreq.ifr_mtu; in open_netdev()
261 SAFE_IOCTL(sk, SIOCGIFFLAGS, &ifreq); in open_netdev()
262 ifreq.ifr_flags |= IFF_UP | IFF_RUNNING; in open_netdev()
263 SAFE_IOCTL(sk, SIOCSIFFLAGS, &ifreq); in open_netdev()
264 SAFE_IOCTL(sk, SIOCGIFFLAGS, &ifreq); in open_netdev()
266 if (!(ifreq.ifr_flags & IFF_UP)) in open_netdev()
269 SAFE_IOCTL(sk, SIOCGIFINDEX, &ifreq); in open_netdev()
273 lla.sll_ifindex = ifreq.ifr_ifindex; in open_netdev()
276 tst_res(TINFO, "Bound netdev %d to socket %d", ifreq.ifr_ifindex, sk); in open_netdev()