MCPcopy Create free account
hub / github.com/F-Stack/f-stack / isnd6defif

Function isnd6defif

tools/ifconfig/af_nd6.c:146–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146static int
147isnd6defif(int s)
148{
149 struct in6_ndifreq ndifreq;
150 unsigned int ifindex;
151 int error;
152
153 memset(&ndifreq, 0, sizeof(ndifreq));
154 strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname));
155
156 ifindex = if_nametoindex(ndifreq.ifname);
157#ifndef FSTACK
158 error = ioctl(s, SIOCGDEFIFACE_IN6, (caddr_t)&ndifreq);
159#else
160 error = ioctl_va(s, SIOCGDEFIFACE_IN6, (caddr_t)&ndifreq, 1, AF_INET6);
161#endif
162 if (error) {
163 warn("ioctl(SIOCGDEFIFACE_IN6)");
164 return (error);
165 }
166 return (ndifreq.ifindex == ifindex);
167}
168
169void
170nd6_status(int s)

Callers 2

setnd6defifFunction · 0.85
nd6_statusFunction · 0.85

Calls 5

memsetFunction · 0.85
if_nametoindexFunction · 0.85
ioctl_vaFunction · 0.85
strlcpyFunction · 0.50
ioctlFunction · 0.50

Tested by

no test coverage detected