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

Function vlan_set

tools/ifconfig/ifvlan.c:189–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189static void
190vlan_set(int s, struct ifreq *ifr)
191{
192 if (params.vlr_tag != NOTAG && params.vlr_parent[0] != '\0') {
193 ifr->ifr_data = (caddr_t) &params;
194#ifndef FSTACK
195 if (ioctl(s, SIOCSETVLAN, (caddr_t)ifr) == -1)
196#else
197 size_t offset = (char *)&(ifr->ifr_data) - (char *)ifr;
198 size_t clen = sizeof(params);
199 if (ioctl_va(s, SIOCSETVLAN, ifr, 3, offset, ifr->ifr_data, clen) == -1)
200#endif
201 err(1, "SIOCSETVLAN");
202 }
203}
204
205static
206DECL_CMD_FUNC(setvlantag, val, d)

Callers 1

ifvlan.cFile · 0.85

Calls 2

ioctl_vaFunction · 0.85
ioctlFunction · 0.50

Tested by

no test coverage detected