Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 1 | /* |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 2 | * Copyright (c) 2008-2009 Patrick McHardy <kaber@trash.net> |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * Development of this code funded by Astaro AG (http://www.astaro.com/) |
| 9 | */ |
| 10 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/module.h> |
| 14 | #include <linux/netlink.h> |
| 15 | #include <linux/netfilter.h> |
| 16 | #include <linux/netfilter/nf_tables.h> |
| 17 | #include <net/netfilter/nf_tables.h> |
| 18 | #include <net/netfilter/nf_conntrack.h> |
| 19 | #include <net/netfilter/nf_conntrack_tuple.h> |
| 20 | #include <net/netfilter/nf_conntrack_helper.h> |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 21 | #include <net/netfilter/nf_conntrack_ecache.h> |
Florian Westphal | d2bf2f3 | 2014-02-18 15:25:32 +0100 | [diff] [blame] | 22 | #include <net/netfilter/nf_conntrack_labels.h> |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 23 | |
| 24 | struct nft_ct { |
| 25 | enum nft_ct_keys key:8; |
| 26 | enum ip_conntrack_dir dir:8; |
Patrick McHardy | d46f2cd | 2014-03-07 19:08:32 +0100 | [diff] [blame] | 27 | union { |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 28 | enum nft_registers dreg:8; |
| 29 | enum nft_registers sreg:8; |
| 30 | }; |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 31 | }; |
| 32 | |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 33 | static void nft_ct_get_eval(const struct nft_expr *expr, |
| 34 | struct nft_data data[NFT_REG_MAX + 1], |
| 35 | const struct nft_pktinfo *pkt) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 36 | { |
| 37 | const struct nft_ct *priv = nft_expr_priv(expr); |
| 38 | struct nft_data *dest = &data[priv->dreg]; |
| 39 | enum ip_conntrack_info ctinfo; |
| 40 | const struct nf_conn *ct; |
| 41 | const struct nf_conn_help *help; |
| 42 | const struct nf_conntrack_tuple *tuple; |
| 43 | const struct nf_conntrack_helper *helper; |
| 44 | long diff; |
| 45 | unsigned int state; |
| 46 | |
| 47 | ct = nf_ct_get(pkt->skb, &ctinfo); |
| 48 | |
| 49 | switch (priv->key) { |
| 50 | case NFT_CT_STATE: |
| 51 | if (ct == NULL) |
| 52 | state = NF_CT_STATE_INVALID_BIT; |
| 53 | else if (nf_ct_is_untracked(ct)) |
| 54 | state = NF_CT_STATE_UNTRACKED_BIT; |
| 55 | else |
| 56 | state = NF_CT_STATE_BIT(ctinfo); |
| 57 | dest->data[0] = state; |
| 58 | return; |
| 59 | } |
| 60 | |
| 61 | if (ct == NULL) |
| 62 | goto err; |
| 63 | |
| 64 | switch (priv->key) { |
| 65 | case NFT_CT_DIRECTION: |
| 66 | dest->data[0] = CTINFO2DIR(ctinfo); |
| 67 | return; |
| 68 | case NFT_CT_STATUS: |
| 69 | dest->data[0] = ct->status; |
| 70 | return; |
| 71 | #ifdef CONFIG_NF_CONNTRACK_MARK |
| 72 | case NFT_CT_MARK: |
| 73 | dest->data[0] = ct->mark; |
| 74 | return; |
| 75 | #endif |
| 76 | #ifdef CONFIG_NF_CONNTRACK_SECMARK |
| 77 | case NFT_CT_SECMARK: |
| 78 | dest->data[0] = ct->secmark; |
| 79 | return; |
| 80 | #endif |
| 81 | case NFT_CT_EXPIRATION: |
| 82 | diff = (long)jiffies - (long)ct->timeout.expires; |
| 83 | if (diff < 0) |
| 84 | diff = 0; |
| 85 | dest->data[0] = jiffies_to_msecs(diff); |
| 86 | return; |
| 87 | case NFT_CT_HELPER: |
| 88 | if (ct->master == NULL) |
| 89 | goto err; |
| 90 | help = nfct_help(ct->master); |
| 91 | if (help == NULL) |
| 92 | goto err; |
| 93 | helper = rcu_dereference(help->helper); |
| 94 | if (helper == NULL) |
| 95 | goto err; |
| 96 | if (strlen(helper->name) >= sizeof(dest->data)) |
| 97 | goto err; |
| 98 | strncpy((char *)dest->data, helper->name, sizeof(dest->data)); |
| 99 | return; |
Florian Westphal | d2bf2f3 | 2014-02-18 15:25:32 +0100 | [diff] [blame] | 100 | #ifdef CONFIG_NF_CONNTRACK_LABELS |
| 101 | case NFT_CT_LABELS: { |
| 102 | struct nf_conn_labels *labels = nf_ct_labels_find(ct); |
| 103 | unsigned int size; |
| 104 | |
| 105 | if (!labels) { |
| 106 | memset(dest->data, 0, sizeof(dest->data)); |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | BUILD_BUG_ON(NF_CT_LABELS_MAX_SIZE > sizeof(dest->data)); |
| 111 | size = labels->words * sizeof(long); |
| 112 | |
| 113 | memcpy(dest->data, labels->bits, size); |
| 114 | if (size < sizeof(dest->data)) |
| 115 | memset(((char *) dest->data) + size, 0, |
| 116 | sizeof(dest->data) - size); |
| 117 | return; |
| 118 | } |
| 119 | #endif |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | tuple = &ct->tuplehash[priv->dir].tuple; |
| 123 | switch (priv->key) { |
| 124 | case NFT_CT_L3PROTOCOL: |
| 125 | dest->data[0] = nf_ct_l3num(ct); |
| 126 | return; |
| 127 | case NFT_CT_SRC: |
| 128 | memcpy(dest->data, tuple->src.u3.all, |
| 129 | nf_ct_l3num(ct) == NFPROTO_IPV4 ? 4 : 16); |
| 130 | return; |
| 131 | case NFT_CT_DST: |
| 132 | memcpy(dest->data, tuple->dst.u3.all, |
| 133 | nf_ct_l3num(ct) == NFPROTO_IPV4 ? 4 : 16); |
| 134 | return; |
| 135 | case NFT_CT_PROTOCOL: |
| 136 | dest->data[0] = nf_ct_protonum(ct); |
| 137 | return; |
| 138 | case NFT_CT_PROTO_SRC: |
| 139 | dest->data[0] = (__force __u16)tuple->src.u.all; |
| 140 | return; |
| 141 | case NFT_CT_PROTO_DST: |
| 142 | dest->data[0] = (__force __u16)tuple->dst.u.all; |
| 143 | return; |
| 144 | } |
| 145 | return; |
| 146 | err: |
| 147 | data[NFT_REG_VERDICT].verdict = NFT_BREAK; |
| 148 | } |
| 149 | |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 150 | static void nft_ct_set_eval(const struct nft_expr *expr, |
| 151 | struct nft_data data[NFT_REG_MAX + 1], |
| 152 | const struct nft_pktinfo *pkt) |
| 153 | { |
| 154 | const struct nft_ct *priv = nft_expr_priv(expr); |
| 155 | struct sk_buff *skb = pkt->skb; |
Kristian Evensen | 847c8e2 | 2014-01-10 21:43:20 +0100 | [diff] [blame] | 156 | #ifdef CONFIG_NF_CONNTRACK_MARK |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 157 | u32 value = data[priv->sreg].data[0]; |
Kristian Evensen | 847c8e2 | 2014-01-10 21:43:20 +0100 | [diff] [blame] | 158 | #endif |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 159 | enum ip_conntrack_info ctinfo; |
| 160 | struct nf_conn *ct; |
| 161 | |
| 162 | ct = nf_ct_get(skb, &ctinfo); |
| 163 | if (ct == NULL) |
| 164 | return; |
| 165 | |
| 166 | switch (priv->key) { |
| 167 | #ifdef CONFIG_NF_CONNTRACK_MARK |
| 168 | case NFT_CT_MARK: |
| 169 | if (ct->mark != value) { |
| 170 | ct->mark = value; |
| 171 | nf_conntrack_event_cache(IPCT_MARK, ct); |
| 172 | } |
| 173 | break; |
| 174 | #endif |
| 175 | } |
| 176 | } |
| 177 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 178 | static const struct nla_policy nft_ct_policy[NFTA_CT_MAX + 1] = { |
| 179 | [NFTA_CT_DREG] = { .type = NLA_U32 }, |
| 180 | [NFTA_CT_KEY] = { .type = NLA_U32 }, |
| 181 | [NFTA_CT_DIRECTION] = { .type = NLA_U8 }, |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 182 | [NFTA_CT_SREG] = { .type = NLA_U32 }, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 183 | }; |
| 184 | |
Patrick McHardy | 9638f33 | 2014-01-06 18:09:49 +0000 | [diff] [blame] | 185 | static int nft_ct_l3proto_try_module_get(uint8_t family) |
| 186 | { |
| 187 | int err; |
| 188 | |
| 189 | if (family == NFPROTO_INET) { |
| 190 | err = nf_ct_l3proto_try_module_get(NFPROTO_IPV4); |
| 191 | if (err < 0) |
| 192 | goto err1; |
| 193 | err = nf_ct_l3proto_try_module_get(NFPROTO_IPV6); |
| 194 | if (err < 0) |
| 195 | goto err2; |
| 196 | } else { |
| 197 | err = nf_ct_l3proto_try_module_get(family); |
| 198 | if (err < 0) |
| 199 | goto err1; |
| 200 | } |
| 201 | return 0; |
| 202 | |
| 203 | err2: |
| 204 | nf_ct_l3proto_module_put(NFPROTO_IPV4); |
| 205 | err1: |
| 206 | return err; |
| 207 | } |
| 208 | |
| 209 | static void nft_ct_l3proto_module_put(uint8_t family) |
| 210 | { |
| 211 | if (family == NFPROTO_INET) { |
| 212 | nf_ct_l3proto_module_put(NFPROTO_IPV4); |
| 213 | nf_ct_l3proto_module_put(NFPROTO_IPV6); |
| 214 | } else |
| 215 | nf_ct_l3proto_module_put(family); |
| 216 | } |
| 217 | |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 218 | static int nft_ct_init_validate_get(const struct nft_expr *expr, |
| 219 | const struct nlattr * const tb[]) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 220 | { |
| 221 | struct nft_ct *priv = nft_expr_priv(expr); |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 222 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 223 | if (tb[NFTA_CT_DIRECTION] != NULL) { |
| 224 | priv->dir = nla_get_u8(tb[NFTA_CT_DIRECTION]); |
| 225 | switch (priv->dir) { |
| 226 | case IP_CT_DIR_ORIGINAL: |
| 227 | case IP_CT_DIR_REPLY: |
| 228 | break; |
| 229 | default: |
| 230 | return -EINVAL; |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | switch (priv->key) { |
| 235 | case NFT_CT_STATE: |
| 236 | case NFT_CT_DIRECTION: |
| 237 | case NFT_CT_STATUS: |
| 238 | #ifdef CONFIG_NF_CONNTRACK_MARK |
| 239 | case NFT_CT_MARK: |
| 240 | #endif |
| 241 | #ifdef CONFIG_NF_CONNTRACK_SECMARK |
| 242 | case NFT_CT_SECMARK: |
| 243 | #endif |
Florian Westphal | d2bf2f3 | 2014-02-18 15:25:32 +0100 | [diff] [blame] | 244 | #ifdef CONFIG_NF_CONNTRACK_LABELS |
| 245 | case NFT_CT_LABELS: |
| 246 | #endif |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 247 | case NFT_CT_EXPIRATION: |
| 248 | case NFT_CT_HELPER: |
| 249 | if (tb[NFTA_CT_DIRECTION] != NULL) |
| 250 | return -EINVAL; |
| 251 | break; |
Patrick McHardy | 51292c0 | 2014-02-05 15:03:36 +0000 | [diff] [blame] | 252 | case NFT_CT_L3PROTOCOL: |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 253 | case NFT_CT_PROTOCOL: |
| 254 | case NFT_CT_SRC: |
| 255 | case NFT_CT_DST: |
| 256 | case NFT_CT_PROTO_SRC: |
| 257 | case NFT_CT_PROTO_DST: |
| 258 | if (tb[NFTA_CT_DIRECTION] == NULL) |
| 259 | return -EINVAL; |
| 260 | break; |
| 261 | default: |
| 262 | return -EOPNOTSUPP; |
| 263 | } |
| 264 | |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 265 | return 0; |
| 266 | } |
| 267 | |
| 268 | static int nft_ct_init_validate_set(uint32_t key) |
| 269 | { |
| 270 | switch (key) { |
| 271 | case NFT_CT_MARK: |
| 272 | break; |
| 273 | default: |
| 274 | return -EOPNOTSUPP; |
| 275 | } |
| 276 | |
| 277 | return 0; |
| 278 | } |
| 279 | |
| 280 | static int nft_ct_init(const struct nft_ctx *ctx, |
| 281 | const struct nft_expr *expr, |
| 282 | const struct nlattr * const tb[]) |
| 283 | { |
| 284 | struct nft_ct *priv = nft_expr_priv(expr); |
| 285 | int err; |
| 286 | |
| 287 | priv->key = ntohl(nla_get_be32(tb[NFTA_CT_KEY])); |
| 288 | |
| 289 | if (tb[NFTA_CT_DREG]) { |
| 290 | err = nft_ct_init_validate_get(expr, tb); |
| 291 | if (err < 0) |
| 292 | return err; |
| 293 | |
| 294 | priv->dreg = ntohl(nla_get_be32(tb[NFTA_CT_DREG])); |
| 295 | err = nft_validate_output_register(priv->dreg); |
| 296 | if (err < 0) |
| 297 | return err; |
| 298 | |
| 299 | err = nft_validate_data_load(ctx, priv->dreg, NULL, |
| 300 | NFT_DATA_VALUE); |
| 301 | if (err < 0) |
| 302 | return err; |
| 303 | } else { |
| 304 | err = nft_ct_init_validate_set(priv->key); |
| 305 | if (err < 0) |
| 306 | return err; |
| 307 | |
| 308 | priv->sreg = ntohl(nla_get_be32(tb[NFTA_CT_SREG])); |
| 309 | err = nft_validate_input_register(priv->sreg); |
| 310 | if (err < 0) |
| 311 | return err; |
| 312 | } |
| 313 | |
Patrick McHardy | 9638f33 | 2014-01-06 18:09:49 +0000 | [diff] [blame] | 314 | err = nft_ct_l3proto_try_module_get(ctx->afi->family); |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 315 | if (err < 0) |
| 316 | return err; |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 317 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 318 | return 0; |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 319 | } |
| 320 | |
Patrick McHardy | 62472bc | 2014-03-07 19:08:30 +0100 | [diff] [blame] | 321 | static void nft_ct_destroy(const struct nft_ctx *ctx, |
| 322 | const struct nft_expr *expr) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 323 | { |
Patrick McHardy | d46f2cd | 2014-03-07 19:08:32 +0100 | [diff] [blame] | 324 | nft_ct_l3proto_module_put(ctx->afi->family); |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 325 | } |
| 326 | |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 327 | static int nft_ct_get_dump(struct sk_buff *skb, const struct nft_expr *expr) |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 328 | { |
| 329 | const struct nft_ct *priv = nft_expr_priv(expr); |
| 330 | |
| 331 | if (nla_put_be32(skb, NFTA_CT_DREG, htonl(priv->dreg))) |
| 332 | goto nla_put_failure; |
| 333 | if (nla_put_be32(skb, NFTA_CT_KEY, htonl(priv->key))) |
| 334 | goto nla_put_failure; |
Arturo Borrero | 2a53bfb | 2014-01-17 02:28:45 +0100 | [diff] [blame] | 335 | |
| 336 | switch (priv->key) { |
| 337 | case NFT_CT_PROTOCOL: |
| 338 | case NFT_CT_SRC: |
| 339 | case NFT_CT_DST: |
| 340 | case NFT_CT_PROTO_SRC: |
| 341 | case NFT_CT_PROTO_DST: |
| 342 | if (nla_put_u8(skb, NFTA_CT_DIRECTION, priv->dir)) |
| 343 | goto nla_put_failure; |
| 344 | default: |
| 345 | break; |
| 346 | } |
| 347 | |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 348 | return 0; |
| 349 | |
| 350 | nla_put_failure: |
| 351 | return -1; |
| 352 | } |
| 353 | |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 354 | static int nft_ct_set_dump(struct sk_buff *skb, const struct nft_expr *expr) |
| 355 | { |
| 356 | const struct nft_ct *priv = nft_expr_priv(expr); |
| 357 | |
| 358 | if (nla_put_be32(skb, NFTA_CT_SREG, htonl(priv->sreg))) |
| 359 | goto nla_put_failure; |
| 360 | if (nla_put_be32(skb, NFTA_CT_KEY, htonl(priv->key))) |
| 361 | goto nla_put_failure; |
| 362 | return 0; |
| 363 | |
| 364 | nla_put_failure: |
| 365 | return -1; |
| 366 | } |
| 367 | |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 368 | static struct nft_expr_type nft_ct_type; |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 369 | static const struct nft_expr_ops nft_ct_get_ops = { |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 370 | .type = &nft_ct_type, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 371 | .size = NFT_EXPR_SIZE(sizeof(struct nft_ct)), |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 372 | .eval = nft_ct_get_eval, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 373 | .init = nft_ct_init, |
| 374 | .destroy = nft_ct_destroy, |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 375 | .dump = nft_ct_get_dump, |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 376 | }; |
| 377 | |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 378 | static const struct nft_expr_ops nft_ct_set_ops = { |
| 379 | .type = &nft_ct_type, |
| 380 | .size = NFT_EXPR_SIZE(sizeof(struct nft_ct)), |
| 381 | .eval = nft_ct_set_eval, |
| 382 | .init = nft_ct_init, |
| 383 | .destroy = nft_ct_destroy, |
| 384 | .dump = nft_ct_set_dump, |
| 385 | }; |
| 386 | |
| 387 | static const struct nft_expr_ops * |
| 388 | nft_ct_select_ops(const struct nft_ctx *ctx, |
| 389 | const struct nlattr * const tb[]) |
| 390 | { |
| 391 | if (tb[NFTA_CT_KEY] == NULL) |
| 392 | return ERR_PTR(-EINVAL); |
| 393 | |
| 394 | if (tb[NFTA_CT_DREG] && tb[NFTA_CT_SREG]) |
| 395 | return ERR_PTR(-EINVAL); |
| 396 | |
| 397 | if (tb[NFTA_CT_DREG]) |
| 398 | return &nft_ct_get_ops; |
| 399 | |
| 400 | if (tb[NFTA_CT_SREG]) |
| 401 | return &nft_ct_set_ops; |
| 402 | |
| 403 | return ERR_PTR(-EINVAL); |
| 404 | } |
| 405 | |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 406 | static struct nft_expr_type nft_ct_type __read_mostly = { |
| 407 | .name = "ct", |
Kristian Evensen | c4ede3d | 2014-01-07 16:43:54 +0100 | [diff] [blame] | 408 | .select_ops = &nft_ct_select_ops, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 409 | .policy = nft_ct_policy, |
| 410 | .maxattr = NFTA_CT_MAX, |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 411 | .owner = THIS_MODULE, |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 412 | }; |
| 413 | |
| 414 | static int __init nft_ct_module_init(void) |
| 415 | { |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 416 | return nft_register_expr(&nft_ct_type); |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 417 | } |
| 418 | |
| 419 | static void __exit nft_ct_module_exit(void) |
| 420 | { |
Patrick McHardy | ef1f7df | 2013-10-10 11:41:20 +0200 | [diff] [blame] | 421 | nft_unregister_expr(&nft_ct_type); |
Patrick McHardy | 9651851 | 2013-10-14 11:00:02 +0200 | [diff] [blame] | 422 | } |
| 423 | |
| 424 | module_init(nft_ct_module_init); |
| 425 | module_exit(nft_ct_module_exit); |
| 426 | |
| 427 | MODULE_LICENSE("GPL"); |
| 428 | MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); |
| 429 | MODULE_ALIAS_NFT_EXPR("ct"); |