Attention is currently required from: laforge.
1 comment:
Patchset:
but I don't really understand why adding/setting/removing addresses etc. is constrainted to tun-devices. We have the same task for other net-devices, such as for example the GTP devices.
So IMHO, there should be a generic API to perform those operations on any type of netdev (either by ifindex or name).
I am simply keeping those generic functions acting on interfaces private for now, but well separated in:
"""
static int tundev_mnl_add_addr(struct osmo_mnl *omnl, const char *dev_name, const struct osmo_sockaddr *osa, uint8_t prefix)
static int tundev_mnl_add_route(struct osmo_mnl *omnl,
const char *dev_name,
const struct osmo_sockaddr *dst_osa,
uint8_t dst_prefix,
const struct osmo_sockaddr *gw_osa)
static int tundev_mnl_set_ifupdown(struct osmo_mnl *omnl, const char *dev_name, bool up)
"""
Same applies to gtp kernel devices or hdlc net-devices, right?
Those would need separate objects since they have specific requirements to set up, manage, etc. When those are added, the static functions above can be moved to a shared place and even make a public API. I don't want to make the API public now since I'm not working on those, and would take a lot more time to start changing all implementations of all those devices everywhere (and the current task at hand is already requiring me to touch a lot of stuff in lots of places).
The netns related code is als not really specific to tun-devices, is it?
That's why I added a netns.h API in the previous commit, and the tun-device object is simply using the API to manage the netns and do the required steps at the correct points in time, without the user of the tundev having to care about those details.
To view, visit change 31025. To unsubscribe, or for help writing mail filters, visit settings.