[Swan-dev] [PATCH libreswan v2 3/3] kernel, netlink: Add support for nic_offload='auto' mode

Ilan Tayari ilant at mellanox.com
Sun Aug 6 06:36:02 UTC 2017


> -----Original Message-----
> From: Antony Antony [mailto:antony at phenome.org]
> Subject: Re: [PATCH libreswan v2 3/3] kernel, netlink: Add support for
> nic_offload='auto' mode
> 
> >
> > +static void setup_esp_nic_offload(struct kernel_sa *sa, struct
> connection *c,
> > +		bool *nic_offload_fallback)
> > +{
> > +	if (c->nic_offload == nic_offload_no)
> > +		return;
> > +	if (!c->interface || !c->interface->ip_dev ||
> > +		!c->interface->ip_dev->id_rname)
> 
> libreswan code do not treat pointers as boolean; atleast try to avoid it.
> the above line would something like :
> c->interface != NULL || c->interface->ip_dev != NULL ||
> c->interface->ip_dev->id_rname != NULL
> 
> There are a few more cases where pointer is used as boolean, it will good
> to
> clean up. I have pointed this out in the previous reviews.

Sorry about that. I forgot.
Context-switching between project conventions has its cost :/

Did you fix this in master too?

Ilan.


More information about the Swan-dev mailing list