11 #include <linux/module.h>
14 #include <linux/if_arp.h>
17 #include <linux/ipv6.h>
19 #include <linux/in6.h>
20 #include <linux/netfilter/x_tables.h>
21 #include <linux/netfilter_bridge/ebtables.h>
23 #include <linux/netfilter.h>
64 pptr = skb_header_pointer(skb, offset,
65 sizeof(_ports), &_ports);
67 printk(
" INCOMPLETE TCP/UDP header");
82 spin_lock_bh(&ebt_log_lock);
83 printk(
KERN_SOH "%c%s IN=%s OUT=%s MAC source = %pM MAC dest = %pM proto = 0x%04x",
84 '0' + loginfo->
u.
log.level, prefix,
85 in ? in->
name :
"", out ? out->
name :
"",
90 bitmask = loginfo->
u.
log.logflags;
96 const struct iphdr *ih;
99 ih = skb_header_pointer(skb, 0,
sizeof(_iph), &_iph);
101 printk(
" INCOMPLETE IP header");
104 printk(
" IP SRC=%pI4 IP DST=%pI4, IP tos=0x%02X, IP proto=%d",
105 &ih->saddr, &ih->daddr, ih->tos, ih->protocol);
106 print_ports(skb, ih->
protocol, ih->ihl*4);
110 #if IS_ENABLED(CONFIG_BRIDGE_EBT_IP6)
119 ih = skb_header_pointer(skb, 0,
sizeof(_iph), &_iph);
121 printk(
" INCOMPLETE IPv6 header");
124 printk(
" IPv6 SRC=%pI6 IPv6 DST=%pI6, IPv6 priority=0x%01X, Next Header=%d",
130 print_ports(skb, nexthdr, offset_ph);
141 ah = skb_header_pointer(skb, 0,
sizeof(_arph), &_arph);
143 printk(
" INCOMPLETE ARP header");
146 printk(
" ARP HTYPE=%d, PTYPE=0x%04x, OPCODE=%d",
152 if (ah->ar_hrd ==
htons(1) &&
154 ah->ar_pln ==
sizeof(
__be32)) {
158 ap = skb_header_pointer(skb,
sizeof(_arph),
159 sizeof(_arpp), &_arpp);
161 printk(
" INCOMPLETE ARP payload");
164 printk(
" ARP MAC SRC=%pM ARP IP SRC=%pI4 ARP MAC DST=%pM ARP IP DST=%pI4",
165 ap->mac_src, ap->ip_src, ap->mac_dst, ap->ip_dst);
170 spin_unlock_bh(&ebt_log_lock);
197 .target = ebt_log_tg,
198 .checkentry = ebt_log_tg_check,
203 static struct nf_logger ebt_log_logger __read_mostly = {
205 .logfn = &ebt_log_packet,
209 static int __init ebt_log_init(
void)
220 static void __exit ebt_log_fini(
void)