[systemd-devel] [PATCH] networkd: introduce vti6 tunnel

Susant Sahani susant at redhat.com
Tue Apr 21 23:42:44 PDT 2015



On 04/21/2015 09:54 PM, Lennart Poettering wrote:
> On Tue, 21.04.15 15:16, Susant Sahani (susant at redhat.com) wrote:
>
>>
>> +static int netdev_vti6_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) {
>> +        Tunnel *t = VTI6(netdev);
>> +        int r;
>> +
>> +        assert(netdev);
>> +        assert(link);
>> +        assert(m);
>> +        assert(t);
>> +        assert(t->family == AF_INET6);
>> +
>> +        r = sd_rtnl_message_append_u32(m, IFLA_VTI_LINK, link->ifindex);
>> +        if (r < 0) {
>> +                log_netdev_error(netdev,
>> +                                 "Could not append IFLA_IPTUN_LINK attribute: %s",
>> +                                 strerror(-r));
>> +                return r;
>> +        }
>
> I have now added log_netdev_error_errno(), which takes the error
> number as parameter, and opens it up for %m. Hence please rewrite the
> 7 lines above as these 2:

Sure I will make the changes.

>
>      if (r < 0)
>              return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPTUN_LINK attribute: %m");
>
>> +        r = sd_rtnl_message_append_in6_addr(m, IFLA_VTI_LOCAL, &t->local.in6);
>> +        if (r < 0) {
>> +                log_netdev_error(netdev,
>> +                                 "Could not append IFLA_IPTUN_LOCAL attribute: %s",
>> +                                 strerror(-r));
>> +                return r;
>> +        }
>
> Similar here.
>
>> +        r = sd_rtnl_message_append_in6_addr(m, IFLA_VTI_REMOTE, &t->remote.in6);
>> +        if (r < 0) {
>> +                log_netdev_error(netdev,
>> +                                 "Could not append IFLA_IPTUN_REMOTE attribute: %s",
>> +                                 strerror(-r));
>> +                return r;
>> +        }
>
> Similar here.
>
>>
>>   static void vti_init(NetDev *n) {
>> -        Tunnel *t = VTI(n);
>> +        Tunnel *t;
>>
>>           assert(n);
>> +
>> +        if (n->kind == NETDEV_KIND_VTI)
>> +                t =  VTI(n);
>
> Spurious space.
>
> Lennart
>
Susant


More information about the systemd-devel mailing list