ip_fw_pfil.c (240494) | ip_fw_pfil.c (241245) |
---|---|
1/*- 2 * Copyright (c) 2004 Andre Oppermann, Internet Business Solutions AG 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 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Andre Oppermann, Internet Business Solutions AG 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 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/netpfil/ipfw/ip_fw_pfil.c 240494 2012-09-14 11:51:49Z glebius $"); | 28__FBSDID("$FreeBSD: head/sys/netpfil/ipfw/ip_fw_pfil.c 241245 2012-10-06 10:02:11Z glebius $"); |
29 30#include "opt_ipfw.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33#ifndef INET 34#error IPFIREWALL requires INET. 35#endif /* INET */ 36 --- 83 unchanged lines hidden (view full) --- 120ipfw_check_packet(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, 121 struct inpcb *inp) 122{ 123 struct ip_fw_args args; 124 struct m_tag *tag; 125 int ipfw; 126 int ret; 127 | 29 30#include "opt_ipfw.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33#ifndef INET 34#error IPFIREWALL requires INET. 35#endif /* INET */ 36 --- 83 unchanged lines hidden (view full) --- 120ipfw_check_packet(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, 121 struct inpcb *inp) 122{ 123 struct ip_fw_args args; 124 struct m_tag *tag; 125 int ipfw; 126 int ret; 127 |
128 /* all the processing now uses ip_len in net format */ 129 if (mtod(*m0, struct ip *)->ip_v == 4) 130 SET_NET_IPLEN(mtod(*m0, struct ip *)); 131 | |
132 /* convert dir to IPFW values */ 133 dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; 134 bzero(&args, sizeof(args)); 135 136again: 137 /* 138 * extract and remove the tag if present. If we are left 139 * with onepass, optimize the outgoing path. --- 143 unchanged lines hidden (view full) --- 283 KASSERT(0, ("%s: unknown retval", __func__)); 284 } 285 286 if (ret != 0) { 287 if (*m0) 288 FREE_PKT(*m0); 289 *m0 = NULL; 290 } | 128 /* convert dir to IPFW values */ 129 dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; 130 bzero(&args, sizeof(args)); 131 132again: 133 /* 134 * extract and remove the tag if present. If we are left 135 * with onepass, optimize the outgoing path. --- 143 unchanged lines hidden (view full) --- 279 KASSERT(0, ("%s: unknown retval", __func__)); 280 } 281 282 if (ret != 0) { 283 if (*m0) 284 FREE_PKT(*m0); 285 *m0 = NULL; 286 } |
291 if (*m0 && mtod(*m0, struct ip *)->ip_v == 4) 292 SET_HOST_IPLEN(mtod(*m0, struct ip *)); | 287 |
293 return ret; 294} 295 296/* 297 * ipfw processing for ethernet packets (in and out). 298 * Inteface is NULL from ether_demux, and ifp from 299 * ether_output_frame. 300 */ --- 290 unchanged lines hidden --- | 288 return ret; 289} 290 291/* 292 * ipfw processing for ethernet packets (in and out). 293 * Inteface is NULL from ether_demux, and ifp from 294 * ether_output_frame. 295 */ --- 290 unchanged lines hidden --- |