lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 29 Aug 2016 07:55:37 -0400
From:   Jamal Hadi Salim <>
To:     Daniel Borkmann <>,
        Eric Dumazet <>
Subject: Re: [PATCH v3 net-next 1/1] net_sched: Introduce skbmod action

On 16-08-29 07:40 AM, Jamal Hadi Salim wrote:
> On 16-08-29 07:00 AM, Daniel Borkmann wrote:

> Sorry missed that. Let me give it an attempt. I think challenge is
> going to be what length to use. For now it is ethernet; but i had
> a change which swapped VLANs that i took out.

something like this?

/* XXX: if you are going to edit more fields beyond ethernet header
  * (example when you add IP header replacement or vlan swap)
  * then MAX_EDIT_LEN needs to change appropriately
static int tcf_skbmod_run(struct sk_buff *skb, const struct tc_action *a,
                           struct tcf_result *res)
         struct tcf_skbmod *d = to_skbmod(a);
         int action = READ_ONCE(d->tcf_action);
         int err;
         u64 flags;

         err = skb_ensure_writable(skb, ETH_HLEN);
         if (unlikely(err)) /* best policy is to drop on the floor */
                 action = TC_ACT_SHOT;

         bstats_cpu_update(this_cpu_ptr(d->common.cpu_bstats), skb);
         if (unlikely(action == TC_ACT_SHOT)) {
                 return action;


Powered by blists - more mailing lists