netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Tunneling minor patches
@ 2010-11-29 19:47 Stephen Hemminger
  2010-11-29 19:47 ` [PATCH 1/3] gre: minor cleanups Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Stephen Hemminger @ 2010-11-29 19:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev



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

* [PATCH 1/3] gre: minor cleanups
  2010-11-29 19:47 [PATCH 0/3] Tunneling minor patches Stephen Hemminger
@ 2010-11-29 19:47 ` Stephen Hemminger
  2010-11-29 19:47 ` [PATCH 2/3] gre: add module alias for gre0 tunnel device Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2010-11-29 19:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

[-- Attachment #1: gre-fix-trivial.patch --]
[-- Type: text/plain, Size: 602 bytes --]

Use strcpy() rather the sprintf() for the case where name is getting
generated.  Fix indentation.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/net/ipv4/ip_gre.c	2010-11-28 11:28:48.684091117 -0800
+++ b/net/ipv4/ip_gre.c	2010-11-28 11:29:21.839822531 -0800
@@ -405,11 +405,11 @@ static struct ip_tunnel *ipgre_tunnel_lo
 	if (parms->name[0])
 		strlcpy(name, parms->name, IFNAMSIZ);
 	else
-		sprintf(name, "gre%%d");
+		strcpy(name, "gre%d");
 
 	dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup);
 	if (!dev)
-	  return NULL;
+		return NULL;
 
 	dev_net_set(dev, net);
 



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

* [PATCH 2/3] gre: add module alias for gre0 tunnel device
  2010-11-29 19:47 [PATCH 0/3] Tunneling minor patches Stephen Hemminger
  2010-11-29 19:47 ` [PATCH 1/3] gre: minor cleanups Stephen Hemminger
@ 2010-11-29 19:47 ` Stephen Hemminger
  2010-11-29 19:47 ` [PATCH 3/3] ipip: add module alias for tunl0 " Stephen Hemminger
  2010-12-01 20:52 ` [PATCH 0/3] Tunneling minor patches David Miller
  3 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2010-11-29 19:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

[-- Attachment #1: gre-alias.patch --]
[-- Type: text/plain, Size: 549 bytes --]

If gre is built as a module the 'ip tunnel add' command would fail because
the ip_gre module was not being autoloaded.  Adding an alias for
the gre0 device name cause dev_load() to autoload it when needed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/net/ipv4/ip_gre.c	2010-11-29 11:35:36.388589982 -0800
+++ b/net/ipv4/ip_gre.c	2010-11-29 11:35:46.675624021 -0800
@@ -1764,3 +1764,4 @@ module_exit(ipgre_fini);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_RTNL_LINK("gre");
 MODULE_ALIAS_RTNL_LINK("gretap");
+MODULE_ALIAS("gre0");



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

* [PATCH 3/3] ipip: add module alias for tunl0 tunnel device
  2010-11-29 19:47 [PATCH 0/3] Tunneling minor patches Stephen Hemminger
  2010-11-29 19:47 ` [PATCH 1/3] gre: minor cleanups Stephen Hemminger
  2010-11-29 19:47 ` [PATCH 2/3] gre: add module alias for gre0 tunnel device Stephen Hemminger
@ 2010-11-29 19:47 ` Stephen Hemminger
  2010-11-30  7:19   ` Eric Dumazet
  2010-12-01 20:52 ` [PATCH 0/3] Tunneling minor patches David Miller
  3 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2010-11-29 19:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

[-- Attachment #1: ipip-alias.patch --]
[-- Type: text/plain, Size: 536 bytes --]

If ipip is built as a module the 'ip tunnel add' command would fail because
the ipip module was not being autoloaded.  Adding an alias for
the tunl0 device name cause dev_load() to autoload it when needed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/net/ipv4/ipip.c	2010-11-29 11:40:25.026277890 -0800
+++ b/net/ipv4/ipip.c	2010-11-29 11:41:05.790681069 -0800
@@ -913,3 +913,4 @@ static void __exit ipip_fini(void)
 module_init(ipip_init);
 module_exit(ipip_fini);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("tunl0");



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

* Re: [PATCH 3/3] ipip: add module alias for tunl0 tunnel device
  2010-11-29 19:47 ` [PATCH 3/3] ipip: add module alias for tunl0 " Stephen Hemminger
@ 2010-11-30  7:19   ` Eric Dumazet
  2010-11-30  7:55     ` Changli Gao
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Dumazet @ 2010-11-30  7:19 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, netdev

Le lundi 29 novembre 2010 à 11:47 -0800, Stephen Hemminger a écrit :
> pièce jointe document texte brut (ipip-alias.patch)
> If ipip is built as a module the 'ip tunnel add' command would fail because
> the ipip module was not being autoloaded.  Adding an alias for
> the tunl0 device name cause dev_load() to autoload it when needed.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> --- a/net/ipv4/ipip.c	2010-11-29 11:40:25.026277890 -0800
> +++ b/net/ipv4/ipip.c	2010-11-29 11:41:05.790681069 -0800
> @@ -913,3 +913,4 @@ static void __exit ipip_fini(void)
>  module_init(ipip_init);
>  module_exit(ipip_fini);
>  MODULE_LICENSE("GPL");
> +MODULE_ALIAS("tunl0");

I am not sure I understand you...

Here, I do have ipip built as a module, and I have no problem :

# lsmod|grep ipip
# ip tunnel add
cannot determine tunnel mode (ipip, gre or sit)
# lsmod|grep ipip
# ip tunnel add mode ipip
# lsmod|grep ipip
ipip                    7692  0 
tunnel4                 2949  1 ipip
# 

What am I missing ?



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

* Re: [PATCH 3/3] ipip: add module alias for tunl0 tunnel device
  2010-11-30  7:19   ` Eric Dumazet
@ 2010-11-30  7:55     ` Changli Gao
  2010-11-30  8:21       ` Eric Dumazet
  0 siblings, 1 reply; 10+ messages in thread
From: Changli Gao @ 2010-11-30  7:55 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Stephen Hemminger, David Miller, netdev

On Tue, Nov 30, 2010 at 3:19 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le lundi 29 novembre 2010 à 11:47 -0800, Stephen Hemminger a écrit :
>> pièce jointe document texte brut (ipip-alias.patch)
>> If ipip is built as a module the 'ip tunnel add' command would fail because
>> the ipip module was not being autoloaded.  Adding an alias for
>> the tunl0 device name cause dev_load() to autoload it when needed.
>>
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>>
>> --- a/net/ipv4/ipip.c 2010-11-29 11:40:25.026277890 -0800
>> +++ b/net/ipv4/ipip.c 2010-11-29 11:41:05.790681069 -0800
>> @@ -913,3 +913,4 @@ static void __exit ipip_fini(void)
>>  module_init(ipip_init);
>>  module_exit(ipip_fini);
>>  MODULE_LICENSE("GPL");
>> +MODULE_ALIAS("tunl0");
>
> I am not sure I understand you...
>
> Here, I do have ipip built as a module, and I have no problem :
>
> # lsmod|grep ipip
> # ip tunnel add
> cannot determine tunnel mode (ipip, gre or sit)
> # lsmod|grep ipip
> # ip tunnel add mode ipip
> # lsmod|grep ipip
> ipip                    7692  0
> tunnel4                 2949  1 ipip
> #
>
> What am I missing ?
>
>

localhost linux # lsmod
Module                  Size  Used by
ipv6                  309359  12
localhost linux # ip -V
ip utility, iproute2-ss091226
localhost linux # ip tunnel add mode gre
ioctl: No such device
localhost linux # ip tunnel add mode ipip
ioctl: No such device
localhost linux # modprobe ip_gre
localhost linux # modprobe ipip
localhost linux # ip tunnel add mode ipip
localhost linux # ip tunnel add mode gre
localhost linux # lsmod
Module                  Size  Used by
ipip                    8128  0
tunnel4                 2683  1 ipip
ip_gre                 15055  0
gre                     1967  1 ip_gre
ipv6                  309359  13 ip_gre


-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

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

* Re: [PATCH 3/3] ipip: add module alias for tunl0 tunnel device
  2010-11-30  7:55     ` Changli Gao
@ 2010-11-30  8:21       ` Eric Dumazet
  2010-11-30 16:08         ` Stephen Hemminger
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Dumazet @ 2010-11-30  8:21 UTC (permalink / raw)
  To: Changli Gao; +Cc: Stephen Hemminger, David Miller, netdev

Le mardi 30 novembre 2010 à 15:55 +0800, Changli Gao a écrit :
> On Tue, Nov 30, 2010 at 3:19 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Le lundi 29 novembre 2010 à 11:47 -0800, Stephen Hemminger a écrit :
> >> pièce jointe document texte brut (ipip-alias.patch)
> >> If ipip is built as a module the 'ip tunnel add' command would fail because
> >> the ipip module was not being autoloaded.  Adding an alias for
> >> the tunl0 device name cause dev_load() to autoload it when needed.
> >>
> >> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >>
> >> --- a/net/ipv4/ipip.c 2010-11-29 11:40:25.026277890 -0800
> >> +++ b/net/ipv4/ipip.c 2010-11-29 11:41:05.790681069 -0800
> >> @@ -913,3 +913,4 @@ static void __exit ipip_fini(void)
> >>  module_init(ipip_init);
> >>  module_exit(ipip_fini);
> >>  MODULE_LICENSE("GPL");
> >> +MODULE_ALIAS("tunl0");
> >
> > I am not sure I understand you...
> >
> > Here, I do have ipip built as a module, and I have no problem :
> >
> > # lsmod|grep ipip
> > # ip tunnel add
> > cannot determine tunnel mode (ipip, gre or sit)
> > # lsmod|grep ipip
> > # ip tunnel add mode ipip
> > # lsmod|grep ipip
> > ipip                    7692  0
> > tunnel4                 2949  1 ipip
> > #
> >
> > What am I missing ?
> >
> >
> 
> localhost linux # lsmod
> Module                  Size  Used by
> ipv6                  309359  12
> localhost linux # ip -V
> ip utility, iproute2-ss091226
> localhost linux # ip tunnel add mode gre
> ioctl: No such device
> localhost linux # ip tunnel add mode ipip
> ioctl: No such device
> localhost linux # modprobe ip_gre
> localhost linux # modprobe ipip
> localhost linux # ip tunnel add mode ipip
> localhost linux # ip tunnel add mode gre
> localhost linux # lsmod
> Module                  Size  Used by
> ipip                    8128  0
> tunnel4                 2683  1 ipip
> ip_gre                 15055  0
> gre                     1967  1 ip_gre
> ipv6                  309359  13 ip_gre
> 
> 

Hmm. I still dont get it, ipv6 as a module ?

Works well here.

# lsmod
Module                  Size  Used by
bonding                89194  0 
ipv6                  232889  29 bonding
# ip tunnel add mode ipip
# lsmod
Module                  Size  Used by
ipip                    6221  0 
bonding                89194  0 
ipv6                  232889  29 bonding
# ip -V
ip utility, iproute2-ss100823
# 



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

* Re: [PATCH 3/3] ipip: add module alias for tunl0 tunnel device
  2010-11-30  8:21       ` Eric Dumazet
@ 2010-11-30 16:08         ` Stephen Hemminger
  2010-11-30 16:27           ` Eric Dumazet
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2010-11-30 16:08 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Changli Gao, David Miller, netdev

On Tue, 30 Nov 2010 09:21:09 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Le mardi 30 novembre 2010 à 15:55 +0800, Changli Gao a écrit :
> > On Tue, Nov 30, 2010 at 3:19 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > > Le lundi 29 novembre 2010 à 11:47 -0800, Stephen Hemminger a écrit :
> > >> pièce jointe document texte brut (ipip-alias.patch)
> > >> If ipip is built as a module the 'ip tunnel add' command would fail because
> > >> the ipip module was not being autoloaded.  Adding an alias for
> > >> the tunl0 device name cause dev_load() to autoload it when needed.
> > >>
> > >> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > >>
> > >> --- a/net/ipv4/ipip.c 2010-11-29 11:40:25.026277890 -0800
> > >> +++ b/net/ipv4/ipip.c 2010-11-29 11:41:05.790681069 -0800
> > >> @@ -913,3 +913,4 @@ static void __exit ipip_fini(void)
> > >>  module_init(ipip_init);
> > >>  module_exit(ipip_fini);
> > >>  MODULE_LICENSE("GPL");
> > >> +MODULE_ALIAS("tunl0");
> > >
> > > I am not sure I understand you...
> > >
> > > Here, I do have ipip built as a module, and I have no problem :
> > >
> > > # lsmod|grep ipip
> > > # ip tunnel add
> > > cannot determine tunnel mode (ipip, gre or sit)
> > > # lsmod|grep ipip
> > > # ip tunnel add mode ipip
> > > # lsmod|grep ipip
> > > ipip                    7692  0
> > > tunnel4                 2949  1 ipip
> > > #
> > >
> > > What am I missing ?
> > >
> > >
> > 
> > localhost linux # lsmod
> > Module                  Size  Used by
> > ipv6                  309359  12
> > localhost linux # ip -V
> > ip utility, iproute2-ss091226
> > localhost linux # ip tunnel add mode gre
> > ioctl: No such device
> > localhost linux # ip tunnel add mode ipip
> > ioctl: No such device
> > localhost linux # modprobe ip_gre
> > localhost linux # modprobe ipip
> > localhost linux # ip tunnel add mode ipip
> > localhost linux # ip tunnel add mode gre
> > localhost linux # lsmod
> > Module                  Size  Used by
> > ipip                    8128  0
> > tunnel4                 2683  1 ipip
> > ip_gre                 15055  0
> > gre                     1967  1 ip_gre
> > ipv6                  309359  13 ip_gre
> > 
> > 
> 
> Hmm. I still dont get it, ipv6 as a module ?
> 
> Works well here.
> 
> # lsmod
> Module                  Size  Used by
> bonding                89194  0 
> ipv6                  232889  29 bonding
> # ip tunnel add mode ipip
> # lsmod
> Module                  Size  Used by
> ipip                    6221  0 
> bonding                89194  0 
> ipv6                  232889  29 bonding
> # ip -V
> ip utility, iproute2-ss100823
> # 

If you run debian there is a list of aliases in /etc/modprobe.d/aliases.conf
that includes the ipip alias.

My patch provides same information from the kernel. In olden times,
the kernel relied more on user space defined aliases, but in the modern
era MODULE_ALIAS() is used to provide that information.


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

* Re: [PATCH 3/3] ipip: add module alias for tunl0 tunnel device
  2010-11-30 16:08         ` Stephen Hemminger
@ 2010-11-30 16:27           ` Eric Dumazet
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Dumazet @ 2010-11-30 16:27 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Changli Gao, David Miller, netdev

Le mardi 30 novembre 2010 à 08:08 -0800, Stephen Hemminger a écrit :

> If you run debian there is a list of aliases in /etc/modprobe.d/aliases.conf
> that includes the ipip alias.
> 
> My patch provides same information from the kernel. In olden times,
> the kernel relied more on user space defined aliases, but in the modern
> era MODULE_ALIAS() is used to provide that information.
> 

Thanks for the clarification.

Running an old Red Hat Enterprise Linux ES release 4 (Nahant Update 8)

# cat /etc/modprobe.conf
alias eth0 bnx2x
alias eth1 bnx2x
alias eth2 tg3
alias eth3 tg3

(No /etc/modprobe.d/ directory)

But I can see the alias in the '.dist' file

# grep ipip /etc/modprobe.conf.dist
alias tunl0 ipip

# mv /etc/modprobe.conf.dist /etc/modprobe.conf.dist.old
# ip tunnel add mode ipip
ioctl: No such device

Thanks !



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

* Re: [PATCH 0/3] Tunneling minor patches
  2010-11-29 19:47 [PATCH 0/3] Tunneling minor patches Stephen Hemminger
                   ` (2 preceding siblings ...)
  2010-11-29 19:47 ` [PATCH 3/3] ipip: add module alias for tunl0 " Stephen Hemminger
@ 2010-12-01 20:52 ` David Miller
  3 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-12-01 20:52 UTC (permalink / raw)
  To: shemminger; +Cc: netdev


I'll apply these to net-next-2.6, thanks Stephen.

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

end of thread, other threads:[~2010-12-01 20:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-29 19:47 [PATCH 0/3] Tunneling minor patches Stephen Hemminger
2010-11-29 19:47 ` [PATCH 1/3] gre: minor cleanups Stephen Hemminger
2010-11-29 19:47 ` [PATCH 2/3] gre: add module alias for gre0 tunnel device Stephen Hemminger
2010-11-29 19:47 ` [PATCH 3/3] ipip: add module alias for tunl0 " Stephen Hemminger
2010-11-30  7:19   ` Eric Dumazet
2010-11-30  7:55     ` Changli Gao
2010-11-30  8:21       ` Eric Dumazet
2010-11-30 16:08         ` Stephen Hemminger
2010-11-30 16:27           ` Eric Dumazet
2010-12-01 20:52 ` [PATCH 0/3] Tunneling minor patches David Miller

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).