[PATCH 05/16] gtp-rtnl: and netns support

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Pablo Neira Ayuso pablo at soleta.eu
Mon Nov 16 17:43:55 UTC 2015


On Mon, Nov 16, 2015 at 04:06:46PM +0100, Andreas Schultz wrote:
> diff --git a/libgtnl/src/gtp-genl.c b/libgtnl/src/gtp-genl.c
> index c1f60ab..9e68a30 100644
> --- a/libgtnl/src/gtp-genl.c
> +++ b/libgtnl/src/gtp-genl.c
> @@ -44,6 +44,8 @@
>  static void gtp_build_payload(struct nlmsghdr *nlh, struct gtp_tunnel *t)
>  {
>  	mnl_attr_put_u32(nlh, GTPA_VERSION, t->gtp_version);
> +	if (t->ifns > 0)
> +		mnl_attr_put_u32(nlh, GTPA_NET_NS_FD, t->ifns);

Any reason not to consider descriptor zero as valid?

I guess we'll need some flags for gtp_tunnel so we know what we have
set here.

>  	mnl_attr_put_u32(nlh, GTPA_LINK, t->ifidx);
>  	mnl_attr_put_u32(nlh, GTPA_SGSN_ADDRESS, t->sgsn_addr.s_addr);
>  	mnl_attr_put_u32(nlh, GTPA_MS_ADDRESS, t->ms_addr.s_addr);
> diff --git a/libgtnl/src/gtp-rtnl.c b/libgtnl/src/gtp-rtnl.c
> index 22b9430..db54653 100644
> --- a/libgtnl/src/gtp-rtnl.c
> +++ b/libgtnl/src/gtp-rtnl.c
> @@ -38,6 +38,10 @@
>  
>  #include "internal.h"
>  
> +#if !defined(IFLA_LINK_NETNSID)
> +#define IFLA_LINK_NETNSID (IFLA_PHYS_SWITCH_ID + 1)
> +#endif

Why do you need this?



More information about the OpenBSC mailing list