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
439f31ed
Commit
439f31ed
authored
Jan 06, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge nuts.ninka.net:/disk1/davem/BK/network-2.6
into nuts.ninka.net:/disk1/davem/BK/net-2.6
parents
3434a16e
b42edee9
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
132 additions
and
506 deletions
+132
-506
CREDITS
CREDITS
+1
-1
drivers/net/Space.c
drivers/net/Space.c
+1
-1
include/linux/ip.h
include/linux/ip.h
+4
-1
include/linux/ipv6.h
include/linux/ipv6.h
+9
-2
include/linux/netdevice.h
include/linux/netdevice.h
+1
-1
include/linux/netfilter_ipv4.h
include/linux/netfilter_ipv4.h
+2
-0
include/linux/netfilter_ipv6.h
include/linux/netfilter_ipv6.h
+2
-0
include/linux/skbuff.h
include/linux/skbuff.h
+1
-1
include/linux/udp.h
include/linux/udp.h
+4
-1
include/net/ipv6.h
include/net/ipv6.h
+0
-7
include/net/irda/ircomm_tty.h
include/net/irda/ircomm_tty.h
+6
-1
net/decnet/af_decnet.c
net/decnet/af_decnet.c
+8
-9
net/ipv6/ip6_output.c
net/ipv6/ip6_output.c
+0
-416
net/irda/ircomm/ircomm_tty.c
net/irda/ircomm/ircomm_tty.c
+21
-18
net/packet/af_packet.c
net/packet/af_packet.c
+70
-45
net/sched/sch_htb.c
net/sched/sch_htb.c
+2
-2
No files found.
CREDITS
View file @
439f31ed
...
@@ -1567,7 +1567,7 @@ E: mk@linux-ipv6.org
...
@@ -1567,7 +1567,7 @@ E: mk@linux-ipv6.org
E: mk@isl.rdc.toshiba.co.jp
E: mk@isl.rdc.toshiba.co.jp
E: mk@karaba.org
E: mk@karaba.org
W: http://www.karaba.org/~mk/
W: http://www.karaba.org/~mk/
P: 1024D/2EC7E30D
9A35 D378 F084 9EA4 EFBA 925B 1C93 B376 F0EF BE59
P: 1024D/2EC7E30D
4DC3 949B 5A6C F0D6 375F 4472 8888 A8E1 2EC7 E30D
D: IPsec, IPv6
D: IPsec, IPv6
D: USAGI/WIDE Project, TOSHIBA CORPORATION
D: USAGI/WIDE Project, TOSHIBA CORPORATION
S: 2-47-8, Takinogawa,
S: 2-47-8, Takinogawa,
...
...
drivers/net/Space.c
View file @
439f31ed
...
@@ -350,7 +350,7 @@ static int __init ethif_probe(int unit)
...
@@ -350,7 +350,7 @@ static int __init ethif_probe(int unit)
* Backwards compatibility - historically an I/O base of 1 was
* Backwards compatibility - historically an I/O base of 1 was
* used to indicate not to probe for this ethN interface
* used to indicate not to probe for this ethN interface
*/
*/
if
(
dev
->
base_addr
==
1
)
{
if
(
__dev_get_by_name
(
dev
->
name
)
||
dev
->
base_addr
==
1
)
{
free_netdev
(
dev
);
free_netdev
(
dev
);
return
-
ENXIO
;
return
-
ENXIO
;
}
}
...
...
include/linux/ip.h
View file @
439f31ed
...
@@ -159,7 +159,10 @@ struct inet_sock {
...
@@ -159,7 +159,10 @@ struct inet_sock {
struct
inet_opt
inet
;
struct
inet_opt
inet
;
};
};
#define inet_sk(__sk) (&((struct inet_sock *)__sk)->inet)
static
inline
struct
inet_opt
*
inet_sk
(
const
struct
sock
*
__sk
)
{
return
&
((
struct
inet_sock
*
)
__sk
)
->
inet
;
}
#endif
#endif
...
...
include/linux/ipv6.h
View file @
439f31ed
...
@@ -270,8 +270,15 @@ struct tcp6_sock {
...
@@ -270,8 +270,15 @@ struct tcp6_sock {
struct
ipv6_pinfo
inet6
;
struct
ipv6_pinfo
inet6
;
};
};
#define inet6_sk(__sk) ((struct raw6_sock *)__sk)->pinet6
static
inline
struct
ipv6_pinfo
*
inet6_sk
(
const
struct
sock
*
__sk
)
#define raw6_sk(__sk) (&((struct raw6_sock *)__sk)->raw6)
{
return
((
struct
raw6_sock
*
)
__sk
)
->
pinet6
;
}
static
inline
struct
raw6_opt
*
raw6_sk
(
const
struct
sock
*
__sk
)
{
return
&
((
struct
raw6_sock
*
)
__sk
)
->
raw6
;
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
...
...
include/linux/netdevice.h
View file @
439f31ed
...
@@ -634,7 +634,7 @@ static inline void dev_kfree_skb_irq(struct sk_buff *skb)
...
@@ -634,7 +634,7 @@ static inline void dev_kfree_skb_irq(struct sk_buff *skb)
*/
*/
static
inline
void
dev_kfree_skb_any
(
struct
sk_buff
*
skb
)
static
inline
void
dev_kfree_skb_any
(
struct
sk_buff
*
skb
)
{
{
if
(
in_irq
())
if
(
in_irq
()
||
irqs_disabled
()
)
dev_kfree_skb_irq
(
skb
);
dev_kfree_skb_irq
(
skb
);
else
else
dev_kfree_skb
(
skb
);
dev_kfree_skb
(
skb
);
...
...
include/linux/netfilter_ipv4.h
View file @
439f31ed
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
enum
nf_ip_hook_priorities
{
enum
nf_ip_hook_priorities
{
NF_IP_PRI_FIRST
=
INT_MIN
,
NF_IP_PRI_FIRST
=
INT_MIN
,
NF_IP_PRI_SELINUX_FIRST
=
-
225
,
NF_IP_PRI_CONNTRACK
=
-
200
,
NF_IP_PRI_CONNTRACK
=
-
200
,
NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD
=
-
175
,
NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD
=
-
175
,
NF_IP_PRI_MANGLE
=
-
150
,
NF_IP_PRI_MANGLE
=
-
150
,
...
@@ -58,6 +59,7 @@ enum nf_ip_hook_priorities {
...
@@ -58,6 +59,7 @@ enum nf_ip_hook_priorities {
NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT
=
-
50
,
NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT
=
-
50
,
NF_IP_PRI_FILTER
=
0
,
NF_IP_PRI_FILTER
=
0
,
NF_IP_PRI_NAT_SRC
=
100
,
NF_IP_PRI_NAT_SRC
=
100
,
NF_IP_PRI_SELINUX_LAST
=
225
,
NF_IP_PRI_LAST
=
INT_MAX
,
NF_IP_PRI_LAST
=
INT_MAX
,
};
};
...
...
include/linux/netfilter_ipv6.h
View file @
439f31ed
...
@@ -56,11 +56,13 @@
...
@@ -56,11 +56,13 @@
enum
nf_ip6_hook_priorities
{
enum
nf_ip6_hook_priorities
{
NF_IP6_PRI_FIRST
=
INT_MIN
,
NF_IP6_PRI_FIRST
=
INT_MIN
,
NF_IP6_PRI_SELINUX_FIRST
=
-
225
,
NF_IP6_PRI_CONNTRACK
=
-
200
,
NF_IP6_PRI_CONNTRACK
=
-
200
,
NF_IP6_PRI_MANGLE
=
-
150
,
NF_IP6_PRI_MANGLE
=
-
150
,
NF_IP6_PRI_NAT_DST
=
-
100
,
NF_IP6_PRI_NAT_DST
=
-
100
,
NF_IP6_PRI_FILTER
=
0
,
NF_IP6_PRI_FILTER
=
0
,
NF_IP6_PRI_NAT_SRC
=
100
,
NF_IP6_PRI_NAT_SRC
=
100
,
NF_IP6_PRI_SELINUX_LAST
=
225
,
NF_IP6_PRI_LAST
=
INT_MAX
,
NF_IP6_PRI_LAST
=
INT_MAX
,
};
};
...
...
include/linux/skbuff.h
View file @
439f31ed
...
@@ -1132,7 +1132,7 @@ static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len)
...
@@ -1132,7 +1132,7 @@ static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len)
* is returned and the old skb data released.
* is returned and the old skb data released.
*/
*/
extern
int
__skb_linearize
(
struct
sk_buff
*
skb
,
int
gfp
);
extern
int
__skb_linearize
(
struct
sk_buff
*
skb
,
int
gfp
);
static
inline
int
__deprecated
skb_linearize
(
struct
sk_buff
*
skb
,
int
gfp
)
static
inline
int
skb_linearize
(
struct
sk_buff
*
skb
,
int
gfp
)
{
{
return
__skb_linearize
(
skb
,
gfp
);
return
__skb_linearize
(
skb
,
gfp
);
}
}
...
...
include/linux/udp.h
View file @
439f31ed
...
@@ -60,7 +60,10 @@ struct udp_sock {
...
@@ -60,7 +60,10 @@ struct udp_sock {
struct
udp_opt
udp
;
struct
udp_opt
udp
;
};
};
#define udp_sk(__sk) (&((struct udp_sock *)__sk)->udp)
static
inline
struct
udp_opt
*
udp_sk
(
const
struct
sock
*
__sk
)
{
return
&
((
struct
udp_sock
*
)
__sk
)
->
udp
;
}
#endif
#endif
...
...
include/net/ipv6.h
View file @
439f31ed
...
@@ -329,13 +329,6 @@ extern int ip6_nd_hdr(struct sock *sk,
...
@@ -329,13 +329,6 @@ extern int ip6_nd_hdr(struct sock *sk,
struct
in6_addr
*
daddr
,
struct
in6_addr
*
daddr
,
int
proto
,
int
len
);
int
proto
,
int
len
);
extern
int
ip6_build_xmit
(
struct
sock
*
sk
,
inet_getfrag_t
getfrag
,
const
void
*
data
,
struct
flowi
*
fl
,
unsigned
length
,
struct
ipv6_txoptions
*
opt
,
int
hlimit
,
int
flags
);
extern
int
ip6_find_1stfragopt
(
struct
sk_buff
*
skb
,
u8
**
nexthdr
);
extern
int
ip6_find_1stfragopt
(
struct
sk_buff
*
skb
,
u8
**
nexthdr
);
extern
int
ip6_append_data
(
struct
sock
*
sk
,
extern
int
ip6_append_data
(
struct
sock
*
sk
,
...
...
include/net/irda/ircomm_tty.h
View file @
439f31ed
...
@@ -52,6 +52,11 @@
...
@@ -52,6 +52,11 @@
/* Same for payload size. See qos.c for the smallest max data size */
/* Same for payload size. See qos.c for the smallest max data size */
#define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED)
#define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED)
/* Those are really defined in include/linux/serial.h - Jean II */
#define ASYNC_B_INITIALIZED 31
/* Serial port was initialized */
#define ASYNC_B_NORMAL_ACTIVE 29
/* Normal device is active */
#define ASYNC_B_CLOSING 27
/* Serial port is closing */
/*
/*
* IrCOMM TTY driver state
* IrCOMM TTY driver state
*/
*/
...
@@ -75,7 +80,7 @@ struct ircomm_tty_cb {
...
@@ -75,7 +80,7 @@ struct ircomm_tty_cb {
LOCAL_FLOW
flow
;
/* IrTTP flow status */
LOCAL_FLOW
flow
;
/* IrTTP flow status */
int
line
;
int
line
;
__u32
flags
;
volatile
unsigned
long
flags
;
__u8
dlsap_sel
;
__u8
dlsap_sel
;
__u8
slsap_sel
;
__u8
slsap_sel
;
...
...
net/decnet/af_decnet.c
View file @
439f31ed
...
@@ -2376,17 +2376,17 @@ static int __init decnet_init(void)
...
@@ -2376,17 +2376,17 @@ static int __init decnet_init(void)
dn_register_sysctl
();
dn_register_sysctl
();
/*
* Prevent DECnet module unloading until its fixed properly.
* Requires an audit of the code to check for memory leaks and
* initialisation problems etc.
*/
try_module_get
(
THIS_MODULE
);
return
0
;
return
0
;
}
}
module_init
(
decnet_init
);
/*
* Prevent DECnet module unloading until its fixed properly.
* Requires an audit of the code to check for memory leaks and
* initialisation problems etc.
*/
#if 0
static void __exit decnet_exit(void)
static void __exit decnet_exit(void)
{
{
sock_unregister(AF_DECnet);
sock_unregister(AF_DECnet);
...
@@ -2405,6 +2405,5 @@ static void __exit decnet_exit(void)
...
@@ -2405,6 +2405,5 @@ static void __exit decnet_exit(void)
kmem_cache_destroy(dn_sk_cachep);
kmem_cache_destroy(dn_sk_cachep);
}
}
module_init
(
decnet_init
);
module_exit(decnet_exit);
module_exit(decnet_exit);
#endif
net/ipv6/ip6_output.c
View file @
439f31ed
This diff is collapsed.
Click to expand it.
net/irda/ircomm/ircomm_tty.c
View file @
439f31ed
...
@@ -181,15 +181,15 @@ void __exit ircomm_tty_cleanup(void)
...
@@ -181,15 +181,15 @@ void __exit ircomm_tty_cleanup(void)
static
int
ircomm_tty_startup
(
struct
ircomm_tty_cb
*
self
)
static
int
ircomm_tty_startup
(
struct
ircomm_tty_cb
*
self
)
{
{
notify_t
notify
;
notify_t
notify
;
int
ret
;
int
ret
=
-
ENODEV
;
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
self
!=
NULL
,
return
-
1
;);
ASSERT
(
self
!=
NULL
,
return
-
1
;);
ASSERT
(
self
->
magic
==
IRCOMM_TTY_MAGIC
,
return
-
1
;);
ASSERT
(
self
->
magic
==
IRCOMM_TTY_MAGIC
,
return
-
1
;);
/*
A
lready open */
/*
Check if a
lready open */
if
(
self
->
flags
&
ASYNC_INITIALIZED
)
{
if
(
test_and_set_bit
(
ASYNC_B_INITIALIZED
,
&
self
->
flags
)
)
{
IRDA_DEBUG
(
2
,
"%s(), already open so break out!
\n
"
,
__FUNCTION__
);
IRDA_DEBUG
(
2
,
"%s(), already open so break out!
\n
"
,
__FUNCTION__
);
return
0
;
return
0
;
}
}
...
@@ -213,7 +213,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self)
...
@@ -213,7 +213,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self)
self
->
line
);
self
->
line
);
}
}
if
(
!
self
->
ircomm
)
if
(
!
self
->
ircomm
)
return
-
ENODEV
;
goto
err
;
self
->
slsap_sel
=
self
->
ircomm
->
slsap_sel
;
self
->
slsap_sel
=
self
->
ircomm
->
slsap_sel
;
...
@@ -221,12 +221,13 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self)
...
@@ -221,12 +221,13 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self)
ret
=
ircomm_tty_attach_cable
(
self
);
ret
=
ircomm_tty_attach_cable
(
self
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"%s(), error attaching cable!
\n
"
,
__FUNCTION__
);
ERROR
(
"%s(), error attaching cable!
\n
"
,
__FUNCTION__
);
return
ret
;
goto
err
;
}
}
self
->
flags
|=
ASYNC_INITIALIZED
;
return
0
;
return
0
;
err:
clear_bit
(
ASYNC_B_INITIALIZED
,
&
self
->
flags
);
return
ret
;
}
}
/*
/*
...
@@ -299,7 +300,8 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
...
@@ -299,7 +300,8 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
current
->
state
=
TASK_INTERRUPTIBLE
;
current
->
state
=
TASK_INTERRUPTIBLE
;
if
(
tty_hung_up_p
(
filp
)
||
!
(
self
->
flags
&
ASYNC_INITIALIZED
)){
if
(
tty_hung_up_p
(
filp
)
||
!
test_bit
(
ASYNC_B_INITIALIZED
,
&
self
->
flags
))
{
retval
=
(
self
->
flags
&
ASYNC_HUP_NOTIFY
)
?
retval
=
(
self
->
flags
&
ASYNC_HUP_NOTIFY
)
?
-
EAGAIN
:
-
ERESTARTSYS
;
-
EAGAIN
:
-
ERESTARTSYS
;
break
;
break
;
...
@@ -310,7 +312,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
...
@@ -310,7 +312,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
* specified, we cannot return before the IrCOMM link is
* specified, we cannot return before the IrCOMM link is
* ready
* ready
*/
*/
if
(
!
(
self
->
flags
&
ASYNC_CLOSING
)
&&
if
(
!
test_bit
(
ASYNC_B_CLOSING
,
&
self
->
flags
)
&&
(
do_clocal
||
(
self
->
settings
.
dce
&
IRCOMM_CD
))
&&
(
do_clocal
||
(
self
->
settings
.
dce
&
IRCOMM_CD
))
&&
self
->
state
==
IRCOMM_TTY_READY
)
self
->
state
==
IRCOMM_TTY_READY
)
{
{
...
@@ -425,7 +427,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
...
@@ -425,7 +427,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
* If the port is the middle of closing, bail out now
* If the port is the middle of closing, bail out now
*/
*/
if
(
tty_hung_up_p
(
filp
)
||
if
(
tty_hung_up_p
(
filp
)
||
(
self
->
flags
&
ASYNC_CLOSING
))
{
test_bit
(
ASYNC_B_CLOSING
,
&
self
->
flags
))
{
/* Hm, why are we blocking on ASYNC_CLOSING if we
/* Hm, why are we blocking on ASYNC_CLOSING if we
* do return -EAGAIN/-ERESTARTSYS below anyway?
* do return -EAGAIN/-ERESTARTSYS below anyway?
...
@@ -435,7 +437,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
...
@@ -435,7 +437,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
* probably better sleep uninterruptible?
* probably better sleep uninterruptible?
*/
*/
if
(
wait_event_interruptible
(
self
->
close_wait
,
!
(
self
->
flags
&
ASYNC_CLOSING
)))
{
if
(
wait_event_interruptible
(
self
->
close_wait
,
!
test_bit
(
ASYNC_B_CLOSING
,
&
self
->
flags
)))
{
WARNING
(
"%s - got signal while blocking on ASYNC_CLOSING!
\n
"
,
WARNING
(
"%s - got signal while blocking on ASYNC_CLOSING!
\n
"
,
__FUNCTION__
);
__FUNCTION__
);
return
-
ERESTARTSYS
;
return
-
ERESTARTSYS
;
...
@@ -530,11 +532,13 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
...
@@ -530,11 +532,13 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
IRDA_DEBUG
(
0
,
"%s(), open count > 0
\n
"
,
__FUNCTION__
);
IRDA_DEBUG
(
0
,
"%s(), open count > 0
\n
"
,
__FUNCTION__
);
return
;
return
;
}
}
self
->
flags
|=
ASYNC_CLOSING
;
/* Hum... Should be test_and_set_bit ??? - Jean II */
set_bit
(
ASYNC_B_CLOSING
,
&
self
->
flags
);
/* We need to unlock here (we were unlocking at the end of this
/* We need to unlock here (we were unlocking at the end of this
* function), because tty_wait_until_sent() may schedule.
* function), because tty_wait_until_sent() may schedule.
* I don't know if the rest should be
lock
ed somehow,
* I don't know if the rest should be
protect
ed somehow,
* so someone should check. - Jean II */
* so someone should check. - Jean II */
spin_unlock_irqrestore
(
&
self
->
spinlock
,
flags
);
spin_unlock_irqrestore
(
&
self
->
spinlock
,
flags
);
...
@@ -979,9 +983,11 @@ static void ircomm_tty_shutdown(struct ircomm_tty_cb *self)
...
@@ -979,9 +983,11 @@ static void ircomm_tty_shutdown(struct ircomm_tty_cb *self)
IRDA_DEBUG
(
0
,
"%s()
\n
"
,
__FUNCTION__
);
IRDA_DEBUG
(
0
,
"%s()
\n
"
,
__FUNCTION__
);
if
(
!
(
self
->
flags
&
ASYNC_INITIALIZED
))
if
(
!
test_and_clear_bit
(
ASYNC_B_INITIALIZED
,
&
self
->
flags
))
return
;
return
;
ircomm_tty_detach_cable
(
self
);
spin_lock_irqsave
(
&
self
->
spinlock
,
flags
);
spin_lock_irqsave
(
&
self
->
spinlock
,
flags
);
del_timer
(
&
self
->
watchdog_timer
);
del_timer
(
&
self
->
watchdog_timer
);
...
@@ -998,13 +1004,10 @@ static void ircomm_tty_shutdown(struct ircomm_tty_cb *self)
...
@@ -998,13 +1004,10 @@ static void ircomm_tty_shutdown(struct ircomm_tty_cb *self)
self
->
tx_skb
=
NULL
;
self
->
tx_skb
=
NULL
;
}
}
ircomm_tty_detach_cable
(
self
);
if
(
self
->
ircomm
)
{
if
(
self
->
ircomm
)
{
ircomm_close
(
self
->
ircomm
);
ircomm_close
(
self
->
ircomm
);
self
->
ircomm
=
NULL
;
self
->
ircomm
=
NULL
;
}
}
self
->
flags
&=
~
ASYNC_INITIALIZED
;
spin_unlock_irqrestore
(
&
self
->
spinlock
,
flags
);
spin_unlock_irqrestore
(
&
self
->
spinlock
,
flags
);
}
}
...
...
net/packet/af_packet.c
View file @
439f31ed
...
@@ -64,6 +64,7 @@
...
@@ -64,6 +64,7 @@
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/ioctls.h>
#include <asm/ioctls.h>
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/poll.h>
#include <linux/poll.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -1767,23 +1768,47 @@ static struct notifier_block packet_netdev_notifier = {
...
@@ -1767,23 +1768,47 @@ static struct notifier_block packet_netdev_notifier = {
};
};
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
static
int
packet_read_proc
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
static
inline
struct
sock
*
packet_seq_idx
(
loff_t
off
)
int
length
,
int
*
eof
,
void
*
data
)
{
{
off_t
pos
=
0
;
off_t
begin
=
0
;
int
len
=
0
;
struct
sock
*
s
;
struct
sock
*
s
;
struct
hlist_node
*
node
;
struct
hlist_node
*
node
;
len
+=
sprintf
(
buffer
,
"sk RefCnt Type Proto Iface R Rmem User Inode
\n
"
);
sk_for_each
(
s
,
node
,
&
packet_sklist
)
{
if
(
!
off
--
)
return
s
;
}
return
NULL
;
}
static
void
*
packet_seq_start
(
struct
seq_file
*
seq
,
loff_t
*
pos
)
{
read_lock
(
&
packet_sklist_lock
);
read_lock
(
&
packet_sklist_lock
);
return
*
pos
?
packet_seq_idx
(
*
pos
-
1
)
:
SEQ_START_TOKEN
;
}
sk_for_each
(
s
,
node
,
&
packet_sklist
)
{
static
void
*
packet_seq_next
(
struct
seq_file
*
seq
,
void
*
v
,
loff_t
*
pos
)
struct
packet_opt
*
po
=
pkt_sk
(
s
);
{
++*
pos
;
return
(
v
==
SEQ_START_TOKEN
)
?
sk_head
(
&
packet_sklist
)
:
sk_next
((
struct
sock
*
)
v
)
;
}
len
+=
sprintf
(
buffer
+
len
,
"%p %-6d %-4d %04x %-5d %1d %-6u %-6u %-6lu"
,
static
void
packet_seq_stop
(
struct
seq_file
*
seq
,
void
*
v
)
{
read_unlock
(
&
packet_sklist_lock
);
}
static
int
packet_seq_show
(
struct
seq_file
*
seq
,
void
*
v
)
{
if
(
v
==
SEQ_START_TOKEN
)
seq_puts
(
seq
,
"sk RefCnt Type Proto Iface R Rmem User Inode
\n
"
);
else
{
struct
sock
*
s
=
v
;
const
struct
packet_opt
*
po
=
pkt_sk
(
s
);
seq_printf
(
seq
,
"%p %-6d %-4d %04x %-5d %1d %-6u %-6u %-6lu
\n
"
,
s
,
s
,
atomic_read
(
&
s
->
sk_refcnt
),
atomic_read
(
&
s
->
sk_refcnt
),
s
->
sk_type
,
s
->
sk_type
,
...
@@ -1792,36 +1817,37 @@ static int packet_read_proc(char *buffer, char **start, off_t offset,
...
@@ -1792,36 +1817,37 @@ static int packet_read_proc(char *buffer, char **start, off_t offset,
po
->
running
,
po
->
running
,
atomic_read
(
&
s
->
sk_rmem_alloc
),
atomic_read
(
&
s
->
sk_rmem_alloc
),
sock_i_uid
(
s
),
sock_i_uid
(
s
),
sock_i_ino
(
s
)
sock_i_ino
(
s
)
);
);
}
buffer
[
len
++
]
=
'\n'
;
return
0
;
}
pos
=
begin
+
len
;
static
struct
seq_operations
packet_seq_ops
=
{
if
(
pos
<
offset
)
{
.
start
=
packet_seq_start
,
len
=
0
;
.
next
=
packet_seq_next
,
begin
=
pos
;
.
stop
=
packet_seq_stop
,
}
.
show
=
packet_seq_show
,
if
(
pos
>
offset
+
length
)
};
goto
done
;
}
*
eof
=
1
;
done:
static
int
packet_seq_open
(
struct
inode
*
inode
,
struct
file
*
file
)
read_unlock
(
&
packet_sklist_lock
);
{
*
start
=
buffer
+
(
offset
-
begin
);
return
seq_open
(
file
,
&
packet_seq_ops
);
len
-=
(
offset
-
begin
);
if
(
len
>
length
)
len
=
length
;
if
(
len
<
0
)
len
=
0
;
return
len
;
}
}
static
struct
file_operations
packet_seq_fops
=
{
.
owner
=
THIS_MODULE
,
.
open
=
packet_seq_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
seq_release
,
};
#endif
#endif
static
void
__exit
packet_exit
(
void
)
static
void
__exit
packet_exit
(
void
)
{
{
remove_proc_entry
(
"net/packet"
,
0
);
proc_net_remove
(
"packet"
);
unregister_netdevice_notifier
(
&
packet_netdev_notifier
);
unregister_netdevice_notifier
(
&
packet_netdev_notifier
);
sock_unregister
(
PF_PACKET
);
sock_unregister
(
PF_PACKET
);
return
;
return
;
...
@@ -1831,9 +1857,8 @@ static int __init packet_init(void)
...
@@ -1831,9 +1857,8 @@ static int __init packet_init(void)
{
{
sock_register
(
&
packet_family_ops
);
sock_register
(
&
packet_family_ops
);
register_netdevice_notifier
(
&
packet_netdev_notifier
);
register_netdevice_notifier
(
&
packet_netdev_notifier
);
#ifdef CONFIG_PROC_FS
proc_net_fops_create
(
"packet"
,
0
,
&
packet_seq_fops
);
create_proc_read_entry
(
"net/packet"
,
0
,
0
,
packet_read_proc
,
NULL
);
#endif
return
0
;
return
0
;
}
}
...
...
net/sched/sch_htb.c
View file @
439f31ed
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
#define HTB_HYSTERESIS 1
/* whether to use mode hysteresis for speedup */
#define HTB_HYSTERESIS 1
/* whether to use mode hysteresis for speedup */
#define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
#define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
#define HTB_QUNLOCK(S) spin_unlock_bh(&(S)->dev->queue_lock)
#define HTB_QUNLOCK(S) spin_unlock_bh(&(S)->dev->queue_lock)
#define HTB_VER 0x3000
e
/* major must be matched with number suplied by TC as version */
#define HTB_VER 0x3000
f
/* major must be matched with number suplied by TC as version */
#if HTB_VER >> 16 != TC_HTB_PROTOVER
#if HTB_VER >> 16 != TC_HTB_PROTOVER
#error "Mismatched sch_htb.c and pkt_sch.h"
#error "Mismatched sch_htb.c and pkt_sch.h"
...
@@ -308,7 +308,7 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch)
...
@@ -308,7 +308,7 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch)
rules in it */
rules in it */
if
(
skb
->
priority
==
sch
->
handle
)
if
(
skb
->
priority
==
sch
->
handle
)
return
HTB_DIRECT
;
/* X:0 (direct flow) selected */
return
HTB_DIRECT
;
/* X:0 (direct flow) selected */
if
((
cl
=
htb_find
(
skb
->
priority
,
sch
))
!=
NULL
)
if
((
cl
=
htb_find
(
skb
->
priority
,
sch
))
!=
NULL
&&
cl
->
level
==
0
)
return
cl
;
return
cl
;
tcf
=
q
->
filter_list
;
tcf
=
q
->
filter_list
;
...
...
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