ip_fil_freebsd.c (178888) | ip_fil_freebsd.c (181803) |
---|---|
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c 178888 2008-05-09 23:03:00Z julian $ */ | 1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c 181803 2008-08-17 23:27:27Z bz $ */ |
2 3/* 4 * Copyright (C) 1993-2003 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 */ 8#if !defined(lint) 9static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed"; --- 47 unchanged lines hidden (view full) --- 57#endif 58#include <sys/protosw.h> 59#include <sys/socket.h> 60#if __FreeBSD_version >= 500043 61# include <sys/selinfo.h> 62#else 63# include <sys/select.h> 64#endif | 2 3/* 4 * Copyright (C) 1993-2003 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 */ 8#if !defined(lint) 9static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed"; --- 47 unchanged lines hidden (view full) --- 57#endif 58#include <sys/protosw.h> 59#include <sys/socket.h> 60#if __FreeBSD_version >= 500043 61# include <sys/selinfo.h> 62#else 63# include <sys/select.h> 64#endif |
65#if __FreeBSD_version >= 800044 66# include <sys/vimage.h> 67#else 68#define V_path_mtu_discovery path_mtu_discovery 69#define V_ipforwarding ipforwarding 70#endif |
|
65 66#include <net/if.h> 67#if __FreeBSD_version >= 300000 68# include <net/if_var.h> 69# if __FreeBSD_version >= 500043 70# include <net/netisr.h> 71# endif 72# if !defined(IPFILTER_LKM) --- 156 unchanged lines hidden (view full) --- 229 fr_checkp = fr_check; 230 } 231 232 bzero((char *)ipfselwait, sizeof(ipfselwait)); 233 bzero((char *)frcache, sizeof(frcache)); 234 fr_running = 1; 235 236 if (fr_control_forwarding & 1) | 71 72#include <net/if.h> 73#if __FreeBSD_version >= 300000 74# include <net/if_var.h> 75# if __FreeBSD_version >= 500043 76# include <net/netisr.h> 77# endif 78# if !defined(IPFILTER_LKM) --- 156 unchanged lines hidden (view full) --- 235 fr_checkp = fr_check; 236 } 237 238 bzero((char *)ipfselwait, sizeof(ipfselwait)); 239 bzero((char *)frcache, sizeof(frcache)); 240 fr_running = 1; 241 242 if (fr_control_forwarding & 1) |
237 ipforwarding = 1; | 243 V_ipforwarding = 1; |
238 239 SPL_X(s); 240#if (__FreeBSD_version >= 300000) 241 fr_slowtimer_ch = timeout(fr_slowtimer, NULL, 242 (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); 243#else 244 timeout(fr_slowtimer, NULL, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); 245#endif --- 6 unchanged lines hidden (view full) --- 252 * stream. 253 */ 254int ipfdetach() 255{ 256#ifdef USE_SPL 257 int s; 258#endif 259 if (fr_control_forwarding & 2) | 244 245 SPL_X(s); 246#if (__FreeBSD_version >= 300000) 247 fr_slowtimer_ch = timeout(fr_slowtimer, NULL, 248 (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); 249#else 250 timeout(fr_slowtimer, NULL, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); 251#endif --- 6 unchanged lines hidden (view full) --- 258 * stream. 259 */ 260int ipfdetach() 261{ 262#ifdef USE_SPL 263 int s; 264#endif 265 if (fr_control_forwarding & 2) |
260 ipforwarding = 0; | 266 V_ipforwarding = 0; |
261 262 SPL_NET(s); 263 264#if (__FreeBSD_version >= 300000) 265 if (fr_slowtimer_ch.callout != NULL) 266 untimeout(fr_slowtimer, NULL, fr_slowtimer_ch); 267 bzero(&fr_slowtimer_ch, sizeof(fr_slowtimer_ch)); 268#else --- 378 unchanged lines hidden (view full) --- 647 { 648 case 4 : 649 fnew.fin_v = 4; 650 oip = fin->fin_ip; 651 IP_HL_A(ip, sizeof(*oip) >> 2); 652 ip->ip_tos = oip->ip_tos; 653 ip->ip_id = fin->fin_ip->ip_id; 654#if (__FreeBSD_version > 460000) | 267 268 SPL_NET(s); 269 270#if (__FreeBSD_version >= 300000) 271 if (fr_slowtimer_ch.callout != NULL) 272 untimeout(fr_slowtimer, NULL, fr_slowtimer_ch); 273 bzero(&fr_slowtimer_ch, sizeof(fr_slowtimer_ch)); 274#else --- 378 unchanged lines hidden (view full) --- 653 { 654 case 4 : 655 fnew.fin_v = 4; 656 oip = fin->fin_ip; 657 IP_HL_A(ip, sizeof(*oip) >> 2); 658 ip->ip_tos = oip->ip_tos; 659 ip->ip_id = fin->fin_ip->ip_id; 660#if (__FreeBSD_version > 460000) |
655 ip->ip_off = path_mtu_discovery ? IP_DF : 0; | 661 ip->ip_off = V_path_mtu_discovery ? IP_DF : 0; |
656#else 657 ip->ip_off = 0; 658#endif | 662#else 663 ip->ip_off = 0; 664#endif |
659 ip->ip_ttl = ip_defttl; | 665 ip->ip_ttl = V_ip_defttl; |
660 ip->ip_sum = 0; 661 hlen = sizeof(*oip); 662 break; 663#ifdef USE_INET6 664 case 6 : 665 { 666 ip6_t *ip6 = (ip6_t *)ip; 667 --- 983 unchanged lines hidden --- | 666 ip->ip_sum = 0; 667 hlen = sizeof(*oip); 668 break; 669#ifdef USE_INET6 670 case 6 : 671 { 672 ip6_t *ip6 = (ip6_t *)ip; 673 --- 983 unchanged lines hidden --- |