Deleted Added
full compact
ip_gre.c (158645) ip_gre.c (159180)
1/* $NetBSD: ip_gre.c,v 1.29 2003/09/05 23:02:43 itojun Exp $ */
1/* $NetBSD: ip_gre.c,v 1.29 2003/09/05 23:02:43 itojun Exp $ */
2/* $FreeBSD: head/sys/netinet/ip_gre.c 158645 2006-05-16 11:15:22Z glebius $ */
2/* $FreeBSD: head/sys/netinet/ip_gre.c 159180 2006-06-02 19:59:33Z csjp $ */
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 *

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

201
202 if (hlen > m->m_pkthdr.len) {
203 m_freem(m);
204 return (NULL);
205 }
206 /* Unlike NetBSD, in FreeBSD m_adj() adjusts m->m_pkthdr.len as well */
207 m_adj(m, hlen);
208
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 *

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

201
202 if (hlen > m->m_pkthdr.len) {
203 m_freem(m);
204 return (NULL);
205 }
206 /* Unlike NetBSD, in FreeBSD m_adj() adjusts m->m_pkthdr.len as well */
207 m_adj(m, hlen);
208
209 if (GRE2IFP(sc)->if_bpf) {
209 if (bpf_peers_present(GRE2IFP(sc)->if_bpf)) {
210 bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m);
211 }
212
213 m->m_pkthdr.rcvif = GRE2IFP(sc);
214
215 netisr_dispatch(isr, m);
216
217 /* Packet is done, no further processing needed. */

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

284 * that this field is in the original format (network byteorder
285 * and full size of IP packet), so that adjust accordingly.
286 */
287 ip->ip_len = htons(ip->ip_len + sizeof(struct ip) - msiz);
288
289 ip->ip_sum = 0;
290 ip->ip_sum = in_cksum(m, (ip->ip_hl << 2));
291
210 bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m);
211 }
212
213 m->m_pkthdr.rcvif = GRE2IFP(sc);
214
215 netisr_dispatch(isr, m);
216
217 /* Packet is done, no further processing needed. */

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

284 * that this field is in the original format (network byteorder
285 * and full size of IP packet), so that adjust accordingly.
286 */
287 ip->ip_len = htons(ip->ip_len + sizeof(struct ip) - msiz);
288
289 ip->ip_sum = 0;
290 ip->ip_sum = in_cksum(m, (ip->ip_hl << 2));
291
292 if (GRE2IFP(sc)->if_bpf) {
292 if (bpf_peers_present(GRE2IFP(sc)->if_bpf)) {
293 u_int32_t af = AF_INET;
294 bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m);
295 }
296
297 m->m_pkthdr.rcvif = GRE2IFP(sc);
298
299 netisr_dispatch(NETISR_IP, m);
300}

--- 32 unchanged lines hidden ---
293 u_int32_t af = AF_INET;
294 bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m);
295 }
296
297 m->m_pkthdr.rcvif = GRE2IFP(sc);
298
299 netisr_dispatch(NETISR_IP, m);
300}

--- 32 unchanged lines hidden ---