1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */ |
2/* $FreeBSD: head/sys/net/if_gre.c 133163 2004-08-05 08:12:46Z sobomax $ */ |
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_v = IPPROTO_IPV4; |
380 ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2; 381 ((struct ip*)gh)->ip_ttl = GRE_TTL; 382 ((struct ip*)gh)->ip_tos = ip->ip_tos; 383 ((struct ip*)gh)->ip_id = ip->ip_id; 384 gh->gi_len = m->m_pkthdr.len; 385 } 386 387 ifp->if_opackets++; --- 397 unchanged lines hidden --- |