if_enc.c (b3aa41933111de001be90e3e02756d262c2be065) if_enc.c (21d172a3f17d63c16991f0313fe5de2353043d5b)
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 *

--- 256 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:
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 *

--- 256 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 ---