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
816b9bb2
Commit
816b9bb2
authored
May 12, 2003
by
Arnaldo Carvalho de Melo
Committed by
David S. Miller
May 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4/IPV6]: Consolidate saddr resetting into inet_reset_saddr().
parent
e86747d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
26 deletions
+23
-26
include/net/ip.h
include/net/ip.h
+17
-0
net/ipv4/tcp.c
net/ipv4/tcp.c
+2
-11
net/ipv4/udp.c
net/ipv4/udp.c
+3
-11
net/ipv6/af_inet6.c
net/ipv6/af_inet6.c
+1
-4
No files found.
include/net/ip.h
View file @
816b9bb2
...
...
@@ -230,6 +230,23 @@ static inline void ip_eth_mc_map(u32 addr, char *buf)
buf
[
3
]
=
addr
&
0x7F
;
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
#include <linux/ipv6.h>
#endif
static
__inline__
void
inet_reset_saddr
(
struct
sock
*
sk
)
{
inet_sk
(
sk
)
->
rcv_saddr
=
inet_sk
(
sk
)
->
saddr
=
0
;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
if
(
sk
->
family
==
PF_INET6
)
{
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
memset
(
&
np
->
saddr
,
0
,
sizeof
(
np
->
saddr
));
memset
(
&
np
->
rcv_saddr
,
0
,
sizeof
(
np
->
rcv_saddr
));
}
#endif
}
#endif
extern
int
ip_call_ra_chain
(
struct
sk_buff
*
skb
);
...
...
net/ipv4/tcp.c
View file @
816b9bb2
...
...
@@ -2140,17 +2140,8 @@ int tcp_disconnect(struct sock *sk, int flags)
inet
->
dport
=
0
;
if
(
!
(
sk
->
userlocks
&
SOCK_BINDADDR_LOCK
))
{
inet
->
rcv_saddr
=
inet
->
saddr
=
0
;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
if
(
sk
->
family
==
PF_INET6
)
{
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
memset
(
&
np
->
saddr
,
0
,
16
);
memset
(
&
np
->
rcv_saddr
,
0
,
16
);
}
#endif
}
if
(
!
(
sk
->
userlocks
&
SOCK_BINDADDR_LOCK
))
inet_reset_saddr
(
sk
);
sk
->
shutdown
=
0
;
__clear_bit
(
SOCK_DONE
,
&
sk
->
flags
);
...
...
net/ipv4/udp.c
View file @
816b9bb2
...
...
@@ -920,17 +920,9 @@ int udp_disconnect(struct sock *sk, int flags)
inet
->
daddr
=
0
;
inet
->
dport
=
0
;
sk
->
bound_dev_if
=
0
;
if
(
!
(
sk
->
userlocks
&
SOCK_BINDADDR_LOCK
))
{
inet
->
rcv_saddr
=
inet
->
saddr
=
0
;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
if
(
sk
->
family
==
PF_INET6
)
{
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
memset
(
&
np
->
saddr
,
0
,
16
);
memset
(
&
np
->
rcv_saddr
,
0
,
16
);
}
#endif
}
if
(
!
(
sk
->
userlocks
&
SOCK_BINDADDR_LOCK
))
inet_reset_saddr
(
sk
);
if
(
!
(
sk
->
userlocks
&
SOCK_BINDPORT_LOCK
))
{
sk
->
prot
->
unhash
(
sk
);
inet
->
sport
=
0
;
...
...
net/ipv6/af_inet6.c
View file @
816b9bb2
...
...
@@ -355,10 +355,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
/* Make sure we are allowed to bind here. */
if
(
sk
->
prot
->
get_port
(
sk
,
snum
)
!=
0
)
{
inet
->
rcv_saddr
=
inet
->
saddr
=
0
;
memset
(
&
np
->
rcv_saddr
,
0
,
sizeof
(
struct
in6_addr
));
memset
(
&
np
->
saddr
,
0
,
sizeof
(
struct
in6_addr
));
inet_reset_saddr
(
sk
);
release_sock
(
sk
);
return
-
EADDRINUSE
;
}
...
...
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