Deleted Added
sdiff udiff text old ( 148613 ) new ( 148887 )
full compact
1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */
2/* $FreeBSD: head/sys/net/if_gre.c 148887 2005-08-09 10:20:02Z rwatson $ */
3
4/*-
5 * Copyright (c) 1998 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Heiko W.Rupp <hwr@pilhuhn.de>
10 *

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

252 if (++(sc->called) > max_gre_nesting) {
253 printf("%s: gre_output: recursively called too many "
254 "times(%d)\n", if_name(GRE2IFP(sc)), sc->called);
255 m_freem(m);
256 error = EIO; /* is there better errno? */
257 goto end;
258 }
259
260 if (!((ifp->if_flags & IFF_UP) &&
261 (ifp->if_drv_flags & IFF_DRV_RUNNING)) ||
262 sc->g_src.s_addr == INADDR_ANY || sc->g_dst.s_addr == INADDR_ANY) {
263 m_freem(m);
264 error = ENETDOWN;
265 goto end;
266 }
267
268 gh = NULL;
269 ip = NULL;

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

555 &in_gre_protosw : &in_mobile_protosw, sc);
556 if (sc->encap == NULL)
557 printf("%s: unable to attach encap\n",
558 if_name(GRE2IFP(sc)));
559#endif
560 if (sc->route.ro_rt != 0) /* free old route */
561 RTFREE(sc->route.ro_rt);
562 if (gre_compute_route(sc) == 0)
563 ifp->if_drv_flags |= IFF_DRV_RUNNING;
564 else
565 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
566 }
567 break;
568 case GREGADDRS:
569 memset(&si, 0, sizeof(si));
570 si.sin_family = AF_INET;
571 si.sin_len = sizeof(struct sockaddr_in);
572 si.sin_addr.s_addr = sc->g_src.s_addr;
573 sa = sintosa(&si);

--- 242 unchanged lines hidden ---