Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
7d941b75
Commit
7d941b75
authored
Apr 09, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6]: Apply ipv4 tunnel module fixes to SIT driver.
parent
c18e4c72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
32 deletions
+5
-32
net/ipv6/sit.c
net/ipv6/sit.c
+5
-32
No files found.
net/ipv6/sit.c
View file @
7d941b75
...
@@ -170,13 +170,10 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
...
@@ -170,13 +170,10 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
if
(
!
create
)
if
(
!
create
)
return
NULL
;
return
NULL
;
if
(
!
try_module_get
(
THIS_MODULE
))
return
NULL
;
dev
=
kmalloc
(
sizeof
(
*
dev
)
+
sizeof
(
*
t
),
GFP_KERNEL
);
dev
=
kmalloc
(
sizeof
(
*
dev
)
+
sizeof
(
*
t
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
if
(
dev
==
NULL
)
module_put
(
THIS_MODULE
);
return
NULL
;
return
NULL
;
}
memset
(
dev
,
0
,
sizeof
(
*
dev
)
+
sizeof
(
*
t
));
memset
(
dev
,
0
,
sizeof
(
*
dev
)
+
sizeof
(
*
t
));
dev
->
priv
=
(
void
*
)(
dev
+
1
);
dev
->
priv
=
(
void
*
)(
dev
+
1
);
nt
=
(
struct
ip_tunnel
*
)
dev
->
priv
;
nt
=
(
struct
ip_tunnel
*
)
dev
->
priv
;
...
@@ -196,6 +193,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
...
@@ -196,6 +193,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
goto
failed
;
goto
failed
;
memcpy
(
nt
->
parms
.
name
,
dev
->
name
,
IFNAMSIZ
);
memcpy
(
nt
->
parms
.
name
,
dev
->
name
,
IFNAMSIZ
);
}
}
SET_MODULE_OWNER
(
dev
);
if
(
register_netdevice
(
dev
)
<
0
)
if
(
register_netdevice
(
dev
)
<
0
)
goto
failed
;
goto
failed
;
...
@@ -206,16 +204,13 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
...
@@ -206,16 +204,13 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
failed:
failed:
kfree
(
dev
);
kfree
(
dev
);
module_put
(
THIS_MODULE
);
return
NULL
;
return
NULL
;
}
}
static
void
ipip6_tunnel_destructor
(
struct
net_device
*
dev
)
static
void
ipip6_tunnel_destructor
(
struct
net_device
*
dev
)
{
{
if
(
dev
!=
&
ipip6_fb_tunnel_dev
)
{
if
(
dev
!=
&
ipip6_fb_tunnel_dev
)
kfree
(
dev
);
kfree
(
dev
);
module_put
(
THIS_MODULE
);
}
}
}
static
void
ipip6_tunnel_uninit
(
struct
net_device
*
dev
)
static
void
ipip6_tunnel_uninit
(
struct
net_device
*
dev
)
...
@@ -623,9 +618,6 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
...
@@ -623,9 +618,6 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
struct
ip_tunnel_parm
p
;
struct
ip_tunnel_parm
p
;
struct
ip_tunnel
*
t
;
struct
ip_tunnel
*
t
;
if
(
!
try_module_get
(
THIS_MODULE
))
return
-
EBUSY
;
switch
(
cmd
)
{
switch
(
cmd
)
{
case
SIOCGETTUNNEL
:
case
SIOCGETTUNNEL
:
t
=
NULL
;
t
=
NULL
;
...
@@ -723,7 +715,6 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
...
@@ -723,7 +715,6 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
}
}
done:
done:
module_put
(
THIS_MODULE
);
return
err
;
return
err
;
}
}
...
@@ -800,30 +791,11 @@ static int ipip6_tunnel_init(struct net_device *dev)
...
@@ -800,30 +791,11 @@ static int ipip6_tunnel_init(struct net_device *dev)
return
0
;
return
0
;
}
}
#ifdef MODULE
static
int
ipip6_fb_tunnel_open
(
struct
net_device
*
dev
)
{
if
(
!
try_module_get
(
THIS_MODULE
))
return
-
EBUSY
;
return
0
;
}
static
int
ipip6_fb_tunnel_close
(
struct
net_device
*
dev
)
{
module_put
(
THIS_MODULE
);
return
0
;
}
#endif
int
__init
ipip6_fb_tunnel_init
(
struct
net_device
*
dev
)
int
__init
ipip6_fb_tunnel_init
(
struct
net_device
*
dev
)
{
{
struct
iphdr
*
iph
;
struct
iphdr
*
iph
;
ipip6_tunnel_init_gen
(
dev
);
ipip6_tunnel_init_gen
(
dev
);
#ifdef MODULE
dev
->
open
=
ipip6_fb_tunnel_open
;
dev
->
stop
=
ipip6_fb_tunnel_close
;
#endif
iph
=
&
ipip6_fb_tunnel
.
parms
.
iph
;
iph
=
&
ipip6_fb_tunnel
.
parms
.
iph
;
iph
->
version
=
4
;
iph
->
version
=
4
;
...
@@ -860,6 +832,7 @@ int __init sit_init(void)
...
@@ -860,6 +832,7 @@ int __init sit_init(void)
ipip6_fb_tunnel_dev
.
priv
=
(
void
*
)
&
ipip6_fb_tunnel
;
ipip6_fb_tunnel_dev
.
priv
=
(
void
*
)
&
ipip6_fb_tunnel
;
strcpy
(
ipip6_fb_tunnel_dev
.
name
,
ipip6_fb_tunnel
.
parms
.
name
);
strcpy
(
ipip6_fb_tunnel_dev
.
name
,
ipip6_fb_tunnel
.
parms
.
name
);
SET_MODULE_OWNER
(
&
ipip6_fb_tunnel_dev
);
register_netdev
(
&
ipip6_fb_tunnel_dev
);
register_netdev
(
&
ipip6_fb_tunnel_dev
);
return
0
;
return
0
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment