Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Andy Furniss <adf.lists@gmail.com>
To: lartc@vger.kernel.org
Subject: Re: Problem with cls_flow nfct-* keys
Date: Sun, 06 Dec 2015 11:06:20 +0000	[thread overview]
Message-ID: <566416AC.8090500@gmail.com> (raw)
In-Reply-To: <3419281448878074@web15j.yandex.ru>

Гаврилов Игорь wrote:
> After day after the day of trials and errors I finally get working solution - I use code from act_connmark and it's working pretty well.
> #define CTTUPLE(skb, member)                                            \
> ({                                                                      \
>          enum ip_conntrack_info ctinfo;                                  \
>          struct nf_conntrack_tuple tuple;                                \
>          struct nf_conntrack_zone zone;                                  \
>          const struct nf_conntrack_tuple_hash *thash;                    \
>          int proto;                                                      \
>          const struct nf_conn *ct = nf_ct_get(skb, &ctinfo);             \
>          if (ct = NULL){                                                \
>                          switch (tc_skb_protocol(skb)) {                 \
>                          case htons(ETH_P_IP):                           \
>                                  proto = NFPROTO_IPV4;                   \
>                                  break;                                  \
>                          case htons(ETH_P_IPV6):                         \
>                                  proto = NFPROTO_IPV6;                   \
>                                  break;                                  \
>                          default: goto fallback;                         \
>          }                                                               \
>          if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb), proto, &tuple)) \
>                  goto fallback;                                          \
>          zone.id = NF_CT_DEFAULT_ZONE_ID;                                \
>          zone.dir = NF_CT_DEFAULT_ZONE_DIR;                              \
>                                                                          \
>          thash = nf_conntrack_find_get(dev_net(skb->dev), &zone, &tuple);\
>          if (!thash) goto fallback;                                      \
>          ct = nf_ct_tuplehash_to_ctrack(thash);}                         \
>
>          ct->tuplehash[CTINFO2DIR(ctinfo)].tuple.member;                 \
> })
>
>
> I can get info about original src/dst on ingress. But there is a little problem in function ct->tuplehash[CTINFO2DIR(ctinfo)].tuple.member;
> I can't get valid direction, because I don't get ctinfo. Is any solustion for my situation?

I don't know, maybe you could ask on the netfilter list or netdev.


--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-12-06 11:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 10:07 Problem with cls_flow nfct-* keys Гаврилов Игорь
2015-11-30 11:33 ` Гаврилов Игорь
2015-11-30 12:02 ` Andy Furniss
2015-11-30 15:49 ` Гаврилов Игорь
2015-12-03  0:24 ` Andy Furniss
2015-12-03  8:45 ` Гаврилов Игорь
2015-12-03  9:19 ` Florian Westphal
2015-12-03 10:50 ` Гаврилов Игорь
2015-12-03 10:51 ` Andy Furniss
2015-12-04 16:00 ` Гаврилов Игорь
2015-12-06 11:06 ` Andy Furniss [this message]
2015-12-07 11:15 ` Гаврилов Игорь
2015-12-08 21:38 ` Andy Furniss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=566416AC.8090500@gmail.com \
    --to=adf.lists@gmail.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox