Deleted Added
full compact
ip_output.c (196608) ip_output.c (197952)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California. 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 * 1. Redistributions of source code must retain the above copyright

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

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California. 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 * 1. Redistributions of source code must retain the above copyright

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

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/netinet/ip_output.c 196608 2009-08-28 05:37:31Z qingli $");
33__FBSDID("$FreeBSD: head/sys/netinet/ip_output.c 197952 2009-10-11 05:59:43Z julian $");
34
35#include "opt_ipfw.h"
36#include "opt_ipsec.h"
37#include "opt_route.h"
38#include "opt_mbuf_stress_test.h"
39#include "opt_mpath.h"
40#include "opt_sctp.h"
41

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

484 goto bad;
485 }
486 /* Update variables that are affected by ipsec4_output(). */
487 ip = mtod(m, struct ip *);
488 hlen = ip->ip_hl << 2;
489#endif /* IPSEC */
490
491 /* Jump over all PFIL processing if hooks are not active. */
34
35#include "opt_ipfw.h"
36#include "opt_ipsec.h"
37#include "opt_route.h"
38#include "opt_mbuf_stress_test.h"
39#include "opt_mpath.h"
40#include "opt_sctp.h"
41

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

484 goto bad;
485 }
486 /* Update variables that are affected by ipsec4_output(). */
487 ip = mtod(m, struct ip *);
488 hlen = ip->ip_hl << 2;
489#endif /* IPSEC */
490
491 /* Jump over all PFIL processing if hooks are not active. */
492 if (!PFIL_HOOKED(&inet_pfil_hook))
492 if (!PFIL_HOOKED(&V_inet_pfil_hook))
493 goto passout;
494
495 /* Run through list of hooks for output packets. */
496 odst.s_addr = ip->ip_dst.s_addr;
493 goto passout;
494
495 /* Run through list of hooks for output packets. */
496 odst.s_addr = ip->ip_dst.s_addr;
497 error = pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_OUT, inp);
497 error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp);
498 if (error != 0 || m == NULL)
499 goto done;
500
501 ip = mtod(m, struct ip *);
502
503 /* See if destination IP address was changed by packet filter. */
504 if (odst.s_addr != ip->ip_dst.s_addr) {
505 m->m_flags |= M_SKIP_FIREWALL;

--- 759 unchanged lines hidden ---
498 if (error != 0 || m == NULL)
499 goto done;
500
501 ip = mtod(m, struct ip *);
502
503 /* See if destination IP address was changed by packet filter. */
504 if (odst.s_addr != ip->ip_dst.s_addr) {
505 m->m_flags |= M_SKIP_FIREWALL;

--- 759 unchanged lines hidden ---