All of lore.kernel.org
 help / color / mirror / Atom feed
* iproute2 issue with adding rules.
@ 2010-05-17 19:03 Ben Greear
  2010-05-17 20:13 ` Ben Greear
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Greear @ 2010-05-17 19:03 UTC (permalink / raw)
  To: NetDev

On older releases, you can do this with iproute:

# ip ru add from 9.9.9.2/32 table 226 pref 400
#

But, in latest git, it returns an error:
# ip ru add from 9.9.9.2/32 table 226 pref 400
Error: an inet prefix is expected rather than "9.9.9.2/32".

Is that on purpose?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: iproute2 issue with adding rules.
  2010-05-17 19:03 iproute2 issue with adding rules Ben Greear
@ 2010-05-17 20:13 ` Ben Greear
  2010-05-17 20:27   ` Stephen Hemminger
  2010-05-17 20:28   ` Ben Greear
  0 siblings, 2 replies; 7+ messages in thread
From: Ben Greear @ 2010-05-17 20:13 UTC (permalink / raw)
  To: NetDev

On 05/17/2010 12:03 PM, Ben Greear wrote:
> On older releases, you can do this with iproute:
>
> # ip ru add from 9.9.9.2/32 table 226 pref 400
> #
>
> But, in latest git, it returns an error:
> # ip ru add from 9.9.9.2/32 table 226 pref 400
> Error: an inet prefix is expected rather than "9.9.9.2/32".
>
> Is that on purpose?

I was thinking maybe this was a library issue, since I compiled
on one machine and ran the 'ip' exe on another.  So, I tried compiling
on the test system.

But, iproute will not compile, apparently because it finds the
/usr/include/linux header files before whatever is packaged with
iproute:

gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\"   -c -o ipaddress.o ipaddress.c
ipaddress.c: In function ‘print_linkinfo’:
ipaddress.c:334: error: ‘IFLA_VFINFO’ undeclared (first use in this function)
ipaddress.c:334: error: (Each undeclared identifier is reported only once
ipaddress.c:334: error: for each function it appears in.)
make[1]: *** [ipaddress.o] Error 1
make[1]: Leaving directory `/root/git/iproute2/ip'
make: *** [all] Error 2


I tried moving /usr/include/linux out of the way, but then it blows up
even worse (can't find errno.h, etc)

Are we supposed to be able to compile iproute2 on a system with moderately
outdated kernel headers?

If not, why bother with the iproute/include/linux directory at all?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: iproute2 issue with adding rules.
  2010-05-17 20:13 ` Ben Greear
@ 2010-05-17 20:27   ` Stephen Hemminger
  2010-05-17 20:28   ` Ben Greear
  1 sibling, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2010-05-17 20:27 UTC (permalink / raw)
  To: Ben Greear; +Cc: NetDev

On Mon, 17 May 2010 13:13:06 -0700
Ben Greear <greearb@candelatech.com> wrote:

> On 05/17/2010 12:03 PM, Ben Greear wrote:
> > On older releases, you can do this with iproute:
> >
> > # ip ru add from 9.9.9.2/32 table 226 pref 400
> > #
> >
> > But, in latest git, it returns an error:
> > # ip ru add from 9.9.9.2/32 table 226 pref 400
> > Error: an inet prefix is expected rather than "9.9.9.2/32".
> >
> > Is that on purpose?
> 
> I was thinking maybe this was a library issue, since I compiled
> on one machine and ran the 'ip' exe on another.  So, I tried compiling
> on the test system.
> 
> But, iproute will not compile, apparently because it finds the
> /usr/include/linux header files before whatever is packaged with
> iproute:
> 
> gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib/\"   -c -o ipaddress.o ipaddress.c
> ipaddress.c: In function ‘print_linkinfo’:
> ipaddress.c:334: error: ‘IFLA_VFINFO’ undeclared (first use in this function)
> ipaddress.c:334: error: (Each undeclared identifier is reported only once
> ipaddress.c:334: error: for each function it appears in.)
> make[1]: *** [ipaddress.o] Error 1
> make[1]: Leaving directory `/root/git/iproute2/ip'
> make: *** [all] Error 2
> 
> 
> I tried moving /usr/include/linux out of the way, but then it blows up
> even worse (can't find errno.h, etc)
> 
> Are we supposed to be able to compile iproute2 on a system with moderately
> outdated kernel headers?
> 
> If not, why bother with the iproute/include/linux directory at all?

The issue is the last minute VF changes in 2.6.34 are not supported
in iproute util yet. Please wait until it is fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: iproute2 issue with adding rules.
  2010-05-17 20:13 ` Ben Greear
  2010-05-17 20:27   ` Stephen Hemminger
@ 2010-05-17 20:28   ` Ben Greear
  2010-05-17 20:30     ` Chris Wright
  1 sibling, 1 reply; 7+ messages in thread
From: Ben Greear @ 2010-05-17 20:28 UTC (permalink / raw)
  To: NetDev

On 05/17/2010 01:13 PM, Ben Greear wrote:
> On 05/17/2010 12:03 PM, Ben Greear wrote:
>> On older releases, you can do this with iproute:
>>
>> # ip ru add from 9.9.9.2/32 table 226 pref 400
>> #
>>
>> But, in latest git, it returns an error:
>> # ip ru add from 9.9.9.2/32 table 226 pref 400
>> Error: an inet prefix is expected rather than "9.9.9.2/32".
>>
>> Is that on purpose?
>
> I was thinking maybe this was a library issue, since I compiled
> on one machine and ran the 'ip' exe on another. So, I tried compiling
> on the test system.

I'm not thinking too well today, but this patch fixes the compile.
No idea if it's actually correct code.
Still can't add the rule like I was trying...but at least it's probably
not an issue with libraries:

[root@ct503-10G-09 iproute2]# git diff
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 48f7b1e..4d4481a 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -331,13 +331,13 @@ int print_linkinfo(const struct sockaddr_nl *who,
                                 );
                 }
         }
-       if (do_link && tb[IFLA_VFINFO] && tb[IFLA_NUM_VF]) {
+       if (do_link && tb[IFLA_VFINFO_LIST] && tb[IFLA_NUM_VF]) {
                 SPRINT_BUF(b1);
-               struct rtattr *rta = tb[IFLA_VFINFO];
+               struct rtattr *rta = tb[IFLA_VFINFO_LIST];
                 struct ifla_vf_info *ivi;
                 int i;
                 for (i = 0; i < *(int *)RTA_DATA(tb[IFLA_NUM_VF]); i++) {
-                       if (rta->rta_type != IFLA_VFINFO) {
+                       if (rta->rta_type != IFLA_VFINFO_LIST) {
                                 fprintf(stderr, "BUG: rta type is %d\n", rta->rta_type);
                                 break;
                         }


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: iproute2 issue with adding rules.
  2010-05-17 20:28   ` Ben Greear
@ 2010-05-17 20:30     ` Chris Wright
  2010-05-17 20:34       ` Ben Greear
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wright @ 2010-05-17 20:30 UTC (permalink / raw)
  To: Ben Greear; +Cc: NetDev

* Ben Greear (greearb@candelatech.com) wrote:
> On 05/17/2010 01:13 PM, Ben Greear wrote:
> >On 05/17/2010 12:03 PM, Ben Greear wrote:
> >>On older releases, you can do this with iproute:
> >>
> >># ip ru add from 9.9.9.2/32 table 226 pref 400
> >>#
> >>
> >>But, in latest git, it returns an error:
> >># ip ru add from 9.9.9.2/32 table 226 pref 400
> >>Error: an inet prefix is expected rather than "9.9.9.2/32".
> >>
> >>Is that on purpose?
> >
> >I was thinking maybe this was a library issue, since I compiled
> >on one machine and ran the 'ip' exe on another. So, I tried compiling
> >on the test system.
> 
> I'm not thinking too well today, but this patch fixes the compile.
> No idea if it's actually correct code.

Needs more changes than that patch.

thanks,
-chris

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: iproute2 issue with adding rules.
  2010-05-17 20:30     ` Chris Wright
@ 2010-05-17 20:34       ` Ben Greear
  2010-05-17 21:41         ` Stephen Hemminger
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Greear @ 2010-05-17 20:34 UTC (permalink / raw)
  To: Chris Wright; +Cc: NetDev

On 05/17/2010 01:30 PM, Chris Wright wrote:
> * Ben Greear (greearb@candelatech.com) wrote:
>> On 05/17/2010 01:13 PM, Ben Greear wrote:
>>> On 05/17/2010 12:03 PM, Ben Greear wrote:
>>>> On older releases, you can do this with iproute:
>>>>
>>>> # ip ru add from 9.9.9.2/32 table 226 pref 400
>>>> #
>>>>
>>>> But, in latest git, it returns an error:
>>>> # ip ru add from 9.9.9.2/32 table 226 pref 400
>>>> Error: an inet prefix is expected rather than "9.9.9.2/32".
>>>>
>>>> Is that on purpose?
>>>
>>> I was thinking maybe this was a library issue, since I compiled
>>> on one machine and ran the 'ip' exe on another. So, I tried compiling
>>> on the test system.
>>
>> I'm not thinking too well today, but this patch fixes the compile.
>> No idea if it's actually correct code.
>
> Needs more changes than that patch.

Ok, I'll try going back a few commits to find something that compiles
w/out my hacks.

Also, the rule addition does work..make install put ip in
a different place than it's installed in fedora, so I wasn't
actually running the latest code when I first tried to add
the rule.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: iproute2 issue with adding rules.
  2010-05-17 20:34       ` Ben Greear
@ 2010-05-17 21:41         ` Stephen Hemminger
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2010-05-17 21:41 UTC (permalink / raw)
  To: Ben Greear; +Cc: Chris Wright, NetDev

On Mon, 17 May 2010 13:34:29 -0700
Ben Greear <greearb@candelatech.com> wrote:

> On 05/17/2010 01:30 PM, Chris Wright wrote:
> > * Ben Greear (greearb@candelatech.com) wrote:
> >> On 05/17/2010 01:13 PM, Ben Greear wrote:
> >>> On 05/17/2010 12:03 PM, Ben Greear wrote:
> >>>> On older releases, you can do this with iproute:
> >>>>
> >>>> # ip ru add from 9.9.9.2/32 table 226 pref 400
> >>>> #
> >>>>
> >>>> But, in latest git, it returns an error:
> >>>> # ip ru add from 9.9.9.2/32 table 226 pref 400
> >>>> Error: an inet prefix is expected rather than "9.9.9.2/32".
> >>>>
> >>>> Is that on purpose?
> >>>
> >>> I was thinking maybe this was a library issue, since I compiled
> >>> on one machine and ran the 'ip' exe on another. So, I tried compiling
> >>> on the test system.
> >>
> >> I'm not thinking too well today, but this patch fixes the compile.
> >> No idea if it's actually correct code.
> >
> > Needs more changes than that patch.
> 
> Ok, I'll try going back a few commits to find something that compiles
> w/out my hacks.
> 
> Also, the rule addition does work..make install put ip in
> a different place than it's installed in fedora, so I wasn't
> actually running the latest code when I first tried to add
> the rule.

Distributions never seem to agree where it should be: /sbin or /usr/sbin
or even /bin


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-05-17 21:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-17 19:03 iproute2 issue with adding rules Ben Greear
2010-05-17 20:13 ` Ben Greear
2010-05-17 20:27   ` Stephen Hemminger
2010-05-17 20:28   ` Ben Greear
2010-05-17 20:30     ` Chris Wright
2010-05-17 20:34       ` Ben Greear
2010-05-17 21:41         ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.