Deleted Added
full compact
ip_gre.c (123992) ip_gre.c (125020)
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 123992 2003-12-30 11:41:43Z sobomax $ */
2/* $FreeBSD: head/sys/netinet/ip_gre.c 125020 2004-01-26 12:21:59Z 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 *

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

114
115 va_start(ap, m);
116 off = va_arg(ap, int);
117 va_end(ap);
118 proto = (mtod(m, struct ip *))->ip_p;
119
120 ret = gre_input2(m, off, proto);
121 /*
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 *

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

114
115 va_start(ap, m);
116 off = va_arg(ap, int);
117 va_end(ap);
118 proto = (mtod(m, struct ip *))->ip_p;
119
120 ret = gre_input2(m, off, proto);
121 /*
122 * ret == 0 : packet not processed, meaning that
122 * ret == 0 : packet not processed, meaning that
123 * no matching tunnel that is up is found.
124 * we inject it to raw ip socket to see if anyone picks it up.
125 */
126 if (ret == 0)
127 rip_input(m, off);
128}
129
130/*

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

174 if (flags & GRE_KP)
175 hlen += 4;
176 if (flags & GRE_SP)
177 hlen += 4;
178
179 switch (ntohs(gip->gi_ptype)) { /* ethertypes */
180 case ETHERTYPE_IP: /* shouldn't need a schednetisr(), as */
181 case WCCP_PROTOCOL_TYPE: /* we are in ip_input */
123 * no matching tunnel that is up is found.
124 * we inject it to raw ip socket to see if anyone picks it up.
125 */
126 if (ret == 0)
127 rip_input(m, off);
128}
129
130/*

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

174 if (flags & GRE_KP)
175 hlen += 4;
176 if (flags & GRE_SP)
177 hlen += 4;
178
179 switch (ntohs(gip->gi_ptype)) { /* ethertypes */
180 case ETHERTYPE_IP: /* shouldn't need a schednetisr(), as */
181 case WCCP_PROTOCOL_TYPE: /* we are in ip_input */
182 isr = NETISR_IP;
182 isr = NETISR_IP;
183 break;
184#ifdef NETATALK
185 case ETHERTYPE_ATALK:
186 isr = NETISR_ATALK1;
187 break;
188#endif
189 case ETHERTYPE_IPV6:
190 /* FALLTHROUGH */

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

290 /*
291 * On FreeBSD, rip_input() supplies us with ip->ip_len
292 * already converted into host byteorder and also decreases
293 * it by the lengh of IP header, however, ip_input() expects
294 * that this field is in the original format (network byteorder
295 * and full size of IP packet), so that adjust accordingly.
296 */
297 ip->ip_len = htons(ip->ip_len + sizeof(struct ip) - msiz);
183 break;
184#ifdef NETATALK
185 case ETHERTYPE_ATALK:
186 isr = NETISR_ATALK1;
187 break;
188#endif
189 case ETHERTYPE_IPV6:
190 /* FALLTHROUGH */

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

290 /*
291 * On FreeBSD, rip_input() supplies us with ip->ip_len
292 * already converted into host byteorder and also decreases
293 * it by the lengh of IP header, however, ip_input() expects
294 * that this field is in the original format (network byteorder
295 * and full size of IP packet), so that adjust accordingly.
296 */
297 ip->ip_len = htons(ip->ip_len + sizeof(struct ip) - msiz);
298
298
299 ip->ip_sum = 0;
300 ip->ip_sum = in_cksum(m, (ip->ip_hl << 2));
301
302 if (sc->sc_if.if_bpf) {
303 u_int32_t af = AF_INET;
304 bpf_mtap2(sc->sc_if.if_bpf, &af, sizeof(af), m);
305 }
306

--- 27 unchanged lines hidden ---
299 ip->ip_sum = 0;
300 ip->ip_sum = in_cksum(m, (ip->ip_hl << 2));
301
302 if (sc->sc_if.if_bpf) {
303 u_int32_t af = AF_INET;
304 bpf_mtap2(sc->sc_if.if_bpf, &af, sizeof(af), m);
305 }
306

--- 27 unchanged lines hidden ---