if_gre.c (125024) | if_gre.c (125226) |
---|---|
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 125024 2004-01-26 12:33:56Z sobomax $ */ | 2/* $FreeBSD: head/sys/net/if_gre.c 125226 2004-01-30 09:03:01Z 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 * --- 335 unchanged lines hidden (view full) --- 346 _IF_DROP(&ifp->if_snd); 347 error = ENOBUFS; 348 goto end; 349 } 350 351 gh = mtod(m, struct greip *); 352 if (sc->g_proto == IPPROTO_GRE) { 353 /* we don't have any GRE flags for now */ | 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 * --- 335 unchanged lines hidden (view full) --- 346 _IF_DROP(&ifp->if_snd); 347 error = ENOBUFS; 348 goto end; 349 } 350 351 gh = mtod(m, struct greip *); 352 if (sc->g_proto == IPPROTO_GRE) { 353 /* we don't have any GRE flags for now */ |
354 355 memset((void *)&gh->gi_g, 0, sizeof(struct gre_h)); | 354 memset((void *)gh, 0, sizeof(struct greip)); |
356 gh->gi_ptype = htons(etype); 357 } 358 359 gh->gi_pr = sc->g_proto; 360 if (sc->g_proto != IPPROTO_MOBILE) { 361 gh->gi_src = sc->g_src; 362 gh->gi_dst = sc->g_dst; 363 ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2; 364 ((struct ip*)gh)->ip_ttl = GRE_TTL; 365 ((struct ip*)gh)->ip_tos = ip->ip_tos; 366 ((struct ip*)gh)->ip_id = ip->ip_id; | 355 gh->gi_ptype = htons(etype); 356 } 357 358 gh->gi_pr = sc->g_proto; 359 if (sc->g_proto != IPPROTO_MOBILE) { 360 gh->gi_src = sc->g_src; 361 gh->gi_dst = sc->g_dst; 362 ((struct ip*)gh)->ip_hl = (sizeof(struct ip)) >> 2; 363 ((struct ip*)gh)->ip_ttl = GRE_TTL; 364 ((struct ip*)gh)->ip_tos = ip->ip_tos; 365 ((struct ip*)gh)->ip_id = ip->ip_id; |
367 gh->gi_len = htons(m->m_pkthdr.len); | 366 gh->gi_len = m->m_pkthdr.len; |
368 } 369 370 ifp->if_opackets++; 371 ifp->if_obytes += m->m_pkthdr.len; 372 /* send it off */ 373 error = ip_output(m, NULL, &sc->route, 0, 374 (struct ip_moptions *)NULL, (struct inpcb *)NULL); 375 end: --- 378 unchanged lines hidden --- | 367 } 368 369 ifp->if_opackets++; 370 ifp->if_obytes += m->m_pkthdr.len; 371 /* send it off */ 372 error = ip_output(m, NULL, &sc->route, 0, 373 (struct ip_moptions *)NULL, (struct inpcb *)NULL); 374 end: --- 378 unchanged lines hidden --- |