if_enc.c (241130) | if_enc.c (241245) |
---|---|
1/*- 2 * Copyright (c) 2006 The FreeBSD Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/*- 2 * Copyright (c) 2006 The FreeBSD Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/net/if_enc.c 241130 2012-10-02 12:25:30Z jhb $ | 27 * $FreeBSD: head/sys/net/if_enc.c 241245 2012-10-06 10:02:11Z glebius $ |
28 */ 29 30#include "opt_inet.h" 31#include "opt_inet6.h" 32#include "opt_enc.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> --- 229 unchanged lines hidden (view full) --- 265 } 266 } 267 268 error = 0; 269 ip = mtod(*mp, struct ip *); 270 switch (ip->ip_v) { 271#ifdef INET 272 case 4: | 28 */ 29 30#include "opt_inet.h" 31#include "opt_inet6.h" 32#include "opt_enc.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> --- 229 unchanged lines hidden (view full) --- 265 } 266 } 267 268 error = 0; 269 ip = mtod(*mp, struct ip *); 270 switch (ip->ip_v) { 271#ifdef INET 272 case 4: |
273 /* 274 * before calling the firewall, swap fields the same as 275 * IP does. here we assume the header is contiguous 276 */ 277 ip->ip_len = ntohs(ip->ip_len); 278 ip->ip_off = ntohs(ip->ip_off); 279 | |
280 error = pfil_run_hooks(&V_inet_pfil_hook, mp, 281 encif, dir, NULL); | 273 error = pfil_run_hooks(&V_inet_pfil_hook, mp, 274 encif, dir, NULL); |
282 283 if (*mp == NULL || error != 0) 284 break; 285 286 /* restore byte ordering */ 287 ip = mtod(*mp, struct ip *); 288 ip->ip_len = htons(ip->ip_len); 289 ip->ip_off = htons(ip->ip_off); | |
290 break; 291#endif 292#ifdef INET6 293 case 6: 294 error = pfil_run_hooks(&V_inet6_pfil_hook, mp, 295 encif, dir, NULL); 296 break; 297#endif --- 82 unchanged lines hidden --- | 275 break; 276#endif 277#ifdef INET6 278 case 6: 279 error = pfil_run_hooks(&V_inet6_pfil_hook, mp, 280 encif, dir, NULL); 281 break; 282#endif --- 82 unchanged lines hidden --- |