Deleted Added
full compact
ip_fw_dynamic.c (201122) ip_fw_dynamic.c (201527)
1/*-
2 * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/netinet/ipfw/ip_fw_dynamic.c 201122 2009-12-28 10:47:04Z luigi $");
27__FBSDID("$FreeBSD: head/sys/netinet/ipfw/ip_fw_dynamic.c 201527 2010-01-04 19:01:22Z luigi $");
28
29#define DEB(x)
30#define DDB(x) x
31
32/*
33 * Dynamic rule support for ipfw
34 */
35

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

912 break;
913#ifdef INET6
914 case 6:
915 len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
916 break;
917#endif
918 default:
919 /* XXX: log me?!? */
28
29#define DEB(x)
30#define DDB(x) x
31
32/*
33 * Dynamic rule support for ipfw
34 */
35

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

912 break;
913#ifdef INET6
914 case 6:
915 len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
916 break;
917#endif
918 default:
919 /* XXX: log me?!? */
920 m_freem(m);
920 FREE_PKT(m);
921 return (NULL);
922 }
923 dir = ((flags & (TH_SYN | TH_RST)) == TH_SYN);
924
925 m->m_data += max_linkhdr;
926 m->m_flags |= M_SKIP_FIREWALL;
927 m->m_pkthdr.len = m->m_len = len;
928 m->m_pkthdr.rcvif = NULL;

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

997 case 4:
998 th->th_sum = in_cksum(m, len);
999
1000 /* finish the ip header */
1001 h->ip_v = 4;
1002 h->ip_hl = sizeof(*h) >> 2;
1003 h->ip_tos = IPTOS_LOWDELAY;
1004 h->ip_off = 0;
921 return (NULL);
922 }
923 dir = ((flags & (TH_SYN | TH_RST)) == TH_SYN);
924
925 m->m_data += max_linkhdr;
926 m->m_flags |= M_SKIP_FIREWALL;
927 m->m_pkthdr.len = m->m_len = len;
928 m->m_pkthdr.rcvif = NULL;

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

997 case 4:
998 th->th_sum = in_cksum(m, len);
999
1000 /* finish the ip header */
1001 h->ip_v = 4;
1002 h->ip_hl = sizeof(*h) >> 2;
1003 h->ip_tos = IPTOS_LOWDELAY;
1004 h->ip_off = 0;
1005#ifdef HAVE_NET_IPLEN /* XXX do we handle layer2 ? */
1006 h->ip_len = htons(len);
1005 h->ip_len = htons(len);
1007#else
1008 h->ip_len = len;
1009#endif
1010 h->ip_ttl = V_ip_defttl;
1011 h->ip_sum = 0;
1012 break;
1013#ifdef INET6
1014 case 6:
1015 th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(*h6),
1016 sizeof(struct tcphdr));
1017

--- 216 unchanged lines hidden ---
1006 h->ip_ttl = V_ip_defttl;
1007 h->ip_sum = 0;
1008 break;
1009#ifdef INET6
1010 case 6:
1011 th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(*h6),
1012 sizeof(struct tcphdr));
1013

--- 216 unchanged lines hidden ---