lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sat, 14 Mar 2015 18:16:20 -0700 From: Scott Feldman <sfeldma@...il.com> To: Siva Mannem <siva.mannem.lnx@...il.com> Cc: Netdev <netdev@...r.kernel.org> Subject: Re: [PATCH net-next v2] Configure bridge FDB ageing time using netlink. On Sat, Mar 14, 2015 at 4:36 PM, Siva Mannem <siva.mannem.lnx@...il.com> wrote: > On Sun, Mar 15, 2015 at 3:47 AM, Scott Feldman <sfeldma@...il.com> wrote: >> On Fri, Mar 13, 2015 at 6:40 PM, Siva Mannem <siva.mannem.lnx@...il.com> wrote: >>> This patch allows user to configure bridge's FDB ageing using >>> netlink(for ex, iproute2). Allowed range is 10 seconds to 1000000 seconds >>> as per ieee8021QBridgeFdbAgingTime. >>> >>> Signed-off-by: Siva Mannem <siva.mannem.lnx@...il.com> >>> --- >>> Changes in v2: >>> - Added commit message. >>> - Fix style problems reported by checkpatch.pl. >> >> >>> + >>> +int br_set_ageing_time(struct net_bridge *br, unsigned long val) >>> +{ >>> + unsigned long t = clock_t_to_jiffies(val); >>> + >>> + if (t < BR_MIN_AGEING_TIME || t > BR_MAX_AGEING_TIME) >>> + return -ERANGE; >>> + >>> + spin_lock_bh(&br->lock); >>> + br->ageing_time = t; >> >> I wonder if you need to call mod_timer(&br->gc_timer, jiffies) after >> adjusting the time, to make new ageing_time effective? The worst-case >> scenario I'm thinking about is if the initial br->ageing_time is the >> max value (1000000 seconds) and the user changes it the min value (10 >> seconds), will the original 1000000 seconds need to expire before the >> gc_timer is called again and reset to 10 seconds? >> > Yes, the new ageing_time becomes effective only after the current timer expires. > The behavior when ageing_time is set via netlink is similar to setting it using > sysfs and brctl. I want to keep the behavior same when the ageing_time is > configured using any of the existing mechanisms. Right, looks like sysfs and brctl (ioctl) don't reset gc_timer, so you're consistent there. :) Consistency is good. What do you think about a new func that's called from either of the three interfaces (sysfs, ioctl, netlink) that: 1) validates range, like in your br_set_ageing_time() func. 2) reset gc_timer if setting ageing_time to lower value ? -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists