ip_gre.c (2a4bd982d0530863c7fd2aa1ff2b8de27b8896c7) ip_gre.c (c8ee75f2315e8267ad814dc5b4645ef205f0e0e1)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-NetBSD
3 *
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * Copyright (c) 2014, 2018 Andrey V. Elsukov <ae@FreeBSD.org>
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation

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

358 soclose(gs->so);
359 free(s, M_GRE);
360 return (error);
361}
362
363static int
364in_gre_attach(struct gre_softc *sc)
365{
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-NetBSD
3 *
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * Copyright (c) 2014, 2018 Andrey V. Elsukov <ae@FreeBSD.org>
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation

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

358 soclose(gs->so);
359 free(s, M_GRE);
360 return (error);
361}
362
363static int
364in_gre_attach(struct gre_softc *sc)
365{
366 struct epoch_tracker et;
366 struct grehdr *gh;
367 int error;
368
369 if (sc->gre_options & GRE_UDPENCAP) {
370 sc->gre_csumflags = CSUM_UDP;
371 sc->gre_hlen = sizeof(struct greudp);
372 sc->gre_oip.ip_p = IPPROTO_UDP;
373 gh = &sc->gre_udphdr->gi_gre;

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

392 if (error != 0)
393 return (error);
394 } else
395 CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain);
396 CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr),
397 sc, srchash);
398
399 /* Set IFF_DRV_RUNNING if interface is ready */
367 struct grehdr *gh;
368 int error;
369
370 if (sc->gre_options & GRE_UDPENCAP) {
371 sc->gre_csumflags = CSUM_UDP;
372 sc->gre_hlen = sizeof(struct greudp);
373 sc->gre_oip.ip_p = IPPROTO_UDP;
374 gh = &sc->gre_udphdr->gi_gre;

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

393 if (error != 0)
394 return (error);
395 } else
396 CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain);
397 CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr),
398 sc, srchash);
399
400 /* Set IFF_DRV_RUNNING if interface is ready */
401 NET_EPOCH_ENTER(et);
400 in_gre_set_running(sc);
402 in_gre_set_running(sc);
403 NET_EPOCH_EXIT(et);
401 return (0);
402}
403
404int
405in_gre_setopts(struct gre_softc *sc, u_long cmd, uint32_t value)
406{
407 int error;
408

--- 186 unchanged lines hidden ---
404 return (0);
405}
406
407int
408in_gre_setopts(struct gre_softc *sc, u_long cmd, uint32_t value)
409{
410 int error;
411

--- 186 unchanged lines hidden ---