diff options
author | Eric Leblond <eric@inl.fr> | 2008-07-21 13:02:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-21 13:11:00 -0400 |
commit | 72961ecf84d67d6359a1b30f9b2a8427f13e1e71 (patch) | |
tree | 531aeb470c069d4ecd91a4080dc820308d84fc9d | |
parent | 280763c053fee297d95b474f2c145990670371e6 (diff) |
netfilter: nfnetlink_log: send complete hardware header
This patch adds some fields to NFLOG to be able to send the complete
hardware header with all necessary informations.
It sends to userspace:
* the type of hardware link
* the lenght of hardware header
* the hardware header
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/netfilter/nfnetlink_log.h | 3 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index a85721332924..f661731f3cb1 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -48,6 +48,9 @@ enum nfulnl_attr_type { | |||
48 | NFULA_SEQ, /* instance-local sequence number */ | 48 | NFULA_SEQ, /* instance-local sequence number */ |
49 | NFULA_SEQ_GLOBAL, /* global sequence number */ | 49 | NFULA_SEQ_GLOBAL, /* global sequence number */ |
50 | NFULA_GID, /* group id of socket */ | 50 | NFULA_GID, /* group id of socket */ |
51 | NFULA_HWTYPE, /* hardware type */ | ||
52 | NFULA_HWHEADER, /* hardware header */ | ||
53 | NFULA_HWLEN, /* hardware header length */ | ||
51 | 54 | ||
52 | __NFULA_MAX | 55 | __NFULA_MAX |
53 | }; | 56 | }; |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index b8173af8c24a..9a35b57ab76d 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -453,6 +453,14 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
456 | if (indev && skb_mac_header_was_set(skb)) { | ||
457 | NLA_PUT_BE16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)); | ||
458 | NLA_PUT_BE16(inst->skb, NFULA_HWLEN, | ||
459 | htons(skb->dev->hard_header_len)); | ||
460 | NLA_PUT(inst->skb, NFULA_HWHEADER, skb->dev->hard_header_len, | ||
461 | skb_mac_header(skb)); | ||
462 | } | ||
463 | |||
456 | if (skb->tstamp.tv64) { | 464 | if (skb->tstamp.tv64) { |
457 | struct nfulnl_msg_packet_timestamp ts; | 465 | struct nfulnl_msg_packet_timestamp ts; |
458 | struct timeval tv = ktime_to_timeval(skb->tstamp); | 466 | struct timeval tv = ktime_to_timeval(skb->tstamp); |