[ovs-dev] OVN: update RA next_announce according to {min, max}_interval

Message ID 3facd951d08abc8fd24067c53f9614d53f716f03.1551715845.git.lorenzo.bianconi@redhat.com
State New
Headers show
Series
  • [ovs-dev] OVN: update RA next_announce according to {min, max}_interval
Related show

Commit Message

Lorenzo Bianconi March 4, 2019, 4:14 p.m.
Update RA next_announce whenever min_interval and/or max_interval are
updated in sbrec_port_binding option. In the current implementation
if ipv6_ra_configs:send_periodic is set to true before setting
ipv6_ra_configs:{min,max}_interval, next_announce will be set using
default values and it will not be updated until we send the first IPv6
router advertisement

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 ovn/controller/pinctrl.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ben Pfaff March 4, 2019, 5:45 p.m. | #1
On Mon, Mar 04, 2019 at 05:14:14PM +0100, Lorenzo Bianconi wrote:
> Update RA next_announce whenever min_interval and/or max_interval are
> updated in sbrec_port_binding option. In the current implementation
> if ipv6_ra_configs:send_periodic is set to true before setting
> ipv6_ra_configs:{min,max}_interval, next_announce will be set using
> default values and it will not be updated until we send the first IPv6
> router advertisement
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

Thanks.  Applied to master.

Do you want this backported?
Lorenzo Bianconi March 4, 2019, 6:37 p.m. | #2
> On Mon, Mar 04, 2019 at 05:14:14PM +0100, Lorenzo Bianconi wrote:
> > Update RA next_announce whenever min_interval and/or max_interval are
> > updated in sbrec_port_binding option. In the current implementation
> > if ipv6_ra_configs:send_periodic is set to true before setting
> > ipv6_ra_configs:{min,max}_interval, next_announce will be set using
> > default values and it will not be updated until we send the first IPv6
> > router advertisement
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
> 
> Thanks.  Applied to master.
> 
> Do you want this backported?

Hi Ben,

thx for the fast review :)
Yes, it would be great.

Regards,
Lorenzo
Ben Pfaff March 4, 2019, 8:57 p.m. | #3
On Mon, Mar 04, 2019 at 07:37:39PM +0100, Lorenzo Bianconi wrote:
> > On Mon, Mar 04, 2019 at 05:14:14PM +0100, Lorenzo Bianconi wrote:
> > > Update RA next_announce whenever min_interval and/or max_interval are
> > > updated in sbrec_port_binding option. In the current implementation
> > > if ipv6_ra_configs:send_periodic is set to true before setting
> > > ipv6_ra_configs:{min,max}_interval, next_announce will be set using
> > > default values and it will not be updated until we send the first IPv6
> > > router advertisement
> > > 
> > > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
> > 
> > Thanks.  Applied to master.
> > 
> > Do you want this backported?
> 
> Hi Ben,
> 
> thx for the fast review :)
> Yes, it would be great.

OK, backported as far as 2.9.
Lorenzo Bianconi March 4, 2019, 11:05 p.m. | #4
>
> On Mon, Mar 04, 2019 at 07:37:39PM +0100, Lorenzo Bianconi wrote:
> > > On Mon, Mar 04, 2019 at 05:14:14PM +0100, Lorenzo Bianconi wrote:
> > > > Update RA next_announce whenever min_interval and/or max_interval are
> > > > updated in sbrec_port_binding option. In the current implementation
> > > > if ipv6_ra_configs:send_periodic is set to true before setting
> > > > ipv6_ra_configs:{min,max}_interval, next_announce will be set using
> > > > default values and it will not be updated until we send the first IPv6
> > > > router advertisement
> > > >
> > > > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
> > >
> > > Thanks.  Applied to master.
> > >
> > > Do you want this backported?
> >
> > Hi Ben,
> >
> > thx for the fast review :)
> > Yes, it would be great.
>
> OK, backported as far as 2.9.

Thx a lot Ben.

Regards,
Lorenzo

Patch

diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index 655a85f74..100a20ff2 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -1823,6 +1823,11 @@  send_ipv6_ras(struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
                     ra->config->max_interval);
                 shash_add(&ipv6_ras, pb->logical_port, ra);
             } else {
+                if (config->min_interval != ra->config->min_interval ||
+                    config->max_interval != ra->config->max_interval)
+                    ra->next_announce = ipv6_ra_calc_next_announce(
+                        config->min_interval,
+                        config->max_interval);
                 ipv6_ra_config_delete(ra->config);
                 ra->config = config;
             }