X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Fnetfilter%2Fipt_LOG.c;h=3713b5b4dd99d3e2f4f668bb19d5ebf109e2126b;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=2a3e3eb424e31a91fc2a4a514249cac7a6386a36;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index 2a3e3eb42..3713b5b4d 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c @@ -38,7 +38,7 @@ MODULE_PARM_DESC(nflog, "register as internal netfilter logging module"); #endif /* Use lock to serialize, so printks don't overlap */ -static spinlock_t log_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(log_lock); /* One level of recursion won't kill us */ static void dump_packet(const struct ipt_log_info *info, @@ -327,6 +327,14 @@ static void dump_packet(const struct ipt_log_info *info, printk("PROTO=%u ", ih->protocol); } + /* Max length: 15 "UID=4294967295 " */ + if ((info->logflags & IPT_LOG_UID) && !iphoff && skb->sk) { + read_lock_bh(&skb->sk->sk_callback_lock); + if (skb->sk->sk_socket && skb->sk->sk_socket->file) + printk("UID=%u ", skb->sk->sk_socket->file->f_uid); + read_unlock_bh(&skb->sk->sk_callback_lock); + } + /* Proto Max log string length */ /* IP: 40+46+6+11+127 = 230 */ /* TCP: 10+max(25,20+30+13+9+32+11+127) = 252 */