aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-08-22 03:33:26 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:55:30 -0400
commit90528e6fe92ee1a353d6a639930e7d70d85b5c85 (patch)
tree4a23ac908acf5ef10b15e8d52354f5915a54d628 /net/netfilter
parentda878c8e5aae3eeceeee7af8d52633d7bc125edf (diff)
[NETFILTER]: xt_CONNMARK: use tabs for indentation
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/xt_CONNMARK.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/net/netfilter/xt_CONNMARK.c b/net/netfilter/xt_CONNMARK.c
index 784482b74e58..19989a915433 100644
--- a/net/netfilter/xt_CONNMARK.c
+++ b/net/netfilter/xt_CONNMARK.c
@@ -49,36 +49,37 @@ target(struct sk_buff **pskb,
49 u_int32_t *ctmark = nf_ct_get_mark(*pskb, &ctinfo); 49 u_int32_t *ctmark = nf_ct_get_mark(*pskb, &ctinfo);
50 50
51 if (ctmark) { 51 if (ctmark) {
52 switch(markinfo->mode) { 52 switch(markinfo->mode) {
53 case XT_CONNMARK_SET: 53 case XT_CONNMARK_SET:
54 newmark = (*ctmark & ~markinfo->mask) | markinfo->mark; 54 newmark = (*ctmark & ~markinfo->mask) | markinfo->mark;
55 if (newmark != *ctmark) { 55 if (newmark != *ctmark) {
56 *ctmark = newmark; 56 *ctmark = newmark;
57#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS 57#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
58 ip_conntrack_event_cache(IPCT_MARK, *pskb); 58 ip_conntrack_event_cache(IPCT_MARK, *pskb);
59#else 59#else
60 nf_conntrack_event_cache(IPCT_MARK, *pskb); 60 nf_conntrack_event_cache(IPCT_MARK, *pskb);
61#endif 61#endif
62 } 62 }
63 break; 63 break;
64 case XT_CONNMARK_SAVE: 64 case XT_CONNMARK_SAVE:
65 newmark = (*ctmark & ~markinfo->mask) | ((*pskb)->nfmark & markinfo->mask); 65 newmark = (*ctmark & ~markinfo->mask) |
66 if (*ctmark != newmark) { 66 ((*pskb)->nfmark & markinfo->mask);
67 *ctmark = newmark; 67 if (*ctmark != newmark) {
68 *ctmark = newmark;
68#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS 69#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
69 ip_conntrack_event_cache(IPCT_MARK, *pskb); 70 ip_conntrack_event_cache(IPCT_MARK, *pskb);
70#else 71#else
71 nf_conntrack_event_cache(IPCT_MARK, *pskb); 72 nf_conntrack_event_cache(IPCT_MARK, *pskb);
72#endif 73#endif
74 }
75 break;
76 case XT_CONNMARK_RESTORE:
77 nfmark = (*pskb)->nfmark;
78 diff = (*ctmark ^ nfmark) & markinfo->mask;
79 if (diff != 0)
80 (*pskb)->nfmark = nfmark ^ diff;
81 break;
73 } 82 }
74 break;
75 case XT_CONNMARK_RESTORE:
76 nfmark = (*pskb)->nfmark;
77 diff = (*ctmark ^ nfmark) & markinfo->mask;
78 if (diff != 0)
79 (*pskb)->nfmark = nfmark ^ diff;
80 break;
81 }
82 } 83 }
83 84
84 return XT_CONTINUE; 85 return XT_CONTINUE;
@@ -95,17 +96,17 @@ checkentry(const char *tablename,
95 struct xt_connmark_target_info *matchinfo = targinfo; 96 struct xt_connmark_target_info *matchinfo = targinfo;
96 97
97 if (matchinfo->mode == XT_CONNMARK_RESTORE) { 98 if (matchinfo->mode == XT_CONNMARK_RESTORE) {
98 if (strcmp(tablename, "mangle") != 0) { 99 if (strcmp(tablename, "mangle") != 0) {
99 printk(KERN_WARNING "CONNMARK: restore can only be called from \"mangle\" table, not \"%s\"\n", tablename); 100 printk(KERN_WARNING "CONNMARK: restore can only be "
100 return 0; 101 "called from \"mangle\" table, not \"%s\"\n",
101 } 102 tablename);
103 return 0;
104 }
102 } 105 }
103
104 if (matchinfo->mark > 0xffffffff || matchinfo->mask > 0xffffffff) { 106 if (matchinfo->mark > 0xffffffff || matchinfo->mask > 0xffffffff) {
105 printk(KERN_WARNING "CONNMARK: Only supports 32bit mark\n"); 107 printk(KERN_WARNING "CONNMARK: Only supports 32bit mark\n");
106 return 0; 108 return 0;
107 } 109 }
108
109 return 1; 110 return 1;
110} 111}
111 112