Merge branch 'tgraf/trivial-fixes'

http://lists.infradead.org/pipermail/libnl/2014-August/001614.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-08-26 13:13:28 +02:00
commit 54f6d7d1b3
13 changed files with 15 additions and 48 deletions

View file

@ -58,7 +58,7 @@ extern enum nfnl_log_copy_mode nfnl_log_get_copy_mode(const struct nfnl_log *);
extern char * nfnl_log_copy_mode2str(enum nfnl_log_copy_mode,
char *, size_t);
extern enum nfnl_log_copy_mode nfnl_log_str2copy_mode(const char *);
extern int nfnl_log_str2copy_mode(const char *);
extern void nfnl_log_set_copy_range(struct nfnl_log *, uint32_t);
extern int nfnl_log_test_copy_range(const struct nfnl_log *);

View file

@ -54,7 +54,7 @@ extern enum nfnl_queue_copy_mode nfnl_queue_get_copy_mode(const struct nfnl_queu
extern char * nfnl_queue_copy_mode2str(enum nfnl_queue_copy_mode,
char *, size_t);
extern enum nfnl_queue_copy_mode nfnl_queue_str2copy_mode(const char *);
extern int nfnl_queue_str2copy_mode(const char *);
extern void nfnl_queue_set_copy_range(struct nfnl_queue *,
uint32_t);

View file

@ -35,19 +35,11 @@ static uint64_t ntohll(uint64_t x)
{
return x;
}
static uint64_t htonll(uint64_t x)
{
return x;
}
#elif __BYTE_ORDER == __LITTLE_ENDIAN
static uint64_t ntohll(uint64_t x)
{
return bswap_64(x);
}
static uint64_t htonll(uint64_t x)
{
return bswap_64(x);
}
#endif
static struct nla_policy ct_policy[CTA_MAX+1] = {

View file

@ -69,7 +69,7 @@ char *nfnl_log_copy_mode2str(enum nfnl_log_copy_mode copy_mode, char *buf,
ARRAY_SIZE(copy_modes));
}
enum nfnl_log_copy_mode nfnl_log_str2copy_mode(const char *name)
int nfnl_log_str2copy_mode(const char *name)
{
return __str2type(name, copy_modes, ARRAY_SIZE(copy_modes));
}

View file

@ -65,7 +65,7 @@ char *nfnl_queue_copy_mode2str(enum nfnl_queue_copy_mode copy_mode, char *buf,
ARRAY_SIZE(copy_modes));
}
enum nfnl_queue_copy_mode nfnl_queue_str2copy_mode(const char *name)
int nfnl_queue_str2copy_mode(const char *name)
{
return __str2type(name, copy_modes, ARRAY_SIZE(copy_modes));
}

View file

@ -655,7 +655,6 @@ int xfrmnl_sa_parse(struct nlmsghdr *n, struct xfrmnl_sa **result)
struct nlattr *tb[XFRMA_MAX + 1];
struct xfrm_usersa_info* sa_info;
struct xfrm_user_expire* ue;
struct xfrm_usersa_id* sa_id;
int len, err;
struct nl_addr* addr;
@ -675,7 +674,6 @@ int xfrmnl_sa_parse(struct nlmsghdr *n, struct xfrmnl_sa **result)
}
else if (n->nlmsg_type == XFRM_MSG_DELSA)
{
sa_id = nlmsg_data(n);
sa_info = (struct xfrm_usersa_info*)(nlmsg_data(n) + sizeof (struct xfrm_usersa_id) + NLA_HDRLEN);
}
else

View file

@ -518,7 +518,6 @@ int xfrmnl_sp_parse(struct nlmsghdr *n, struct xfrmnl_sp **result)
struct xfrmnl_sp *sp;
struct nlattr *tb[XFRMA_MAX + 1];
struct xfrm_userpolicy_info *sp_info;
struct xfrm_userpolicy_id *sp_id;
int len, err;
struct nl_addr* addr;
@ -531,7 +530,6 @@ int xfrmnl_sp_parse(struct nlmsghdr *n, struct xfrmnl_sp **result)
sp->ce_msgtype = n->nlmsg_type;
if (n->nlmsg_type == XFRM_MSG_DELPOLICY)
{
sp_id = nlmsg_data(n);
sp_info = (struct xfrm_userpolicy_info*)(nlmsg_data(n) + sizeof (struct xfrm_userpolicy_id) + NLA_HDRLEN);
}
else
@ -1296,21 +1294,6 @@ int xfrmnl_sp_set_mark (struct xfrmnl_sp* sp, unsigned int value, unsigned int m
return 0;
}
static inline int __assign_addr(struct xfrmnl_sp* sp, struct nl_addr **pos,
struct nl_addr *new, int flag)
{
if (*pos)
nl_addr_put(*pos);
nl_addr_get(new);
*pos = new;
sp->ce_mask |= flag;
return 0;
}
/** @} */
static struct nl_object_ops xfrm_sp_obj_ops = {

View file

@ -52,9 +52,8 @@ int main(int argc, char *argv[])
{
struct nl_sock *nf_sock;
struct nl_sock *rt_sock;
struct nl_cache *link_cache;
struct nfnl_log *log;
enum nfnl_log_copy_mode copy_mode;
int copy_mode;
uint32_t copy_range;
int err;
int family;
@ -116,7 +115,7 @@ int main(int argc, char *argv[])
rt_sock = nl_cli_alloc_socket();
nl_cli_connect(rt_sock, NETLINK_ROUTE);
link_cache = nl_cli_link_alloc_cache(rt_sock);
nl_cli_link_alloc_cache(rt_sock);
while (1) {
fd_set rfds;

View file

@ -60,9 +60,8 @@ static int event_input(struct nl_msg *msg, void *arg)
int main(int argc, char *argv[])
{
struct nl_sock *rt_sock;
struct nl_cache *link_cache;
struct nfnl_queue *queue;
enum nfnl_queue_copy_mode copy_mode;
int copy_mode;
uint32_t copy_range;
int err = 1;
int family;
@ -116,7 +115,7 @@ int main(int argc, char *argv[])
rt_sock = nl_cli_alloc_socket();
nl_cli_connect(rt_sock, NETLINK_ROUTE);
link_cache = nl_cli_link_alloc_cache(rt_sock);
nl_cli_link_alloc_cache(rt_sock);
nl_socket_set_buffer_size(nf_sock, 1024*127, 1024*127);

View file

@ -35,7 +35,6 @@ static int event_input(struct nl_msg *msg, void *arg)
int main(int argc, char *argv[])
{
struct nl_sock *sock;
struct nl_cache *link_cache;
int err = 1;
int i, idx;
@ -92,7 +91,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Warning: Unknown group: %s\n", argv[idx]);
}
link_cache = nl_cli_link_alloc_cache(sock);
nl_cli_link_alloc_cache(sock);
while (1) {
fd_set rfds;

View file

@ -28,7 +28,7 @@ static void print_usage(void)
int main(int argc, char *argv[])
{
struct nl_sock *sock;
struct nl_cache *link_cache, *neightbl_cache;
struct nl_cache *neightbl_cache;
struct nl_dump_params params = {
.dp_type = NL_DUMP_LINE,
.dp_fd = stdout,
@ -36,7 +36,7 @@ int main(int argc, char *argv[])
sock = nl_cli_alloc_socket();
nl_cli_connect(sock, NETLINK_ROUTE);
link_cache = nl_cli_link_alloc_cache(sock);
nl_cli_link_alloc_cache(sock);
neightbl_cache = nl_cli_alloc_cache(sock, "neighbour table",
rtnl_neightbl_alloc_cache);

View file

@ -43,7 +43,6 @@ static int cb(struct nl_msg *msg, void *arg)
int main(int argc, char *argv[])
{
struct nl_sock *sock;
struct nl_cache *link_cache, *route_cache;
struct nl_addr *dst;
int err = 1;
@ -52,8 +51,8 @@ int main(int argc, char *argv[])
sock = nl_cli_alloc_socket();
nl_cli_connect(sock, NETLINK_ROUTE);
link_cache = nl_cli_link_alloc_cache(sock);
route_cache = nl_cli_route_alloc_cache(sock, 0);
nl_cli_link_alloc_cache(sock);
nl_cli_route_alloc_cache(sock, 0);
dst = nl_cli_addr_parse(argv[1], AF_INET);
@ -83,7 +82,5 @@ int main(int argc, char *argv[])
nl_cli_fatal(err, "%s", nl_geterror(err));
}
//nl_cache_dump(route_cache, &params);
return 0;
}

View file

@ -34,7 +34,7 @@ int main(int argc, char *argv[])
{
struct nl_sock *sock;
struct rtnl_rule *rule;
struct nl_cache *link_cache, *rule_cache;
struct nl_cache *rule_cache;
struct nl_dump_params params = {
.dp_fd = stdout,
.dp_type = NL_DUMP_LINE,
@ -42,7 +42,7 @@ int main(int argc, char *argv[])
sock = nl_cli_alloc_socket();
nl_cli_connect(sock, NETLINK_ROUTE);
link_cache = nl_cli_link_alloc_cache(sock);
nl_cli_link_alloc_cache(sock);
rule_cache = nl_cli_rule_alloc_cache(sock);
rule = nl_cli_rule_alloc();