netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: netdev@vger.kernel.org
Cc: bugme-daemon@bugzilla.kernel.org, benedikt@gollatz.net
Subject: Re: [Bugme-new] [Bug 10880] New: include/linux/if_addr.h: negative preferred lifetimes of addresses
Date: Sat, 7 Jun 2008 12:01:51 -0700	[thread overview]
Message-ID: <20080607120151.72c0f53b.akpm@linux-foundation.org> (raw)
In-Reply-To: <bug-10880-10286@http.bugzilla.kernel.org/>

On Sat,  7 Jun 2008 03:04:43 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=10880
> 
>            Summary: include/linux/if_addr.h: negative preferred lifetimes of
>                     addresses
>            Product: Networking
>            Version: 2.5
>      KernelVersion: 2.6.25.4
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: IPV6
>         AssignedTo: yoshfuji@linux-ipv6.org
>         ReportedBy: benedikt@gollatz.net
> 
> 
> Recently, I noticed that iproute2 would return me preferred lifetimes of IPv6
> adresses close to 2^32 on links where prefixes are advertised with a preferred
> lifetime of 0. A quick look into the source revealed that the preferred
> lifetime is output using a format string containing "%u"; the incriminating
> lines being
> 
>   struct ifa_cacheinfo *ci = RTA_DATA(rta_tb[IFA_CACHEINFO]);
>   char buf[128];
>   fprintf(fp, "%s", _SL_);
>   [...]
>   if (ci->ifa_prefered == INFINITY_LIFE_TIME)
>        sprintf(buf+strlen(buf), " preferred_lft forever");
>   else
>        sprintf(buf+strlen(buf), " preferred_lft %usec",
>                ci->ifa_prefered);
>   fprintf(fp, "       %s", buf);
> 
> When calling iproute2 oftenly shortly after a prefix has been advertised on the
> link, one could see that there actually was an integer underflow going on (the
> output changed from "0" to "forever" to 2^32-1).
> 
> Interestringly, if_addr.h does define ifa_prefered to be a __u32, so iproute2
> merely implements the interface. RFC4862 mandates that the preferred lifetime
> always is lower than or equal to the valid lifetime, which is also defined to
> be a __u32.
> 
> I'm certainly no expert in the linux kernel code, but this looks like a bug to
> me. Why is ifa_prefered defined to be non-negative?
> 
> Benedikt
> 
> 
> -- 
> Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.

           reply	other threads:[~2008-06-07 19:01 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <bug-10880-10286@http.bugzilla.kernel.org/>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080607120151.72c0f53b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=benedikt@gollatz.net \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).