in_gif.c (662c13053f4bf2d6245ba7e2b66c10d1cd5c1fb9) in_gif.c (c8ee75f2315e8267ad814dc5b4645ef205f0e0e1)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * Copyright (c) 2018 Andrey V. Elsukov <ae@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 182 unchanged lines hidden (view full) ---

191 }
192 return (0);
193}
194
195int
196in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t data)
197{
198 struct ifreq *ifr = (struct ifreq *)data;
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * Copyright (c) 2018 Andrey V. Elsukov <ae@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 182 unchanged lines hidden (view full) ---

191 }
192 return (0);
193}
194
195int
196in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t data)
197{
198 struct ifreq *ifr = (struct ifreq *)data;
199 struct epoch_tracker et;
199 struct sockaddr_in *dst, *src;
200 struct ip *ip;
201 int error;
202
203 /* NOTE: we are protected with gif_ioctl_sx lock */
204 error = EINVAL;
205 switch (cmd) {
206 case SIOCSIFPHYADDR:

--- 33 unchanged lines hidden (view full) ---

240 CK_LIST_REMOVE(sc, chain);
241 GIF_WAIT();
242 free(sc->gif_hdr, M_GIF);
243 /* XXX: should we notify about link state change? */
244 }
245 sc->gif_family = AF_INET;
246 sc->gif_iphdr = ip;
247 in_gif_attach(sc);
200 struct sockaddr_in *dst, *src;
201 struct ip *ip;
202 int error;
203
204 /* NOTE: we are protected with gif_ioctl_sx lock */
205 error = EINVAL;
206 switch (cmd) {
207 case SIOCSIFPHYADDR:

--- 33 unchanged lines hidden (view full) ---

241 CK_LIST_REMOVE(sc, chain);
242 GIF_WAIT();
243 free(sc->gif_hdr, M_GIF);
244 /* XXX: should we notify about link state change? */
245 }
246 sc->gif_family = AF_INET;
247 sc->gif_iphdr = ip;
248 in_gif_attach(sc);
249 NET_EPOCH_ENTER(et);
248 in_gif_set_running(sc);
250 in_gif_set_running(sc);
251 NET_EPOCH_EXIT(et);
249 break;
250 case SIOCGIFPSRCADDR:
251 case SIOCGIFPDSTADDR:
252 if (sc->gif_family != AF_INET) {
253 error = EADDRNOTAVAIL;
254 break;
255 }
256 src = (struct sockaddr_in *)&ifr->ifr_addr;

--- 204 unchanged lines hidden ---
252 break;
253 case SIOCGIFPSRCADDR:
254 case SIOCGIFPDSTADDR:
255 if (sc->gif_family != AF_INET) {
256 error = EADDRNOTAVAIL;
257 break;
258 }
259 src = (struct sockaddr_in *)&ifr->ifr_addr;

--- 204 unchanged lines hidden ---