aboutgitcodebugslistschat
path: root/netlink.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-08-03 17:19:53 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-08-04 01:30:22 +0200
commit8de9805224046bfb601b6c59b1b482fd08f3ce24 (patch)
tree1a6d1f727340096e83d5264686d3f17d1905cf09 /netlink.h
parenta3093182758eb58116eb5b400f3c44acef571056 (diff)
downloadpasst-8de9805224046bfb601b6c59b1b482fd08f3ce24.tar
passt-8de9805224046bfb601b6c59b1b482fd08f3ce24.tar.gz
passt-8de9805224046bfb601b6c59b1b482fd08f3ce24.tar.bz2
passt-8de9805224046bfb601b6c59b1b482fd08f3ce24.tar.lz
passt-8de9805224046bfb601b6c59b1b482fd08f3ce24.tar.xz
passt-8de9805224046bfb601b6c59b1b482fd08f3ce24.tar.zst
passt-8de9805224046bfb601b6c59b1b482fd08f3ce24.zip
netlink: Propagate errors for "set" operations
Currently if anything goes wrong while we're configuring the namespace network with --config-net, we'll just ignore it and carry on. This might lead to a silently unconfigured or misconfigured namespace environment. For simple "set" operations based on nl_do() we can now detect failures reported via netlink. Propagate those errors up to pasta_ns_conf() and report them usefully. Link: https://bugs.passt.top/show_bug.cgi?id=60 Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [sbrivio: Minor formatting changes in pasta_ns_conf()] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'netlink.h')
-rw-r--r--netlink.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/netlink.h b/netlink.h
index 5ca17c6..977244b 100644
--- a/netlink.h
+++ b/netlink.h
@@ -12,17 +12,17 @@ extern int nl_sock_ns;
void nl_sock_init(const struct ctx *c, bool ns);
unsigned int nl_get_ext_if(int s, sa_family_t af);
void nl_route_get_def(int s, unsigned int ifi, sa_family_t af, void *gw);
-void nl_route_set_def(int s, unsigned int ifi, sa_family_t af, void *gw);
+int nl_route_set_def(int s, unsigned int ifi, sa_family_t af, void *gw);
void nl_route_dup(int s_src, unsigned int ifi_src,
int s_dst, unsigned int ifi_dst, sa_family_t af);
void nl_addr_get(int s, unsigned int ifi, sa_family_t af,
void *addr, int *prefix_len, void *addr_l);
-void nl_addr_set(int s, unsigned int ifi, sa_family_t af,
- void *addr, int prefix_len);
+int nl_addr_set(int s, unsigned int ifi, sa_family_t af,
+ void *addr, int prefix_len);
void nl_addr_dup(int s_src, unsigned int ifi_src,
int s_dst, unsigned int ifi_dst, sa_family_t af);
void nl_link_get_mac(int s, unsigned int ifi, void *mac);
-void nl_link_set_mac(int s, unsigned int ifi, void *mac);
-void nl_link_up(int s, unsigned int ifi, int mtu);
+int nl_link_set_mac(int s, unsigned int ifi, void *mac);
+int nl_link_up(int s, unsigned int ifi, int mtu);
#endif /* NETLINK_H */