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
f9fa9603
Commit
f9fa9603
authored
Jun 10, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/acme/net-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
b4418fb5
b7155403
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
include/net/sock.h
include/net/sock.h
+14
-0
net/ipv4/tcp.c
net/ipv4/tcp.c
+4
-16
No files found.
include/net/sock.h
View file @
f9fa9603
...
...
@@ -1040,6 +1040,20 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
sk
->
sk_stamp
=
*
stamp
;
}
/**
* sk_eat_skb - Release a skb if it is no longer needed
* @sk - socket to eat this skb from
* @skb - socket buffer to eat
*
* This routine must be called with interrupts disabled or with the socket
* locked so that the sk_buff queue operation is ok.
*/
static
inline
void
sk_eat_skb
(
struct
sock
*
sk
,
struct
sk_buff
*
skb
)
{
__skb_unlink
(
skb
,
&
sk
->
sk_receive_queue
);
__kfree_skb
(
skb
);
}
extern
atomic_t
netstamp_needed
;
extern
void
sock_enable_timestamp
(
struct
sock
*
sk
);
extern
void
sock_disable_timestamp
(
struct
sock
*
sk
);
...
...
net/ipv4/tcp.c
View file @
f9fa9603
...
...
@@ -1296,18 +1296,6 @@ static int tcp_recv_urg(struct sock *sk, long timeo,
return
-
EAGAIN
;
}
/*
* Release a skb if it is no longer needed. This routine
* must be called with interrupts disabled or with the
* socket locked so that the sk_buff queue operation is ok.
*/
static
inline
void
tcp_eat_skb
(
struct
sock
*
sk
,
struct
sk_buff
*
skb
)
{
__skb_unlink
(
skb
,
&
sk
->
sk_receive_queue
);
__kfree_skb
(
skb
);
}
/* Clean up the receive buffer for full frames taken by the user,
* then send an ACK if necessary. COPIED is the number of bytes
* tcp_recvmsg has given to the user so far, it speeds up the
...
...
@@ -1473,11 +1461,11 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
break
;
}
if
(
skb
->
h
.
th
->
fin
)
{
tcp
_eat_skb
(
sk
,
skb
);
sk
_eat_skb
(
sk
,
skb
);
++
seq
;
break
;
}
tcp
_eat_skb
(
sk
,
skb
);
sk
_eat_skb
(
sk
,
skb
);
if
(
!
desc
->
count
)
break
;
}
...
...
@@ -1758,14 +1746,14 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if
(
skb
->
h
.
th
->
fin
)
goto
found_fin_ok
;
if
(
!
(
flags
&
MSG_PEEK
))
tcp
_eat_skb
(
sk
,
skb
);
sk
_eat_skb
(
sk
,
skb
);
continue
;
found_fin_ok:
/* Process the FIN. */
++*
seq
;
if
(
!
(
flags
&
MSG_PEEK
))
tcp
_eat_skb
(
sk
,
skb
);
sk
_eat_skb
(
sk
,
skb
);
break
;
}
while
(
len
>
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