Deleted Added
full compact
ip_fw_log.c (201732) ip_fw_log.c (204591)
1/*-
2 * Copyright (c) 2002-2009 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-2009 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_log.c 201732 2010-01-07 10:08:05Z luigi $");
27__FBSDID("$FreeBSD: head/sys/netinet/ipfw/ip_fw_log.c 204591 2010-03-02 17:40:48Z luigi $");
28
29/*
30 * Logging support for ipfw
31 */
32
33#if !defined(KLD_MODULE)
34#include "opt_ipfw.h"
35#include "opt_ipdivert.h"

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

408 if (ipoff & (IP_MF | IP_OFFMASK))
409 snprintf(SNPARGS(fragment, 0),
410 " (frag %d:%d@%d%s)",
411 ntohs(ip->ip_id), iplen - (ip->ip_hl << 2),
412 offset << 3,
413 (ipoff & IP_MF) ? "+" : "");
414 }
415 }
28
29/*
30 * Logging support for ipfw
31 */
32
33#if !defined(KLD_MODULE)
34#include "opt_ipfw.h"
35#include "opt_ipdivert.h"

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

408 if (ipoff & (IP_MF | IP_OFFMASK))
409 snprintf(SNPARGS(fragment, 0),
410 " (frag %d:%d@%d%s)",
411 ntohs(ip->ip_id), iplen - (ip->ip_hl << 2),
412 offset << 3,
413 (ipoff & IP_MF) ? "+" : "");
414 }
415 }
416#ifdef __FreeBSD__
416 if (oif || m->m_pkthdr.rcvif)
417 log(LOG_SECURITY | LOG_INFO,
418 "ipfw: %d %s %s %s via %s%s\n",
419 f ? f->rulenum : -1,
420 action, proto, oif ? "out" : "in",
421 oif ? oif->if_xname : m->m_pkthdr.rcvif->if_xname,
422 fragment);
423 else
417 if (oif || m->m_pkthdr.rcvif)
418 log(LOG_SECURITY | LOG_INFO,
419 "ipfw: %d %s %s %s via %s%s\n",
420 f ? f->rulenum : -1,
421 action, proto, oif ? "out" : "in",
422 oif ? oif->if_xname : m->m_pkthdr.rcvif->if_xname,
423 fragment);
424 else
425#endif
424 log(LOG_SECURITY | LOG_INFO,
425 "ipfw: %d %s %s [no if info]%s\n",
426 f ? f->rulenum : -1,
427 action, proto, fragment);
428 if (limit_reached)
429 log(LOG_SECURITY | LOG_NOTICE,
430 "ipfw: limit %d reached on entry %d\n",
431 limit_reached, f ? f->rulenum : -1);
432}
433/* end of file */
426 log(LOG_SECURITY | LOG_INFO,
427 "ipfw: %d %s %s [no if info]%s\n",
428 f ? f->rulenum : -1,
429 action, proto, fragment);
430 if (limit_reached)
431 log(LOG_SECURITY | LOG_NOTICE,
432 "ipfw: limit %d reached on entry %d\n",
433 limit_reached, f ? f->rulenum : -1);
434}
435/* end of file */