diff options
| author | Antonio Quartulli <antonio@meshcoding.com> | 2013-10-23 17:36:30 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-10-25 19:26:58 -0400 |
| commit | 8fb479a47c869820966e7298f38038aa334d889c (patch) | |
| tree | 8bed2e3774b7334973aea14ed06f7156cde2fb87 /include/linux | |
| parent | c7c6effdeffcafd792b9f880ad52e48689eea4ad (diff) | |
netpoll: fix rx_hook() interface by passing the skb
Right now skb->data is passed to rx_hook() even if the skb
has not been linearised and without giving rx_hook() a way
to linearise it.
Change the rx_hook() interface and make it accept the skb
and the offset to the UDP payload as arguments. rx_hook() is
also renamed to rx_skb_hook() to ensure that out of the tree
users notice the API change.
In this way any rx_skb_hook() implementation can perform all
the needed operations to properly (and safely) access the
skb data.
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netpoll.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index f3c7c24bec1c..fbfdb9d8d3a7 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -24,7 +24,8 @@ struct netpoll { | |||
| 24 | struct net_device *dev; | 24 | struct net_device *dev; |
| 25 | char dev_name[IFNAMSIZ]; | 25 | char dev_name[IFNAMSIZ]; |
| 26 | const char *name; | 26 | const char *name; |
| 27 | void (*rx_hook)(struct netpoll *, int, char *, int); | 27 | void (*rx_skb_hook)(struct netpoll *np, int source, struct sk_buff *skb, |
| 28 | int offset, int len); | ||
| 28 | 29 | ||
| 29 | union inet_addr local_ip, remote_ip; | 30 | union inet_addr local_ip, remote_ip; |
| 30 | bool ipv6; | 31 | bool ipv6; |
| @@ -41,7 +42,7 @@ struct netpoll_info { | |||
| 41 | unsigned long rx_flags; | 42 | unsigned long rx_flags; |
| 42 | spinlock_t rx_lock; | 43 | spinlock_t rx_lock; |
| 43 | struct semaphore dev_lock; | 44 | struct semaphore dev_lock; |
| 44 | struct list_head rx_np; /* netpolls that registered an rx_hook */ | 45 | struct list_head rx_np; /* netpolls that registered an rx_skb_hook */ |
| 45 | 46 | ||
| 46 | struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */ | 47 | struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */ |
| 47 | struct sk_buff_head txq; | 48 | struct sk_buff_head txq; |
