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

Function gre_ioctl

freebsd/net/if_gre.c:232–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static int
233gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
234{
235 struct ifreq *ifr = (struct ifreq *)data;
236 struct gre_softc *sc;
237 uint32_t opt;
238 int error;
239
240 switch (cmd) {
241 case SIOCSIFMTU:
242 /* XXX: */
243 if (ifr->ifr_mtu < 576)
244 return (EINVAL);
245 ifp->if_mtu = ifr->ifr_mtu;
246 return (0);
247 case SIOCSIFADDR:
248 ifp->if_flags |= IFF_UP;
249 case SIOCSIFFLAGS:
250 case SIOCADDMULTI:
251 case SIOCDELMULTI:
252 return (0);
253 case GRESADDRS:
254 case GRESADDRD:
255 case GREGADDRS:
256 case GREGADDRD:
257 case GRESPROTO:
258 case GREGPROTO:
259 return (EOPNOTSUPP);
260 }
261 sx_xlock(&gre_ioctl_sx);
262 sc = ifp->if_softc;
263 if (sc == NULL) {
264 error = ENXIO;
265 goto end;
266 }
267 error = 0;
268 switch (cmd) {
269 case SIOCDIFPHYADDR:
270 if (sc->gre_family == 0)
271 break;
272 gre_delete_tunnel(sc);
273 break;
274#ifdef INET
275 case SIOCSIFPHYADDR:
276 case SIOCGIFPSRCADDR:
277 case SIOCGIFPDSTADDR:
278 error = in_gre_ioctl(sc, cmd, data);
279 break;
280#endif
281#ifdef INET6
282 case SIOCSIFPHYADDR_IN6:
283 case SIOCGIFPSRCADDR_IN6:
284 case SIOCGIFPDSTADDR_IN6:
285 error = in6_gre_ioctl(sc, cmd, data);
286 break;
287#endif
288 case SIOCGTUNFIB:
289 ifr->ifr_fib = sc->gre_fibnum;

Callers

nothing calls this directly

Calls 10

gre_delete_tunnelFunction · 0.85
in_gre_ioctlFunction · 0.85
in6_gre_ioctlFunction · 0.85
ifr_data_get_ptrFunction · 0.85
in_gre_setoptsFunction · 0.85
in6_gre_setoptsFunction · 0.85
if_link_state_changeFunction · 0.85
priv_checkFunction · 0.50
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected