Deleted Added
full compact
if_gre.c (147256) if_gre.c (147611)
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 147256 2005-06-10 16:49:24Z brooks $ */
2/* $FreeBSD: head/sys/net/if_gre.c 147611 2005-06-26 18:11:11Z dwmalone $ */
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 *

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

228 struct rtentry *rt)
229{
230 int error = 0;
231 struct gre_softc *sc = ifp->if_softc;
232 struct greip *gh;
233 struct ip *ip;
234 u_int16_t etype = 0;
235 struct mobile_h mob_h;
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 *

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

228 struct rtentry *rt)
229{
230 int error = 0;
231 struct gre_softc *sc = ifp->if_softc;
232 struct greip *gh;
233 struct ip *ip;
234 u_int16_t etype = 0;
235 struct mobile_h mob_h;
236 u_int32_t af;
236
237 /*
238 * gre may cause infinite recursion calls when misconfigured.
239 * We'll prevent this by introducing upper limit.
240 */
241 if (++(sc->called) > max_gre_nesting) {
242 printf("%s: gre_output: recursively called too many "
243 "times(%d)\n", if_name(GRE2IFP(sc)), sc->called);

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

251 m_freem(m);
252 error = ENETDOWN;
253 goto end;
254 }
255
256 gh = NULL;
257 ip = NULL;
258
237
238 /*
239 * gre may cause infinite recursion calls when misconfigured.
240 * We'll prevent this by introducing upper limit.
241 */
242 if (++(sc->called) > max_gre_nesting) {
243 printf("%s: gre_output: recursively called too many "
244 "times(%d)\n", if_name(GRE2IFP(sc)), sc->called);

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

252 m_freem(m);
253 error = ENETDOWN;
254 goto end;
255 }
256
257 gh = NULL;
258 ip = NULL;
259
260 /* BPF writes need to be handled specially. */
261 if (dst->sa_family == AF_UNSPEC) {
262 bcopy(dst->sa_data, &af, sizeof(af));
263 dst->sa_family = af;
264 }
265
259 if (ifp->if_bpf) {
266 if (ifp->if_bpf) {
260 u_int32_t af = dst->sa_family;
267 af = dst->sa_family;
261 bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
262 }
263
264 m->m_flags &= ~(M_BCAST|M_MCAST);
265
266 if (sc->g_proto == IPPROTO_MOBILE) {
267 if (dst->sa_family == AF_INET) {
268 struct mbuf *m0;

--- 517 unchanged lines hidden ---
268 bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
269 }
270
271 m->m_flags &= ~(M_BCAST|M_MCAST);
272
273 if (sc->g_proto == IPPROTO_MOBILE) {
274 if (dst->sa_family == AF_INET) {
275 struct mbuf *m0;

--- 517 unchanged lines hidden ---