Skip to content

Commit

Permalink
flow_keys: include thoff into flow_keys for later usage
Browse files Browse the repository at this point in the history
In skb_flow_dissect(), we perform a dissection of a skbuff. Since we're
doing the work here anyway, also store thoff for a later usage, e.g. in
the BPF filter.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Mar 20, 2013
1 parent e0ebcb8 commit 8ed7816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/net/flow_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct flow_keys {
__be32 ports;
__be16 port16[2];
};
u16 thoff;
u8 ip_proto;
};

Expand Down
2 changes: 2 additions & 0 deletions net/core/flow_dissector.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow)
flow->ports = *ports;
}

flow->thoff = (u16) nhoff;

return true;
}
EXPORT_SYMBOL(skb_flow_dissect);
Expand Down

0 comments on commit 8ed7816

Please sign in to comment.