1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */
2/* $FreeBSD: head/sys/net/if_gre.c 132199 2004-07-15 08:26:07Z phk $ */
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 *
--- 360 unchanged lines hidden (view full) ---
371 memset((void *)gh, 0, sizeof(struct greip));
372 gh->gi_ptype = htons(etype);
373 }
374
375 gh->gi_pr = sc->g_proto;
376 if (sc->g_proto != IPPROTO_MOBILE) {
377 gh->gi_src = sc->g_src;
378 gh->gi_dst = sc->g_dst;
379 ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2;
380 ((struct ip*)gh)->ip_ttl = GRE_TTL;
381 ((struct ip*)gh)->ip_tos = ip->ip_tos;
382 ((struct ip*)gh)->ip_id = ip->ip_id;
383 gh->gi_len = m->m_pkthdr.len;
384 }
385
386 ifp->if_opackets++;
--- 397 unchanged lines hidden ---
2/* $FreeBSD: head/sys/net/if_gre.c 132199 2004-07-15 08:26:07Z phk $ */
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 *
--- 360 unchanged lines hidden (view full) ---
371 memset((void *)gh, 0, sizeof(struct greip));
372 gh->gi_ptype = htons(etype);
373 }
374
375 gh->gi_pr = sc->g_proto;
376 if (sc->g_proto != IPPROTO_MOBILE) {
377 gh->gi_src = sc->g_src;
378 gh->gi_dst = sc->g_dst;
379 ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2;
380 ((struct ip*)gh)->ip_ttl = GRE_TTL;
381 ((struct ip*)gh)->ip_tos = ip->ip_tos;
382 ((struct ip*)gh)->ip_id = ip->ip_id;
383 gh->gi_len = m->m_pkthdr.len;
384 }
385
386 ifp->if_opackets++;
--- 397 unchanged lines hidden ---