[systemd-devel] [PATCH 1/1] networkd: sit-tunnel add support for pmtudisc

Susant Sahani susant at redhat.com
Wed May 21 20:49:41 PDT 2014


On 05/22/2014 08:32 AM, Susant Sahani wrote:

>>   static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
>>           NetDev *netdev;
>> +        uint8_t pmtudisc = 1;
>>           int r;
>>
>>           assert(link);
>> @@ -207,6 +208,17 @@ static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
>>                   return r;
>>           }
>>
>> +        if(!netdev->tunnel_pmtudisc)
>> +                pmtudisc = 0;
>
> This should also be enough:
>
> pmtudisc = netdev->tunnel_pmtudisc;
>
> No need to invole an if check here... bools automatically convert to 0
> and 1 if you assign them to an integer.
>
> Cool. thanks

I guess we can directly assign the bool to the a integer and eliminate the
uint8_t pmtudisc and
pmtudisc = netdev->tunnel_pmtudisc;

altogether.

like
sd_rtnl_message_append_u8(m, IFLA_IPTUN_PMTUDISC, netdev->tunnel_pmtudisc);


Susant


More information about the systemd-devel mailing list