The patch titled Subject: treewide: cleanup: replace prefered with preferred has been added to the -mm tree. Its filename is cleanup-replace-prefered-with-preferred.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/cleanup-replace-prefered-with-preferred.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/cleanup-replace-prefered-with-preferred.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Mark Salyzyn <salyzyn@xxxxxxxxxxx> Subject: treewide: cleanup: replace prefered with preferred Replace all occurrences of prefered with preferred to make future checkpatch.pl's happy. A few places the incorrect spelling is matched with the correct spelling to preserve existing user space API. Link: http://lkml.kernel.org/r/20191022214208.211448-1-salyzyn@xxxxxxxxxxx Signed-off-by: Mark Salyzyn <salyzyn@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Documentation/networking/ip-sysctl.txt | 2 drivers/firmware/efi/libstub/efi-stub-helper.c | 2 drivers/gpu/drm/amd/display/dc/inc/compressor.h | 4 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 drivers/media/usb/uvc/uvc_video.c | 6 fs/nfs/nfs4xdr.c | 2 include/linux/ipv6.h | 2 include/net/addrconf.h | 4 include/net/if_inet6.h | 2 include/net/ndisc.h | 8 include/uapi/linux/if_addr.h | 5 include/uapi/linux/ipv6.h | 4 include/uapi/linux/sysctl.h | 4 include/uapi/linux/usb/video.h | 5 kernel/sysctl_binary.c | 3 net/6lowpan/ndisc.c | 4 net/ipv4/devinet.c | 20 +- net/ipv6/addrconf.c | 113 ++++++++------ 19 files changed, 112 insertions(+), 82 deletions(-) --- a/Documentation/networking/ip-sysctl.txt~cleanup-replace-prefered-with-preferred +++ a/Documentation/networking/ip-sysctl.txt @@ -1792,7 +1792,7 @@ temp_valid_lft - INTEGER valid lifetime (in seconds) for temporary addresses. Default: 604800 (7 days) -temp_prefered_lft - INTEGER +temp_preferred_lft - INTEGER Preferred lifetime (in seconds) for temporary addresses. Default: 86400 (1 day) --- a/drivers/firmware/efi/libstub/efi-stub-helper.c~cleanup-replace-prefered-with-preferred +++ a/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -717,7 +717,7 @@ efi_status_t efi_relocate_kernel(efi_sys * The EFI firmware loader could have placed the kernel image * anywhere in memory, but the kernel has restrictions on the * max physical address it can run at. Some architectures - * also have a prefered address, so first try to relocate + * also have a preferred address, so first try to relocate * to the preferred address. If that fails, allocate as low * as possible while respecting the required alignment. */ --- a/drivers/gpu/drm/amd/display/dc/inc/compressor.h~cleanup-replace-prefered-with-preferred +++ a/drivers/gpu/drm/amd/display/dc/inc/compressor.h @@ -126,9 +126,9 @@ struct fbc_requested_compressed_size { unsigned int min_size_alignment; union { struct { - /* Above preferedSize must be allocated in FB pool */ + /* Above preferred_size must be allocated in FB pool */ unsigned int preferred_must_be_framebuffer_pool : 1; - /* Above minSize must be allocated in FB pool */ + /* Above min_size must be allocated in FB pool */ unsigned int min_must_be_framebuffer_pool : 1; } bits; unsigned int flags; --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c~cleanup-replace-prefered-with-preferred +++ a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -2306,7 +2306,7 @@ int vmw_du_connector_fill_modes(struct d } drm_connector_list_update(connector); - /* Move the prefered mode first, help apps pick the right mode. */ + /* Move the preferred mode first, help apps pick the right mode. */ drm_mode_sort(&connector->modes); return 1; --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h~cleanup-replace-prefered-with-preferred +++ a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h @@ -355,7 +355,7 @@ struct vmw_display_unit { unsigned unit; /* - * Prefered mode tracking. + * Preferred mode tracking. */ unsigned pref_width; unsigned pref_height; --- a/drivers/media/usb/uvc/uvc_video.c~cleanup-replace-prefered-with-preferred +++ a/drivers/media/usb/uvc/uvc_video.c @@ -276,13 +276,13 @@ static int uvc_get_video_ctrl(struct uvc if (size >= 34) { ctrl->dwClockFrequency = get_unaligned_le32(&data[26]); ctrl->bmFramingInfo = data[30]; - ctrl->bPreferedVersion = data[31]; + ctrl->bPreferredVersion = data[31]; ctrl->bMinVersion = data[32]; ctrl->bMaxVersion = data[33]; } else { ctrl->dwClockFrequency = stream->dev->clock_frequency; ctrl->bmFramingInfo = 0; - ctrl->bPreferedVersion = 0; + ctrl->bPreferredVersion = 0; ctrl->bMinVersion = 0; ctrl->bMaxVersion = 0; } @@ -325,7 +325,7 @@ static int uvc_set_video_ctrl(struct uvc if (size >= 34) { put_unaligned_le32(ctrl->dwClockFrequency, &data[26]); data[30] = ctrl->bmFramingInfo; - data[31] = ctrl->bPreferedVersion; + data[31] = ctrl->bPreferredVersion; data[32] = ctrl->bMinVersion; data[33] = ctrl->bMaxVersion; } --- a/fs/nfs/nfs4xdr.c~cleanup-replace-prefered-with-preferred +++ a/fs/nfs/nfs4xdr.c @@ -4768,7 +4768,7 @@ static int decode_attr_pnfstype(struct x } /* - * The prefered block size for layout directed io + * The preferred block size for layout directed io */ static int decode_attr_layout_blksize(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) --- a/include/linux/ipv6.h~cleanup-replace-prefered-with-preferred +++ a/include/linux/ipv6.h @@ -26,7 +26,7 @@ struct ipv6_devconf { __s32 mldv2_unsolicited_report_interval; __s32 use_tempaddr; __s32 temp_valid_lft; - __s32 temp_prefered_lft; + __s32 temp_preferred_lft; __s32 regen_max_retry; __s32 max_desync_factor; __s32 max_addresses; --- a/include/net/addrconf.h~cleanup-replace-prefered-with-preferred +++ a/include/net/addrconf.h @@ -43,7 +43,7 @@ struct prefix_info { #error "Please fix <asm/byteorder.h>" #endif __be32 valid; - __be32 prefered; + __be32 preferred; __be32 reserved2; struct in6_addr prefix; @@ -121,7 +121,7 @@ int addrconf_prefix_rcv_add_addr(struct struct inet6_dev *in6_dev, const struct in6_addr *addr, int addr_type, u32 addr_flags, bool sllao, bool tokenized, - __u32 valid_lft, u32 prefered_lft); + __u32 valid_lft, u32 preferred_lft); static inline void addrconf_addr_eui48_base(u8 *eui, const char *const addr) { --- a/include/net/if_inet6.h~cleanup-replace-prefered-with-preferred +++ a/include/net/if_inet6.h @@ -41,7 +41,7 @@ struct inet6_ifaddr { /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ __u32 valid_lft; - __u32 prefered_lft; + __u32 preferred_lft; refcount_t refcnt; spinlock_t lock; --- a/include/net/ndisc.h~cleanup-replace-prefered-with-preferred +++ a/include/net/ndisc.h @@ -189,7 +189,7 @@ void __ndisc_fill_addr_option(struct sk_ * struct in6_addr *addr, * int addr_type, u32 addr_flags, * bool sllao, bool tokenized, - * __u32 valid_lft, u32 prefered_lft, + * __u32 valid_lft, u32 preferred_lft, * bool dev_addr_generated): * This function is called when a RA messages is received with valid * PIO option fields and an IPv6 address will be added to the interface @@ -218,7 +218,7 @@ struct ndisc_ops { struct in6_addr *addr, int addr_type, u32 addr_flags, bool sllao, bool tokenized, - __u32 valid_lft, u32 prefered_lft, + __u32 valid_lft, u32 preferred_lft, bool dev_addr_generated); }; @@ -298,7 +298,7 @@ static inline void ndisc_ops_prefix_rcv_ int addr_type, u32 addr_flags, bool sllao, bool tokenized, __u32 valid_lft, - u32 prefered_lft, + u32 preferred_lft, bool dev_addr_generated) { if (dev->ndisc_ops && dev->ndisc_ops->prefix_rcv_add_addr) @@ -306,7 +306,7 @@ static inline void ndisc_ops_prefix_rcv_ addr, addr_type, addr_flags, sllao, tokenized, valid_lft, - prefered_lft, + preferred_lft, dev_addr_generated); } #endif --- a/include/uapi/linux/if_addr.h~cleanup-replace-prefered-with-preferred +++ a/include/uapi/linux/if_addr.h @@ -57,7 +57,10 @@ enum { #define IFA_F_STABLE_PRIVACY 0x800 struct ifa_cacheinfo { - __u32 ifa_prefered; + union { + __u32 ifa_preferred; + __u32 ifa_prefered __attribute__((deprecated)); /* NOTYPO */ + } __attribute__((packed)); __u32 ifa_valid; __u32 cstamp; /* created timestamp, hundredths of seconds */ __u32 tstamp; /* updated timestamp, hundredths of seconds */ --- a/include/uapi/linux/ipv6.h~cleanup-replace-prefered-with-preferred +++ a/include/uapi/linux/ipv6.h @@ -148,7 +148,9 @@ enum { DEVCONF_RTR_SOLICIT_DELAY, DEVCONF_USE_TEMPADDR, DEVCONF_TEMP_VALID_LFT, - DEVCONF_TEMP_PREFERED_LFT, + DEVCONF_TEMP_PREFERRED_LFT, + DEVCONF_TEMP_PREFERED_LFT __attribute__((deprecated)) = /* NOTYPO */ + DEVCONF_TEMP_PREFERRED_LFT, DEVCONF_REGEN_MAX_RETRY, DEVCONF_MAX_DESYNC_FACTOR, DEVCONF_MAX_ADDRESSES, --- a/include/uapi/linux/sysctl.h~cleanup-replace-prefered-with-preferred +++ a/include/uapi/linux/sysctl.h @@ -557,7 +557,9 @@ enum { NET_IPV6_RTR_SOLICIT_DELAY=10, NET_IPV6_USE_TEMPADDR=11, NET_IPV6_TEMP_VALID_LFT=12, - NET_IPV6_TEMP_PREFERED_LFT=13, + NET_IPV6_TEMP_PREFERRED_LFT = 13, + NET_IPV6_TEMP_PREFERED_LFT __attribute__((deprecated)) = /* NOTYPO */ + NET_IPV6_TEMP_PREFERRED_LFT, NET_IPV6_REGEN_MAX_RETRY=14, NET_IPV6_MAX_DESYNC_FACTOR=15, NET_IPV6_MAX_ADDRESSES=16, --- a/include/uapi/linux/usb/video.h~cleanup-replace-prefered-with-preferred +++ a/include/uapi/linux/usb/video.h @@ -448,7 +448,10 @@ struct uvc_streaming_control { __u32 dwMaxPayloadTransferSize; __u32 dwClockFrequency; __u8 bmFramingInfo; - __u8 bPreferedVersion; + union { + __u8 bPreferredVersion; + __u8 bPreferedVersion __attribute__((deprecated)); /* NOTYPO */ + } __attribute__((__packed__)); __u8 bMinVersion; __u8 bMaxVersion; } __attribute__((__packed__)); --- a/kernel/sysctl_binary.c~cleanup-replace-prefered-with-preferred +++ a/kernel/sysctl_binary.c @@ -513,7 +513,8 @@ static const struct bin_table bin_net_ip { CTL_INT, NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay" }, { CTL_INT, NET_IPV6_USE_TEMPADDR, "use_tempaddr" }, { CTL_INT, NET_IPV6_TEMP_VALID_LFT, "temp_valid_lft" }, - { CTL_INT, NET_IPV6_TEMP_PREFERED_LFT, "temp_prefered_lft" }, + { CTL_INT, NET_IPV6_TEMP_PREFERRED_LFT, "temp_preferred_lft" }, + { CTL_INT, NET_IPV6_TEMP_PREFERRED_LFT, "temp_prefered_lft" }, /* NOTYPO */ { CTL_INT, NET_IPV6_REGEN_MAX_RETRY, "regen_max_retry" }, { CTL_INT, NET_IPV6_MAX_DESYNC_FACTOR, "max_desync_factor" }, { CTL_INT, NET_IPV6_MAX_ADDRESSES, "max_addresses" }, --- a/net/6lowpan/ndisc.c~cleanup-replace-prefered-with-preferred +++ a/net/6lowpan/ndisc.c @@ -201,7 +201,7 @@ static void lowpan_ndisc_prefix_rcv_add_ int addr_type, u32 addr_flags, bool sllao, bool tokenized, __u32 valid_lft, - u32 prefered_lft, + u32 preferred_lft, bool dev_addr_generated) { int err; @@ -212,7 +212,7 @@ static void lowpan_ndisc_prefix_rcv_add_ err = addrconf_prefix_rcv_add_addr(net, dev, pinfo, in6_dev, addr, addr_type, addr_flags, sllao, tokenized, valid_lft, - prefered_lft); + preferred_lft); if (err) ND_PRINTK(2, warn, "RA: could not add a short address based address for prefix: %pI6c\n", --- a/net/ipv4/devinet.c~cleanup-replace-prefered-with-preferred +++ a/net/ipv4/devinet.c @@ -790,7 +790,7 @@ static void check_lifetime(struct work_s } static void set_ifa_lifetime(struct in_ifaddr *ifa, __u32 valid_lft, - __u32 prefered_lft) + __u32 preferred_lft) { unsigned long timeout; @@ -802,7 +802,7 @@ static void set_ifa_lifetime(struct in_i else ifa->ifa_flags |= IFA_F_PERMANENT; - timeout = addrconf_timeout_fixup(prefered_lft, HZ); + timeout = addrconf_timeout_fixup(preferred_lft, HZ); if (addrconf_finite_timeout(timeout)) { if (timeout == 0) ifa->ifa_flags |= IFA_F_DEPRECATED; @@ -814,7 +814,7 @@ static void set_ifa_lifetime(struct in_i } static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh, - __u32 *pvalid_lft, __u32 *pprefered_lft, + __u32 *pvalid_lft, __u32 *ppreferred_lft, struct netlink_ext_ack *extack) { struct nlattr *tb[IFA_MAX+1]; @@ -885,12 +885,12 @@ static struct in_ifaddr *rtm_to_ifaddr(s struct ifa_cacheinfo *ci; ci = nla_data(tb[IFA_CACHEINFO]); - if (!ci->ifa_valid || ci->ifa_prefered > ci->ifa_valid) { + if (!ci->ifa_valid || ci->ifa_preferred > ci->ifa_valid) { err = -EINVAL; goto errout_free; } *pvalid_lft = ci->ifa_valid; - *pprefered_lft = ci->ifa_prefered; + *ppreferred_lft = ci->ifa_preferred; } return ifa; @@ -925,11 +925,11 @@ static int inet_rtm_newaddr(struct sk_bu struct in_ifaddr *ifa; struct in_ifaddr *ifa_existing; __u32 valid_lft = INFINITY_LIFE_TIME; - __u32 prefered_lft = INFINITY_LIFE_TIME; + __u32 preferred_lft = INFINITY_LIFE_TIME; ASSERT_RTNL(); - ifa = rtm_to_ifaddr(net, nlh, &valid_lft, &prefered_lft, extack); + ifa = rtm_to_ifaddr(net, nlh, &valid_lft, &preferred_lft, extack); if (IS_ERR(ifa)) return PTR_ERR(ifa); @@ -938,7 +938,7 @@ static int inet_rtm_newaddr(struct sk_bu /* It would be best to check for !NLM_F_CREATE here but * userspace already relies on not having to provide this. */ - set_ifa_lifetime(ifa, valid_lft, prefered_lft); + set_ifa_lifetime(ifa, valid_lft, preferred_lft); if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) { int ret = ip_mc_config(net->ipv4.mc_autojoin_sk, true, ifa); @@ -965,7 +965,7 @@ static int inet_rtm_newaddr(struct sk_bu ifa->ifa_rt_priority = new_metric; } - set_ifa_lifetime(ifa, valid_lft, prefered_lft); + set_ifa_lifetime(ifa, valid_lft, preferred_lft); cancel_delayed_work(&check_lifetime_work); queue_delayed_work(system_power_efficient_wq, &check_lifetime_work, 0); @@ -1639,7 +1639,7 @@ static int put_cacheinfo(struct sk_buff ci.cstamp = cstamp_delta(cstamp); ci.tstamp = cstamp_delta(tstamp); - ci.ifa_prefered = preferred; + ci.ifa_preferred = preferred; ci.ifa_valid = valid; return nla_put(skb, IFA_CACHEINFO, sizeof(ci), &ci); --- a/net/ipv6/addrconf.c~cleanup-replace-prefered-with-preferred +++ a/net/ipv6/addrconf.c @@ -201,7 +201,7 @@ static struct ipv6_devconf ipv6_devconf .rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY, .use_tempaddr = 0, .temp_valid_lft = TEMP_VALID_LIFETIME, - .temp_prefered_lft = TEMP_PREFERRED_LIFETIME, + .temp_preferred_lft = TEMP_PREFERRED_LIFETIME, .regen_max_retry = REGEN_MAX_RETRY, .max_desync_factor = MAX_DESYNC_FACTOR, .max_addresses = IPV6_MAX_ADDRESSES, @@ -255,7 +255,7 @@ static struct ipv6_devconf ipv6_devconf_ .rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY, .use_tempaddr = 0, .temp_valid_lft = TEMP_VALID_LIFETIME, - .temp_prefered_lft = TEMP_PREFERRED_LIFETIME, + .temp_preferred_lft = TEMP_PREFERRED_LIFETIME, .regen_max_retry = REGEN_MAX_RETRY, .max_desync_factor = MAX_DESYNC_FACTOR, .max_addresses = IPV6_MAX_ADDRESSES, @@ -1112,7 +1112,7 @@ ipv6_add_addr(struct inet6_dev *idev, st if (!(cfg->ifa_flags & IFA_F_NODAD)) ifa->flags |= IFA_F_TENTATIVE; ifa->valid_lft = cfg->valid_lft; - ifa->prefered_lft = cfg->preferred_lft; + ifa->preferred_lft = cfg->preferred_lft; ifa->cstamp = ifa->tstamp = jiffies; ifa->tokenized = false; @@ -1358,7 +1358,7 @@ retry: /* recalculate max_desync_factor each time and update * idev->desync_factor if it's larger */ - cnf_temp_preferred_lft = READ_ONCE(idev->cnf.temp_prefered_lft); + cnf_temp_preferred_lft = READ_ONCE(idev->cnf.temp_preferred_lft); max_desync_factor = min_t(__u32, idev->cnf.max_desync_factor, cnf_temp_preferred_lft - regen_advance); @@ -1377,7 +1377,7 @@ retry: cfg.valid_lft = min_t(__u32, ifp->valid_lft, idev->cnf.temp_valid_lft + age); cfg.preferred_lft = cnf_temp_preferred_lft + age - idev->desync_factor; - cfg.preferred_lft = min_t(__u32, ifp->prefered_lft, cfg.preferred_lft); + cfg.preferred_lft = min_t(__u32, ifp->preferred_lft, cfg.preferred_lft); cfg.plen = ifp->prefix_len; tmp_tstamp = ifp->tstamp; @@ -2087,7 +2087,7 @@ void addrconf_dad_failure(struct sk_buff .plen = ifp->prefix_len, .ifa_flags = ifp->flags, .valid_lft = ifp->valid_lft, - .preferred_lft = ifp->prefered_lft, + .preferred_lft = ifp->preferred_lft, .scope = ifp->scope, }; @@ -2481,7 +2481,7 @@ static struct inet6_dev *addrconf_add_de static void manage_tempaddrs(struct inet6_dev *idev, struct inet6_ifaddr *ifp, - __u32 valid_lft, __u32 prefered_lft, + __u32 valid_lft, __u32 preferred_lft, bool create, unsigned long now) { u32 flags; @@ -2490,7 +2490,7 @@ static void manage_tempaddrs(struct inet read_lock_bh(&idev->lock); /* update all temporary addresses in the list */ list_for_each_entry(ift, &idev->tempaddr_list, tmp_list) { - int age, max_valid, max_prefered; + int age, max_valid, max_preferred; if (ifp != ift->ifpub) continue; @@ -2508,23 +2508,23 @@ static void manage_tempaddrs(struct inet if (max_valid < 0) max_valid = 0; - max_prefered = idev->cnf.temp_prefered_lft - - idev->desync_factor - age; - if (max_prefered < 0) - max_prefered = 0; + max_preferred = idev->cnf.temp_preferred_lft - + idev->desync_factor - age; + if (max_preferred < 0) + max_preferred = 0; if (valid_lft > max_valid) valid_lft = max_valid; - if (prefered_lft > max_prefered) - prefered_lft = max_prefered; + if (preferred_lft > max_preferred) + preferred_lft = max_preferred; spin_lock(&ift->lock); flags = ift->flags; ift->valid_lft = valid_lft; - ift->prefered_lft = prefered_lft; + ift->preferred_lft = preferred_lft; ift->tstamp = now; - if (prefered_lft > 0) + if (preferred_lft > 0) ift->flags &= ~IFA_F_DEPRECATED; spin_unlock(&ift->lock); @@ -2557,7 +2557,7 @@ int addrconf_prefix_rcv_add_addr(struct struct inet6_dev *in6_dev, const struct in6_addr *addr, int addr_type, u32 addr_flags, bool sllao, bool tokenized, - __u32 valid_lft, u32 prefered_lft) + __u32 valid_lft, u32 preferred_lft) { struct inet6_ifaddr *ifp = ipv6_get_ifaddr(net, addr, dev, 1); int create = 0, update_lft = 0; @@ -2569,7 +2569,7 @@ int addrconf_prefix_rcv_add_addr(struct .plen = pinfo->prefix_len, .ifa_flags = addr_flags, .valid_lft = valid_lft, - .preferred_lft = prefered_lft, + .preferred_lft = preferred_lft, .scope = addr_type & IPV6_ADDR_SCOPE_MASK, }; @@ -2624,14 +2624,14 @@ int addrconf_prefix_rcv_add_addr(struct * whether the valid lifetime is also reset or * ignored." * - * So we should always update prefered_lft here. + * So we should always update preferred_lft here. */ update_lft = 1; } if (update_lft) { ifp->valid_lft = valid_lft; - ifp->prefered_lft = prefered_lft; + ifp->preferred_lft = preferred_lft; ifp->tstamp = now; flags = ifp->flags; ifp->flags &= ~IFA_F_DEPRECATED; @@ -2642,7 +2642,7 @@ int addrconf_prefix_rcv_add_addr(struct } else spin_unlock_bh(&ifp->lock); - manage_tempaddrs(in6_dev, ifp, valid_lft, prefered_lft, + manage_tempaddrs(in6_dev, ifp, valid_lft, preferred_lft, create, now); in6_ifa_put(ifp); @@ -2657,7 +2657,7 @@ void addrconf_prefix_rcv(struct net_devi { struct prefix_info *pinfo; __u32 valid_lft; - __u32 prefered_lft; + __u32 preferred_lft; int addr_type, err; u32 addr_flags = 0; struct inet6_dev *in6_dev; @@ -2680,9 +2680,9 @@ void addrconf_prefix_rcv(struct net_devi return; valid_lft = ntohl(pinfo->valid); - prefered_lft = ntohl(pinfo->prefered); + preferred_lft = ntohl(pinfo->preferred); - if (prefered_lft > valid_lft) { + if (preferred_lft > valid_lft) { net_warn_ratelimited("addrconf: prefix option has invalid lifetime\n"); return; } @@ -2787,7 +2787,7 @@ ok: &addr, addr_type, addr_flags, sllao, tokenized, valid_lft, - prefered_lft); + preferred_lft); if (err) goto put; @@ -2797,7 +2797,7 @@ ok: ndisc_ops_prefix_rcv_add_addr(net, dev, pinfo, in6_dev, &addr, addr_type, addr_flags, sllao, tokenized, valid_lft, - prefered_lft, + preferred_lft, dev_addr_generated); } inet6_prefix_notify(RTM_NEWPREFIX, in6_dev, pinfo); @@ -4422,7 +4422,7 @@ restart: * IFA_F_PERMANENT has a non-infinity life time. */ if ((ifp->flags & IFA_F_PERMANENT) && - (ifp->prefered_lft == INFINITY_LIFE_TIME)) + (ifp->preferred_lft == INFINITY_LIFE_TIME)) continue; spin_lock(&ifp->lock); @@ -4435,11 +4435,13 @@ restart: in6_ifa_hold(ifp); ipv6_del_addr(ifp); goto restart; - } else if (ifp->prefered_lft == INFINITY_LIFE_TIME) { + } else if (ifp->preferred_lft == INFINITY_LIFE_TIME) { spin_unlock(&ifp->lock); continue; - } else if (age >= ifp->prefered_lft) { - /* jiffies - ifp->tstamp > age >= ifp->prefered_lft */ + } else if (age >= ifp->preferred_lft) { + /* jiffies - ifp->tstamp > age >= + * ifp->preferred_lft + */ int deprecate = 0; if (!(ifp->flags&IFA_F_DEPRECATED)) { @@ -4466,10 +4468,13 @@ restart: ifp->idev->cnf.dad_transmits * NEIGH_VAR(ifp->idev->nd_parms, RETRANS_TIME) / HZ; - if (age >= ifp->prefered_lft - regen_advance) { + if (age >= ifp->preferred_lft - regen_advance) { struct inet6_ifaddr *ifpub = ifp->ifpub; - if (time_before(ifp->tstamp + ifp->prefered_lft * HZ, next)) - next = ifp->tstamp + ifp->prefered_lft * HZ; + if (time_before(ifp->tstamp + + ifp->preferred_lft * HZ, + next)) + next = ifp->tstamp + + ifp->preferred_lft * HZ; if (!ifp->regen_count && ifpub) { ifp->regen_count++; in6_ifa_hold(ifp); @@ -4486,13 +4491,20 @@ restart: rcu_read_lock_bh(); goto restart; } - } else if (time_before(ifp->tstamp + ifp->prefered_lft * HZ - regen_advance * HZ, next)) - next = ifp->tstamp + ifp->prefered_lft * HZ - regen_advance * HZ; + } else if (time_before(ifp->tstamp + + ifp->preferred_lft * HZ - + regen_advance * HZ, + next)) + next = ifp->tstamp + + ifp->preferred_lft * HZ - + regen_advance * HZ; spin_unlock(&ifp->lock); } else { - /* ifp->prefered_lft <= ifp->valid_lft */ - if (time_before(ifp->tstamp + ifp->prefered_lft * HZ, next)) - next = ifp->tstamp + ifp->prefered_lft * HZ; + /* ifp->preferred_lft <= ifp->valid_lft */ + if (time_before(ifp->tstamp + + ifp->preferred_lft * HZ, next)) + next = ifp->tstamp + + ifp->preferred_lft * HZ; spin_unlock(&ifp->lock); } } @@ -4665,7 +4677,7 @@ static int inet6_addr_modify(struct inet ifp->flags |= cfg->ifa_flags; ifp->tstamp = jiffies; ifp->valid_lft = cfg->valid_lft; - ifp->prefered_lft = cfg->preferred_lft; + ifp->preferred_lft = cfg->preferred_lft; if (cfg->rt_priority && cfg->rt_priority != ifp->rt_priority) ifp->rt_priority = cfg->rt_priority; @@ -4755,7 +4767,7 @@ inet6_rtm_newaddr(struct sk_buff *skb, s ci = nla_data(tb[IFA_CACHEINFO]); cfg.valid_lft = ci->ifa_valid; - cfg.preferred_lft = ci->ifa_prefered; + cfg.preferred_lft = ci->ifa_preferred; } dev = __dev_get_by_index(net, ifm->ifa_index); @@ -4825,7 +4837,7 @@ static int put_cacheinfo(struct sk_buff ci.cstamp = cstamp_delta(cstamp); ci.tstamp = cstamp_delta(tstamp); - ci.ifa_prefered = preferred; + ci.ifa_preferred = preferred; ci.ifa_valid = valid; return nla_put(skb, IFA_CACHEINFO, sizeof(ci), &ci); @@ -4888,8 +4900,8 @@ static int inet6_fill_ifaddr(struct sk_b goto error; if (!((ifa->flags&IFA_F_PERMANENT) && - (ifa->prefered_lft == INFINITY_LIFE_TIME))) { - preferred = ifa->prefered_lft; + (ifa->preferred_lft == INFINITY_LIFE_TIME))) { + preferred = ifa->preferred_lft; valid = ifa->valid_lft; if (preferred != INFINITY_LIFE_TIME) { long tval = (jiffies - ifa->tstamp)/HZ; @@ -5394,7 +5406,7 @@ static inline void ipv6_store_devconf(st jiffies_to_msecs(cnf->mldv2_unsolicited_report_interval); array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft; - array[DEVCONF_TEMP_PREFERED_LFT] = cnf->temp_prefered_lft; + array[DEVCONF_TEMP_PREFERRED_LFT] = cnf->temp_preferred_lft; array[DEVCONF_REGEN_MAX_RETRY] = cnf->regen_max_retry; array[DEVCONF_MAX_DESYNC_FACTOR] = cnf->max_desync_factor; array[DEVCONF_MAX_ADDRESSES] = cnf->max_addresses; @@ -5643,7 +5655,7 @@ update_lft: spin_lock(&ifp->lock); if (ifp->tokenized) { ifp->valid_lft = 0; - ifp->prefered_lft = 0; + ifp->preferred_lft = 0; } spin_unlock(&ifp->lock); } @@ -5914,7 +5926,7 @@ static int inet6_fill_prefix(struct sk_b if (nla_put(skb, PREFIX_ADDRESS, sizeof(pinfo->prefix), &pinfo->prefix)) goto nla_put_failure; - ci.preferred_time = ntohl(pinfo->prefered); + ci.preferred_time = ntohl(pinfo->preferred); ci.valid_time = ntohl(pinfo->valid); if (nla_put(skb, PREFIX_CACHEINFO, sizeof(ci), &ci)) goto nla_put_failure; @@ -6560,8 +6572,15 @@ static const struct ctl_table addrconf_s .proc_handler = proc_dointvec, }, { + .procname = "temp_preferred_lft", + .data = &ipv6_devconf.temp_preferred_lft, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec, + }, + { /* DEPRECATED */ .procname = "temp_prefered_lft", - .data = &ipv6_devconf.temp_prefered_lft, + .data = &ipv6_devconf.temp_preferred_lft, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, _ Patches currently in -mm which might be from salyzyn@xxxxxxxxxxx are cleanup-replace-prefered-with-preferred.patch