if_gre.c (148613) | if_gre.c (148887) |
---|---|
1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */ | 1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */ |
2/* $FreeBSD: head/sys/net/if_gre.c 148613 2005-08-01 08:14:21Z bz $ */ | 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 | 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 | IFF_RUNNING)) == 0 || | 260 if (!((ifp->if_flags & IFF_UP) && 261 (ifp->if_drv_flags & IFF_DRV_RUNNING)) || |
261 sc->g_src.s_addr == INADDR_ANY || sc->g_dst.s_addr == INADDR_ANY) { 262 m_freem(m); 263 error = ENETDOWN; 264 goto end; 265 } 266 267 gh = NULL; 268 ip = NULL; --- 285 unchanged lines hidden (view full) --- 554 &in_gre_protosw : &in_mobile_protosw, sc); 555 if (sc->encap == NULL) 556 printf("%s: unable to attach encap\n", 557 if_name(GRE2IFP(sc))); 558#endif 559 if (sc->route.ro_rt != 0) /* free old route */ 560 RTFREE(sc->route.ro_rt); 561 if (gre_compute_route(sc) == 0) | 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) |
562 ifp->if_flags |= IFF_RUNNING; | 563 ifp->if_drv_flags |= IFF_DRV_RUNNING; |
563 else | 564 else |
564 ifp->if_flags &= ~IFF_RUNNING; | 565 ifp->if_drv_flags &= ~IFF_DRV_RUNNING; |
565 } 566 break; 567 case GREGADDRS: 568 memset(&si, 0, sizeof(si)); 569 si.sin_family = AF_INET; 570 si.sin_len = sizeof(struct sockaddr_in); 571 si.sin_addr.s_addr = sc->g_src.s_addr; 572 sa = sintosa(&si); --- 242 unchanged lines hidden --- | 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 --- |