Lines Matching defs:sock_fd
84 static int sock_fd = -1; /* socket for doing interface ioctls */
213 sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
214 if (sock_fd < 0)
247 if (sock_fd >= 0)
248 close(sock_fd);
616 if (ifunit >= 0 && ioctl(sock_fd, SIOCSIFMTU, (caddr_t) &ifr) < 0)
683 if (ioctl(sock_fd, SIOCGPPPSTATS, &req) < 0) {
739 if (ioctl(sock_fd, SIOCGIFCONF, &ifc) < 0) {
759 if (ioctl(sock_fd, SIOCGIFFLAGS, &ifreq) < 0)
767 if (ioctl(sock_fd, SIOCGIFNETMASK, &ifreq) < 0)
834 if (ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) {
841 if (ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) {
866 if (ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) {
874 if (ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) {
905 if (ioctl(sock_fd, SIOCSIFADDR, (caddr_t) &ifr) < 0) {
919 if (ioctl(sock_fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) {
932 if (ioctl(sock_fd, SIOCSIFNETMASK, (caddr_t) &ifr) < 0) {
955 if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
1012 if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
1024 if (ioctl(sock_fd, SIOCSIFADDR, (caddr_t) &ifr) < 0) {