diff options
| author | Luigi Rizzo <luigi@FreeBSD.org> | 2014-01-11 00:00:11 +0000 |
|---|---|---|
| committer | Luigi Rizzo <luigi@FreeBSD.org> | 2014-01-11 00:00:11 +0000 |
| commit | b82b22118145c0333f373569dcd40dc847001b9d (patch) | |
| tree | f7bb18ea51bd616e9ca74433170f7c5fcea16e3d /sys/net/netmap_user.h | |
| parent | b17b15d8ea55f8cb4c5a3bdfae755c545d10aea2 (diff) | |
Notes
Diffstat (limited to 'sys/net/netmap_user.h')
| -rw-r--r-- | sys/net/netmap_user.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/netmap_user.h b/sys/net/netmap_user.h index bd6fe0db22ae..72882b08a2a3 100644 --- a/sys/net/netmap_user.h +++ b/sys/net/netmap_user.h @@ -164,6 +164,7 @@ struct nm_desc_t { /* * when the descriptor is open correctly, d->self == d + * Eventually we should also use some magic number. */ #define P2NMD(p) ((struct nm_desc_t *)(p)) #define IS_NETMAP_DESC(d) (P2NMD(d)->self == P2NMD(d)) @@ -181,8 +182,9 @@ struct nm_desc_t { static inline void pkt_copy(const void *_src, void *_dst, int l) { - const uint64_t *src = _src; - uint64_t *dst = _dst; + const uint64_t *src = (const uint64_t *)_src; + uint64_t *dst = (uint64_t *)_dst; + if (unlikely(l >= 1024)) { memcpy(dst, src, l); return; @@ -317,7 +319,8 @@ nm_close(struct nm_desc_t *d) * ugly trick to avoid unused warnings */ static void *__xxzt[] __attribute__ ((unused)) = - { nm_open, nm_inject, nm_dispatch, nm_nextpkt } ; + { (void *)nm_open, (void *)nm_inject, + (void *)nm_dispatch, (void *)nm_nextpkt } ; if (d == NULL || d->self != d) return EINVAL; |
