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
31dd5054
Commit
31dd5054
authored
Nov 15, 2004
by
Patrick McHardy
Browse files
Options
Browse Files
Download
Plain Diff
Merge coreworks.de:/home/kaber/src/nf/nf-2.6-ipq
into coreworks.de:/home/kaber/src/nf/nf-2.6
parents
f2fab154
ee0cbaef
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
23 deletions
+46
-23
include/linux/netdevice.h
include/linux/netdevice.h
+3
-0
include/net/sock.h
include/net/sock.h
+0
-12
net/core/dev.c
net/core/dev.c
+25
-0
net/core/sock.c
net/core/sock.c
+2
-5
net/ipv4/netfilter/ip_queue.c
net/ipv4/netfilter/ip_queue.c
+8
-3
net/ipv6/netfilter/ip6_queue.c
net/ipv6/netfilter/ip6_queue.c
+8
-3
No files found.
include/linux/netdevice.h
View file @
31dd5054
...
...
@@ -925,6 +925,9 @@ extern unsigned long netdev_fc_xoff;
extern
atomic_t
netdev_dropping
;
extern
int
netdev_set_master
(
struct
net_device
*
dev
,
struct
net_device
*
master
);
extern
int
skb_checksum_help
(
struct
sk_buff
*
skb
,
int
inward
);
/* rx skb timestamps */
extern
void
net_enable_timestamp
(
void
);
extern
void
net_disable_timestamp
(
void
);
#ifdef CONFIG_SYSCTL
extern
char
*
net_sysctl_strdup
(
const
char
*
s
);
...
...
include/net/sock.h
View file @
31dd5054
...
...
@@ -1270,19 +1270,7 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb)
__kfree_skb
(
skb
);
}
extern
atomic_t
netstamp_needed
;
extern
void
sock_enable_timestamp
(
struct
sock
*
sk
);
static
inline
void
net_timestamp
(
struct
timeval
*
stamp
)
{
if
(
atomic_read
(
&
netstamp_needed
))
do_gettimeofday
(
stamp
);
else
{
stamp
->
tv_sec
=
0
;
stamp
->
tv_usec
=
0
;
}
}
extern
int
sock_get_timestamp
(
struct
sock
*
,
struct
timeval
__user
*
);
/*
...
...
net/core/dev.c
View file @
31dd5054
...
...
@@ -1001,6 +1001,29 @@ int call_netdevice_notifiers(unsigned long val, void *v)
return
notifier_call_chain
(
&
netdev_chain
,
val
,
v
);
}
/* When > 0 there are consumers of rx skb time stamps */
static
atomic_t
netstamp_needed
=
ATOMIC_INIT
(
0
);
void
net_enable_timestamp
(
void
)
{
atomic_inc
(
&
netstamp_needed
);
}
void
net_disable_timestamp
(
void
)
{
atomic_dec
(
&
netstamp_needed
);
}
static
inline
void
net_timestamp
(
struct
timeval
*
stamp
)
{
if
(
atomic_read
(
&
netstamp_needed
))
do_gettimeofday
(
stamp
);
else
{
stamp
->
tv_sec
=
0
;
stamp
->
tv_usec
=
0
;
}
}
/*
* Support routine. Sends outgoing frames to any network
* taps currently in use.
...
...
@@ -3215,6 +3238,8 @@ EXPORT_SYMBOL(skb_checksum_help);
EXPORT_SYMBOL
(
synchronize_net
);
EXPORT_SYMBOL
(
unregister_netdevice
);
EXPORT_SYMBOL
(
unregister_netdevice_notifier
);
EXPORT_SYMBOL
(
net_enable_timestamp
);
EXPORT_SYMBOL
(
net_disable_timestamp
);
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
EXPORT_SYMBOL
(
br_handle_frame_hook
);
...
...
net/core/sock.c
View file @
31dd5054
...
...
@@ -179,7 +179,7 @@ static void sock_disable_timestamp(struct sock *sk)
{
if
(
sock_flag
(
sk
,
SOCK_TIMESTAMP
))
{
sock_reset_flag
(
sk
,
SOCK_TIMESTAMP
);
atomic_dec
(
&
netstamp_needed
);
net_disable_timestamp
(
);
}
}
...
...
@@ -1226,9 +1226,6 @@ void fastcall release_sock(struct sock *sk)
}
EXPORT_SYMBOL
(
release_sock
);
/* When > 0 there are consumers of rx skb time stamps */
atomic_t
netstamp_needed
=
ATOMIC_INIT
(
0
);
int
sock_get_timestamp
(
struct
sock
*
sk
,
struct
timeval
__user
*
userstamp
)
{
if
(
!
sock_flag
(
sk
,
SOCK_TIMESTAMP
))
...
...
@@ -1246,7 +1243,7 @@ void sock_enable_timestamp(struct sock *sk)
{
if
(
!
sock_flag
(
sk
,
SOCK_TIMESTAMP
))
{
sock_set_flag
(
sk
,
SOCK_TIMESTAMP
);
atomic_inc
(
&
netstamp_needed
);
net_enable_timestamp
(
);
}
}
EXPORT_SYMBOL
(
sock_enable_timestamp
);
...
...
net/ipv4/netfilter/ip_queue.c
View file @
31dd5054
...
...
@@ -162,6 +162,7 @@ static inline void
__ipq_reset
(
void
)
{
peer_pid
=
0
;
net_disable_timestamp
();
__ipq_set_mode
(
IPQ_COPY_NONE
,
0
);
__ipq_flush
(
NF_DROP
);
}
...
...
@@ -257,7 +258,8 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp)
}
if
(
data_len
)
memcpy
(
pmsg
->
payload
,
entry
->
skb
->
data
,
data_len
);
if
(
skb_copy_bits
(
entry
->
skb
,
0
,
pmsg
->
payload
,
data_len
))
BUG
();
nlh
->
nlmsg_len
=
skb
->
tail
-
old_tail
;
return
skb
;
...
...
@@ -362,6 +364,8 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
}
skb_put
(
e
->
skb
,
diff
);
}
if
(
!
skb_ip_make_writable
(
&
e
->
skb
,
v
->
data_len
))
return
-
ENOMEM
;
memcpy
(
e
->
skb
->
data
,
v
->
payload
,
v
->
data_len
);
e
->
skb
->
nfcache
|=
NFC_ALTERED
;
...
...
@@ -514,9 +518,10 @@ ipq_rcv_skb(struct sk_buff *skb)
write_unlock_bh
(
&
queue_lock
);
RCV_SKB_FAIL
(
-
EBUSY
);
}
}
else
}
else
{
net_enable_timestamp
();
peer_pid
=
pid
;
}
write_unlock_bh
(
&
queue_lock
);
...
...
net/ipv6/netfilter/ip6_queue.c
View file @
31dd5054
...
...
@@ -167,6 +167,7 @@ static inline void
__ipq_reset
(
void
)
{
peer_pid
=
0
;
net_disable_timestamp
();
__ipq_set_mode
(
IPQ_COPY_NONE
,
0
);
__ipq_flush
(
NF_DROP
);
}
...
...
@@ -262,7 +263,8 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp)
}
if
(
data_len
)
memcpy
(
pmsg
->
payload
,
entry
->
skb
->
data
,
data_len
);
if
(
skb_copy_bits
(
entry
->
skb
,
0
,
pmsg
->
payload
,
data_len
))
BUG
();
nlh
->
nlmsg_len
=
skb
->
tail
-
old_tail
;
return
skb
;
...
...
@@ -366,6 +368,8 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
}
skb_put
(
e
->
skb
,
diff
);
}
if
(
!
skb_ip_make_writable
(
&
e
->
skb
,
v
->
data_len
))
return
-
ENOMEM
;
memcpy
(
e
->
skb
->
data
,
v
->
payload
,
v
->
data_len
);
e
->
skb
->
nfcache
|=
NFC_ALTERED
;
...
...
@@ -517,9 +521,10 @@ ipq_rcv_skb(struct sk_buff *skb)
write_unlock_bh
(
&
queue_lock
);
RCV_SKB_FAIL
(
-
EBUSY
);
}
}
else
}
else
{
net_enable_timestamp
();
peer_pid
=
pid
;
}
write_unlock_bh
(
&
queue_lock
);
...
...
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