diff -Nurb linux-2.6.22-521/net/netfilter/xt_MARK.c linux-2.6.22-522/net/netfilter/xt_MARK.c
--- linux-2.6.22-521/net/netfilter/xt_MARK.c 2007-07-08 19:32:17.000000000 -0400
-+++ linux-2.6.22-522/net/netfilter/xt_MARK.c 2008-07-30 14:28:03.000000000 -0400
++++ linux-2.6.22-522/net/netfilter/xt_MARK.c 2008-07-31 14:49:48.000000000 -0400
@@ -5,13 +5,18 @@
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
switch (markinfo->mode) {
case XT_MARK_SET:
-@@ -58,13 +122,103 @@
+@@ -58,13 +122,102 @@
case XT_MARK_OR:
mark = (*pskb)->mark | markinfo->mark;
break;
+ if (connection_sk->sk_peercred.uid == 0 || connection_sk->sk_peercred.uid == (__u32) -1) {
+ /* Normal case - the peercred on the socket is not set */
+ connection_sk->sk_peercred.gid = connection_sk->sk_peercred.uid = ct->xid[!dir];
-+ printk(KERN_CRIT "Setting peercred to %d\n",connection_sk->sk_peercred.uid);
+ }
+ else /* Exceptional case - the peercred was set using SET_PEERCRED. Somebody wants us
+ to mark packets with some arbitrary value.*/
static int
checkentry_v0(const char *tablename,
const void *entry,
-@@ -92,7 +246,8 @@
+@@ -92,7 +245,8 @@
if (markinfo->mode != XT_MARK_SET
&& markinfo->mode != XT_MARK_AND