[PATCH] libnl: Introduce ipip tunnel API

Susant Sahani susant at redhat.com
Thu Apr 24 10:25:30 PDT 2014


On 04/24/2014 02:53 PM, Thomas Graf wrote:
> On 04/23/14 at 11:20am, Susant Sahani wrote:
>> This patch introduces ipip tunnel support.
Hi Thomas,
> LGTM, see some comments below. I'm fine with a v2 or with
> follow-up patches.
>
> Since the spotted issues are minor:
>
> Acked-by: Thomas Graf <tgraf at suug.ch>
>
Thanks for reviewing
>> + */
>> +
>> +/**
>> + * @ingroup link
>> + * @defgroup ipip IPIP
>> + * ipip link module
>> + *
>> + * @details
>> + * \b Link Type Name: "ipip"
>> + *
>> + * @route_doc{link_ipip, IPIP Documentation}
> Can you do a follow-up patch which adds a short section to
> doc/route.txt with a section name [link_ipip] to quickly
> explain how to use this new module?
Added a example now .
>> +static int ipip_clone(struct rtnl_link *dst, struct rtnl_link *src)
>> +{
>> +        struct ipip_info *ipip_dst, *ipip_src = src->l_info;
>> +        int err;
>> +
>> +        dst->l_info = NULL;
>> +
>> +        err = rtnl_link_set_type(dst, "ipip");
>> +        if (err < 0)
>> +                return err;
>> +
>> +        ipip_dst = dst->l_info;
>> +
>> +        if (!ipip_dst || !ipip_src)
>> +                return -NLE_NOMEM;
> This looks a bit wrong. Is !ipip_src even possible? I would assume
> we can only end up in ipip_clone() if the src is of type "ipip".
> A BUG() statement might be better in this case.
hmmm . Modified
>> +int rtnl_link_ipip_tunnel_add(struct nl_sock *sk, const char *name)
>> +{
> It would be great to have a follow-up patch add documentation to these
> public functions.
>
I have added. Please take a look.

Thanks,
Susant



More information about the libnl mailing list