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
b50ca02a
Commit
b50ca02a
authored
Aug 18, 2003
by
Neil Brown
Committed by
Linus Torvalds
Aug 18, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] kNFSd: Make sure nfsd replies from the address the request was sent to.
This is important on multi-homes hosts.
parent
ebbbef61
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
include/linux/sunrpc/svc.h
include/linux/sunrpc/svc.h
+2
-0
net/sunrpc/svcsock.c
net/sunrpc/svcsock.c
+13
-3
No files found.
include/linux/sunrpc/svc.h
View file @
b50ca02a
...
@@ -131,6 +131,8 @@ struct svc_rqst {
...
@@ -131,6 +131,8 @@ struct svc_rqst {
rq_secure
:
1
;
/* secure port */
rq_secure
:
1
;
/* secure port */
__u32
rq_daddr
;
/* dest addr of request - reply from here */
void
*
rq_argp
;
/* decoded arguments */
void
*
rq_argp
;
/* decoded arguments */
void
*
rq_resp
;
/* xdr'd results */
void
*
rq_resp
;
/* xdr'd results */
...
...
net/sunrpc/svcsock.c
View file @
b50ca02a
...
@@ -353,6 +353,9 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
...
@@ -353,6 +353,9 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
struct
svc_sock
*
svsk
=
rqstp
->
rq_sock
;
struct
svc_sock
*
svsk
=
rqstp
->
rq_sock
;
struct
socket
*
sock
=
svsk
->
sk_sock
;
struct
socket
*
sock
=
svsk
->
sk_sock
;
int
slen
;
int
slen
;
struct
{
struct
cmsghdr
cmh
;
struct
in_pktinfo
pki
;
}
cm
;
int
len
=
0
;
int
len
=
0
;
int
result
;
int
result
;
int
size
;
int
size
;
...
@@ -364,16 +367,22 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
...
@@ -364,16 +367,22 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
slen
=
xdr
->
len
;
slen
=
xdr
->
len
;
if
(
rqstp
->
rq_prot
==
IPPROTO_UDP
)
{
if
(
rqstp
->
rq_prot
==
IPPROTO_UDP
)
{
/* set the destination */
/* set the
source and
destination */
struct
msghdr
msg
;
struct
msghdr
msg
;
msg
.
msg_name
=
&
rqstp
->
rq_addr
;
msg
.
msg_name
=
&
rqstp
->
rq_addr
;
msg
.
msg_namelen
=
sizeof
(
rqstp
->
rq_addr
);
msg
.
msg_namelen
=
sizeof
(
rqstp
->
rq_addr
);
msg
.
msg_iov
=
NULL
;
msg
.
msg_iov
=
NULL
;
msg
.
msg_iovlen
=
0
;
msg
.
msg_iovlen
=
0
;
msg
.
msg_control
=
NULL
;
msg
.
msg_controllen
=
0
;
msg
.
msg_flags
=
MSG_MORE
;
msg
.
msg_flags
=
MSG_MORE
;
msg
.
msg_control
=
&
cm
;
msg
.
msg_controllen
=
sizeof
(
cm
);
cm
.
cmh
.
cmsg_len
=
sizeof
(
cm
);
cm
.
cmh
.
cmsg_level
=
SOL_IP
;
cm
.
cmh
.
cmsg_type
=
IP_PKTINFO
;
cm
.
pki
.
ipi_ifindex
=
0
;
cm
.
pki
.
ipi_spec_dst
.
s_addr
=
rqstp
->
rq_daddr
;
if
(
sock_sendmsg
(
sock
,
&
msg
,
0
)
<
0
)
if
(
sock_sendmsg
(
sock
,
&
msg
,
0
)
<
0
)
goto
out
;
goto
out
;
}
}
...
@@ -594,6 +603,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
...
@@ -594,6 +603,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
rqstp
->
rq_addr
.
sin_family
=
AF_INET
;
rqstp
->
rq_addr
.
sin_family
=
AF_INET
;
rqstp
->
rq_addr
.
sin_port
=
skb
->
h
.
uh
->
source
;
rqstp
->
rq_addr
.
sin_port
=
skb
->
h
.
uh
->
source
;
rqstp
->
rq_addr
.
sin_addr
.
s_addr
=
skb
->
nh
.
iph
->
saddr
;
rqstp
->
rq_addr
.
sin_addr
.
s_addr
=
skb
->
nh
.
iph
->
saddr
;
rqstp
->
rq_daddr
=
skb
->
nh
.
iph
->
daddr
;
svsk
->
sk_sk
->
sk_stamp
=
skb
->
stamp
;
svsk
->
sk_sk
->
sk_stamp
=
skb
->
stamp
;
...
...
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