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
nexedi
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
if
(
!
create
)
return
NULL
;
if
(
!
try_module_get
(
THIS_MODULE
))
return
NULL
;
dev
=
kmalloc
(
sizeof
(
*
dev
)
+
sizeof
(
*
t
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
{
module_put
(
THIS_MODULE
);
if
(
dev
==
NULL
)
return
NULL
;
}
memset
(
dev
,
0
,
sizeof
(
*
dev
)
+
sizeof
(
*
t
));
dev
->
priv
=
(
void
*
)(
dev
+
1
);
nt
=
(
struct
ip_tunnel
*
)
dev
->
priv
;
...
...
@@ -196,6 +193,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
goto
failed
;
memcpy
(
nt
->
parms
.
name
,
dev
->
name
,
IFNAMSIZ
);
}
SET_MODULE_OWNER
(
dev
);
if
(
register_netdevice
(
dev
)
<
0
)
goto
failed
;
...
...
@@ -206,16 +204,13 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
failed:
kfree
(
dev
);
module_put
(
THIS_MODULE
);
return
NULL
;
}
static
void
ipip6_tunnel_destructor
(
struct
net_device
*
dev
)
{
if
(
dev
!=
&
ipip6_fb_tunnel_dev
)
{
if
(
dev
!=
&
ipip6_fb_tunnel_dev
)
kfree
(
dev
);
module_put
(
THIS_MODULE
);
}
}
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)
struct
ip_tunnel_parm
p
;
struct
ip_tunnel
*
t
;
if
(
!
try_module_get
(
THIS_MODULE
))
return
-
EBUSY
;
switch
(
cmd
)
{
case
SIOCGETTUNNEL
:
t
=
NULL
;
...
...
@@ -723,7 +715,6 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
}
done:
module_put
(
THIS_MODULE
);
return
err
;
}
...
...
@@ -800,30 +791,11 @@ static int ipip6_tunnel_init(struct net_device *dev)
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
)
{
struct
iphdr
*
iph
;
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
->
version
=
4
;
...
...
@@ -860,6 +832,7 @@ int __init sit_init(void)
ipip6_fb_tunnel_dev
.
priv
=
(
void
*
)
&
ipip6_fb_tunnel
;
strcpy
(
ipip6_fb_tunnel_dev
.
name
,
ipip6_fb_tunnel
.
parms
.
name
);
SET_MODULE_OWNER
(
&
ipip6_fb_tunnel_dev
);
register_netdev
(
&
ipip6_fb_tunnel_dev
);
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