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
808c8a58
Commit
808c8a58
authored
Apr 10, 2003
by
James Simmons
Browse files
Options
Browse Files
Download
Plain Diff
Merge kozmo.(none):/usr/src/linus-2.5
into kozmo.(none):/usr/src/fbdev-2.5
parents
470d3cc3
8f44c5c2
Changes
43
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
2136 additions
and
179 deletions
+2136
-179
arch/sparc/kernel/sparc_ksyms.c
arch/sparc/kernel/sparc_ksyms.c
+1
-0
fs/nfs/dir.c
fs/nfs/dir.c
+3
-2
fs/select.c
fs/select.c
+2
-2
include/linux/if_bridge.h
include/linux/if_bridge.h
+1
-1
include/linux/igmp.h
include/linux/igmp.h
+96
-2
include/linux/in.h
include/linux/in.h
+26
-0
include/linux/inetdevice.h
include/linux/inetdevice.h
+10
-0
include/linux/poll.h
include/linux/poll.h
+2
-2
include/net/ip.h
include/net/ip.h
+1
-0
include/net/ip6_fib.h
include/net/ip6_fib.h
+8
-3
include/net/ip6_route.h
include/net/ip6_route.h
+4
-2
kernel/timer.c
kernel/timer.c
+1
-1
net/bridge/br.c
net/bridge/br.c
+4
-9
net/bridge/br_if.c
net/bridge/br_if.c
+18
-5
net/bridge/br_ioctl.c
net/bridge/br_ioctl.c
+18
-16
net/bridge/br_notify.c
net/bridge/br_notify.c
+17
-16
net/core/dev.c
net/core/dev.c
+5
-4
net/ipv4/Kconfig
net/ipv4/Kconfig
+8
-0
net/ipv4/Makefile
net/ipv4/Makefile
+1
-0
net/ipv4/igmp.c
net/ipv4/igmp.c
+1338
-37
net/ipv4/ip_output.c
net/ipv4/ip_output.c
+1
-0
net/ipv4/ip_sockglue.c
net/ipv4/ip_sockglue.c
+74
-2
net/ipv4/ipcomp.c
net/ipv4/ipcomp.c
+366
-0
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_core.c
+5
-0
net/ipv4/route.c
net/ipv4/route.c
+3
-2
net/ipv4/udp.c
net/ipv4/udp.c
+2
-0
net/ipv4/xfrm4_input.c
net/ipv4/xfrm4_input.c
+3
-0
net/ipv4/xfrm4_policy.c
net/ipv4/xfrm4_policy.c
+7
-0
net/ipv6/addrconf.c
net/ipv6/addrconf.c
+5
-5
net/ipv6/ip6_fib.c
net/ipv6/ip6_fib.c
+11
-9
net/ipv6/ndisc.c
net/ipv6/ndisc.c
+2
-2
net/ipv6/route.c
net/ipv6/route.c
+40
-27
net/ipv6/xfrm6_input.c
net/ipv6/xfrm6_input.c
+3
-0
net/ipv6/xfrm6_policy.c
net/ipv6/xfrm6_policy.c
+1
-0
net/netsyms.c
net/netsyms.c
+1
-1
net/sched/sch_csz.c
net/sched/sch_csz.c
+8
-0
net/sched/sch_htb.c
net/sched/sch_htb.c
+2
-0
net/sched/sch_prio.c
net/sched/sch_prio.c
+6
-0
net/socket.c
net/socket.c
+18
-2
sound/core/ioctl32/pcm32.c
sound/core/ioctl32/pcm32.c
+5
-9
sound/core/ioctl32/rawmidi32.c
sound/core/ioctl32/rawmidi32.c
+3
-7
sound/core/ioctl32/timer32.c
sound/core/ioctl32/timer32.c
+4
-9
sound/core/memalloc.c
sound/core/memalloc.c
+2
-2
No files found.
arch/sparc/kernel/sparc_ksyms.c
View file @
808c8a58
...
@@ -127,6 +127,7 @@ EXPORT_SYMBOL(__down_trylock);
...
@@ -127,6 +127,7 @@ EXPORT_SYMBOL(__down_trylock);
EXPORT_SYMBOL
(
__down_interruptible
);
EXPORT_SYMBOL
(
__down_interruptible
);
EXPORT_SYMBOL
(
sparc_valid_addr_bitmap
);
EXPORT_SYMBOL
(
sparc_valid_addr_bitmap
);
EXPORT_SYMBOL
(
phys_base
);
/* Atomic operations. */
/* Atomic operations. */
EXPORT_SYMBOL_PRIVATE
(
_atomic_add
);
EXPORT_SYMBOL_PRIVATE
(
_atomic_add
);
...
...
fs/nfs/dir.c
View file @
808c8a58
...
@@ -736,9 +736,10 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry,
...
@@ -736,9 +736,10 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry,
res
=
-
EIO
;
res
=
-
EIO
;
if
(
PageUptodate
(
page
))
{
if
(
PageUptodate
(
page
))
{
desc
.
ptr
=
kmap_atomic
(
page
,
KM_USER0
);
void
*
kaddr
=
kmap_atomic
(
page
,
KM_USER0
);
desc
.
ptr
=
kaddr
;
res
=
find_dirent_name
(
&
desc
,
page
,
dentry
);
res
=
find_dirent_name
(
&
desc
,
page
,
dentry
);
kunmap_atomic
(
desc
.
pt
r
,
KM_USER0
);
kunmap_atomic
(
kadd
r
,
KM_USER0
);
}
}
page_cache_release
(
page
);
page_cache_release
(
page
);
...
...
fs/select.c
View file @
808c8a58
...
@@ -268,7 +268,7 @@ static void select_bits_free(void *bits, int size)
...
@@ -268,7 +268,7 @@ static void select_bits_free(void *bits, int size)
((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
asmlinkage
long
asmlinkage
long
sys_select
(
int
n
,
fd_set
*
inp
,
fd_set
*
outp
,
fd_set
*
exp
,
struct
timeval
*
tvp
)
sys_select
(
int
n
,
fd_set
__user
*
inp
,
fd_set
__user
*
outp
,
fd_set
__user
*
exp
,
struct
timeval
__user
*
tvp
)
{
{
fd_set_bits
fds
;
fd_set_bits
fds
;
char
*
bits
;
char
*
bits
;
...
@@ -429,7 +429,7 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
...
@@ -429,7 +429,7 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
return
count
;
return
count
;
}
}
asmlinkage
long
sys_poll
(
struct
pollfd
*
ufds
,
unsigned
int
nfds
,
long
timeout
)
asmlinkage
long
sys_poll
(
struct
pollfd
__user
*
ufds
,
unsigned
int
nfds
,
long
timeout
)
{
{
struct
poll_wqueues
table
;
struct
poll_wqueues
table
;
int
fdcount
,
err
;
int
fdcount
,
err
;
...
...
include/linux/if_bridge.h
View file @
808c8a58
...
@@ -101,7 +101,7 @@ struct __fdb_entry
...
@@ -101,7 +101,7 @@ struct __fdb_entry
struct
net_bridge
;
struct
net_bridge
;
struct
net_bridge_port
;
struct
net_bridge_port
;
extern
int
(
*
br_ioctl_hook
)(
unsigned
long
arg
);
extern
void
brioctl_set
(
int
(
*
ioctl_hook
)(
unsigned
long
)
);
extern
int
(
*
br_handle_frame_hook
)(
struct
sk_buff
*
skb
);
extern
int
(
*
br_handle_frame_hook
)(
struct
sk_buff
*
skb
);
extern
int
(
*
br_should_route_hook
)(
struct
sk_buff
**
pskb
);
extern
int
(
*
br_should_route_hook
)(
struct
sk_buff
**
pskb
);
...
...
include/linux/igmp.h
View file @
808c8a58
...
@@ -32,13 +32,60 @@ struct igmphdr
...
@@ -32,13 +32,60 @@ struct igmphdr
__u32
group
;
__u32
group
;
};
};
/* V3 group record types [grec_type] */
#define IGMPV3_MODE_IS_INCLUDE 1
#define IGMPV3_MODE_IS_EXCLUDE 2
#define IGMPV3_CHANGE_TO_INCLUDE 3
#define IGMPV3_CHANGE_TO_EXCLUDE 4
#define IGMPV3_ALLOW_NEW_SOURCES 5
#define IGMPV3_BLOCK_OLD_SOURCES 6
struct
igmpv3_grec
{
__u8
grec_type
;
__u8
grec_auxwords
;
__u16
grec_nsrcs
;
__u32
grec_mca
;
__u32
grec_src
[
0
];
};
struct
igmpv3_report
{
__u8
type
;
__u8
resv1
;
__u16
csum
;
__u16
resv2
;
__u16
ngrec
;
struct
igmpv3_grec
grec
[
0
];
};
struct
igmpv3_query
{
__u8
type
;
__u8
code
;
__u16
csum
;
__u32
group
;
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8
qrv
:
3
,
suppress:
1
,
resv:
4
;
#elif defined(__BIG_ENDIAN_BITFIELD)
__u8
resv
:
4
,
suppress:
1
,
qrv:
3
;
#else
#error "Please fix <asm/byteorder.h>"
#endif
__u8
qqic
;
__u16
nsrcs
;
__u32
srcs
[
0
];
};
#define IGMP_HOST_MEMBERSHIP_QUERY 0x11
/* From RFC1112 */
#define IGMP_HOST_MEMBERSHIP_QUERY 0x11
/* From RFC1112 */
#define IGMP_HOST_MEMBERSHIP_REPORT 0x12
/* Ditto */
#define IGMP_HOST_MEMBERSHIP_REPORT 0x12
/* Ditto */
#define IGMP_DVMRP 0x13
/* DVMRP routing */
#define IGMP_DVMRP 0x13
/* DVMRP routing */
#define IGMP_PIM 0x14
/* PIM routing */
#define IGMP_PIM 0x14
/* PIM routing */
#define IGMP_TRACE 0x15
#define IGMP_TRACE 0x15
#define IGMP
_HOST_NEW_MEMBERSHIP_REPORT 0x16
/* New
version of 0x11 */
#define IGMP
V2_HOST_MEMBERSHIP_REPORT 0x16
/* V2
version of 0x11 */
#define IGMP_HOST_LEAVE_MESSAGE 0x17
#define IGMP_HOST_LEAVE_MESSAGE 0x17
#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22
/* V3 version of 0x11 */
#define IGMP_MTRACE_RESP 0x1e
#define IGMP_MTRACE_RESP 0x1e
#define IGMP_MTRACE 0x1f
#define IGMP_MTRACE 0x1f
...
@@ -68,6 +115,7 @@ struct igmphdr
...
@@ -68,6 +115,7 @@ struct igmphdr
#define IGMP_ALL_HOSTS htonl(0xE0000001L)
#define IGMP_ALL_HOSTS htonl(0xE0000001L)
#define IGMP_ALL_ROUTER htonl(0xE0000002L)
#define IGMP_ALL_ROUTER htonl(0xE0000002L)
#define IGMPV3_ALL_MCR htonl(0xE0000016L)
#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
#define IGMP_LOCAL_GROUP htonl(0xE0000000L)
#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
#define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L)
...
@@ -79,6 +127,18 @@ struct igmphdr
...
@@ -79,6 +127,18 @@ struct igmphdr
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/in.h>
#include <linux/in.h>
struct
ip_sf_socklist
{
unsigned
int
sl_max
;
unsigned
int
sl_count
;
__u32
sl_addr
[
0
];
};
#define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \
(count) * sizeof(__u32))
#define IP_SFBLOCK 10
/* allocate this many at once */
/* ip_mc_socklist is real list now. Speed is not argument;
/* ip_mc_socklist is real list now. Speed is not argument;
this list never used in fast path code
this list never used in fast path code
*/
*/
...
@@ -88,12 +148,28 @@ struct ip_mc_socklist
...
@@ -88,12 +148,28 @@ struct ip_mc_socklist
struct
ip_mc_socklist
*
next
;
struct
ip_mc_socklist
*
next
;
int
count
;
int
count
;
struct
ip_mreqn
multi
;
struct
ip_mreqn
multi
;
unsigned
int
sfmode
;
/* MCAST_{INCLUDE,EXCLUDE} */
struct
ip_sf_socklist
*
sflist
;
};
struct
ip_sf_list
{
struct
ip_sf_list
*
sf_next
;
__u32
sf_inaddr
;
unsigned
long
sf_count
[
2
];
/* include/exclude counts */
unsigned
char
sf_gsresp
;
/* include in g & s response? */
unsigned
char
sf_oldin
;
/* change state */
unsigned
char
sf_crcount
;
/* retrans. left to send */
};
};
struct
ip_mc_list
struct
ip_mc_list
{
{
struct
in_device
*
interface
;
struct
in_device
*
interface
;
unsigned
long
multiaddr
;
unsigned
long
multiaddr
;
struct
ip_sf_list
*
sources
;
struct
ip_sf_list
*
tomb
;
unsigned
int
sfmode
;
unsigned
long
sfcount
[
2
];
struct
ip_mc_list
*
next
;
struct
ip_mc_list
*
next
;
struct
timer_list
timer
;
struct
timer_list
timer
;
int
users
;
int
users
;
...
@@ -103,13 +179,31 @@ struct ip_mc_list
...
@@ -103,13 +179,31 @@ struct ip_mc_list
char
reporter
;
char
reporter
;
char
unsolicit_count
;
char
unsolicit_count
;
char
loaded
;
char
loaded
;
unsigned
char
gsquery
;
/* check source marks? */
unsigned
char
crcount
;
};
};
extern
int
ip_check_mc
(
struct
in_device
*
dev
,
u32
mc_addr
);
/* V3 exponential field decoding */
#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
((value) < (thresh) ? (value) : \
((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \
(IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
#define IGMPV3_MRC(value) IGMPV3_EXP(0x8000, 12, 3, value)
extern
int
ip_check_mc
(
struct
in_device
*
dev
,
u32
mc_addr
,
u32
src_addr
,
u16
proto
);
extern
int
igmp_rcv
(
struct
sk_buff
*
);
extern
int
igmp_rcv
(
struct
sk_buff
*
);
extern
int
ip_mc_join_group
(
struct
sock
*
sk
,
struct
ip_mreqn
*
imr
);
extern
int
ip_mc_join_group
(
struct
sock
*
sk
,
struct
ip_mreqn
*
imr
);
extern
int
ip_mc_leave_group
(
struct
sock
*
sk
,
struct
ip_mreqn
*
imr
);
extern
int
ip_mc_leave_group
(
struct
sock
*
sk
,
struct
ip_mreqn
*
imr
);
extern
void
ip_mc_drop_socket
(
struct
sock
*
sk
);
extern
void
ip_mc_drop_socket
(
struct
sock
*
sk
);
extern
int
ip_mc_source
(
int
add
,
int
omode
,
struct
sock
*
sk
,
struct
ip_mreq_source
*
mreqs
);
extern
int
ip_mc_msfilter
(
struct
sock
*
sk
,
struct
ip_msfilter
*
msf
);
extern
int
ip_mc_msfget
(
struct
sock
*
sk
,
struct
ip_msfilter
*
msf
,
struct
ip_msfilter
*
optval
,
int
*
optlen
);
extern
int
ip_mc_sf_allow
(
struct
sock
*
sk
,
u32
local
,
u32
rmt
,
int
dif
);
extern
void
ip_mr_init
(
void
);
extern
void
ip_mr_init
(
void
);
extern
void
ip_mc_init_dev
(
struct
in_device
*
);
extern
void
ip_mc_init_dev
(
struct
in_device
*
);
extern
void
ip_mc_destroy_dev
(
struct
in_device
*
);
extern
void
ip_mc_destroy_dev
(
struct
in_device
*
);
...
...
include/linux/in.h
View file @
808c8a58
...
@@ -85,6 +85,14 @@ struct in_addr {
...
@@ -85,6 +85,14 @@ struct in_addr {
#define IP_MULTICAST_LOOP 34
#define IP_MULTICAST_LOOP 34
#define IP_ADD_MEMBERSHIP 35
#define IP_ADD_MEMBERSHIP 35
#define IP_DROP_MEMBERSHIP 36
#define IP_DROP_MEMBERSHIP 36
#define IP_UNBLOCK_SOURCE 37
#define IP_BLOCK_SOURCE 38
#define IP_ADD_SOURCE_MEMBERSHIP 39
#define IP_DROP_SOURCE_MEMBERSHIP 40
#define IP_MSFILTER 41
#define MCAST_EXCLUDE 0
#define MCAST_INCLUDE 1
/* These need to appear somewhere around here */
/* These need to appear somewhere around here */
#define IP_DEFAULT_MULTICAST_TTL 1
#define IP_DEFAULT_MULTICAST_TTL 1
...
@@ -105,6 +113,24 @@ struct ip_mreqn
...
@@ -105,6 +113,24 @@ struct ip_mreqn
int
imr_ifindex
;
/* Interface index */
int
imr_ifindex
;
/* Interface index */
};
};
struct
ip_mreq_source
{
__u32
imr_multiaddr
;
__u32
imr_interface
;
__u32
imr_sourceaddr
;
};
struct
ip_msfilter
{
__u32
imsf_multiaddr
;
__u32
imsf_interface
;
__u32
imsf_fmode
;
__u32
imsf_numsrc
;
__u32
imsf_slist
[
1
];
};
#define IP_MSFILTER_SIZE(numsrc) \
(sizeof(struct ip_msfilter) - sizeof(__u32) \
+ (numsrc) * sizeof(__u32))
struct
in_pktinfo
struct
in_pktinfo
{
{
int
ipi_ifindex
;
int
ipi_ifindex
;
...
...
include/linux/inetdevice.h
View file @
808c8a58
...
@@ -34,7 +34,17 @@ struct in_device
...
@@ -34,7 +34,17 @@ struct in_device
int
dead
;
int
dead
;
struct
in_ifaddr
*
ifa_list
;
/* IP ifaddr chain */
struct
in_ifaddr
*
ifa_list
;
/* IP ifaddr chain */
struct
ip_mc_list
*
mc_list
;
/* IP multicast filter chain */
struct
ip_mc_list
*
mc_list
;
/* IP multicast filter chain */
rwlock_t
mc_lock
;
/* for mc_tomb */
struct
ip_mc_list
*
mc_tomb
;
unsigned
long
mr_v1_seen
;
unsigned
long
mr_v1_seen
;
unsigned
long
mr_v2_seen
;
unsigned
long
mr_maxdelay
;
unsigned
char
mr_qrv
;
unsigned
char
mr_gq_running
;
unsigned
char
mr_ifc_count
;
struct
timer_list
mr_gq_timer
;
/* general query timer */
struct
timer_list
mr_ifc_timer
;
/* interface change timer */
struct
neigh_parms
*
arp_parms
;
struct
neigh_parms
*
arp_parms
;
struct
ipv4_devconf
cnf
;
struct
ipv4_devconf
cnf
;
};
};
...
...
include/linux/poll.h
View file @
808c8a58
...
@@ -67,7 +67,7 @@ typedef struct {
...
@@ -67,7 +67,7 @@ typedef struct {
* Use "unsigned long" accesses to let user-mode fd_set's be long-aligned.
* Use "unsigned long" accesses to let user-mode fd_set's be long-aligned.
*/
*/
static
inline
static
inline
int
get_fd_set
(
unsigned
long
nr
,
void
*
ufdset
,
unsigned
long
*
fdset
)
int
get_fd_set
(
unsigned
long
nr
,
void
__user
*
ufdset
,
unsigned
long
*
fdset
)
{
{
nr
=
FDS_BYTES
(
nr
);
nr
=
FDS_BYTES
(
nr
);
if
(
ufdset
)
{
if
(
ufdset
)
{
...
@@ -82,7 +82,7 @@ int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset)
...
@@ -82,7 +82,7 @@ int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset)
}
}
static
inline
static
inline
void
set_fd_set
(
unsigned
long
nr
,
void
*
ufdset
,
unsigned
long
*
fdset
)
void
set_fd_set
(
unsigned
long
nr
,
void
__user
*
ufdset
,
unsigned
long
*
fdset
)
{
{
if
(
ufdset
)
if
(
ufdset
)
__copy_to_user
(
ufdset
,
fdset
,
FDS_BYTES
(
nr
));
__copy_to_user
(
ufdset
,
fdset
,
FDS_BYTES
(
nr
));
...
...
include/net/ip.h
View file @
808c8a58
...
@@ -79,6 +79,7 @@ extern rwlock_t ip_ra_lock;
...
@@ -79,6 +79,7 @@ extern rwlock_t ip_ra_lock;
extern
void
ip_mc_dropsocket
(
struct
sock
*
);
extern
void
ip_mc_dropsocket
(
struct
sock
*
);
extern
void
ip_mc_dropdevice
(
struct
net_device
*
dev
);
extern
void
ip_mc_dropdevice
(
struct
net_device
*
dev
);
extern
int
ip_mc_procinfo
(
char
*
,
char
**
,
off_t
,
int
);
extern
int
ip_mc_procinfo
(
char
*
,
char
**
,
off_t
,
int
);
extern
int
ip_mcf_procinfo
(
char
*
,
char
**
,
off_t
,
int
);
/*
/*
* Functions provided by ip.c
* Functions provided by ip.c
...
...
include/net/ip6_fib.h
View file @
808c8a58
...
@@ -72,6 +72,8 @@ struct rt6_info
...
@@ -72,6 +72,8 @@ struct rt6_info
struct
rt6key
rt6i_dst
;
struct
rt6key
rt6i_dst
;
struct
rt6key
rt6i_src
;
struct
rt6key
rt6i_src
;
u8
rt6i_protocol
;
};
};
struct
fib6_walker_t
struct
fib6_walker_t
...
@@ -160,11 +162,14 @@ extern int fib6_walk(struct fib6_walker_t *w);
...
@@ -160,11 +162,14 @@ extern int fib6_walk(struct fib6_walker_t *w);
extern
int
fib6_walk_continue
(
struct
fib6_walker_t
*
w
);
extern
int
fib6_walk_continue
(
struct
fib6_walker_t
*
w
);
extern
int
fib6_add
(
struct
fib6_node
*
root
,
extern
int
fib6_add
(
struct
fib6_node
*
root
,
struct
rt6_info
*
rt
);
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
);
extern
int
fib6_del
(
struct
rt6_info
*
rt
);
extern
int
fib6_del
(
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
);
extern
void
inet6_rt_notify
(
int
event
,
struct
rt6_info
*
rt
);
extern
void
inet6_rt_notify
(
int
event
,
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
);
extern
void
fib6_run_gc
(
unsigned
long
dummy
);
extern
void
fib6_run_gc
(
unsigned
long
dummy
);
...
...
include/net/ip6_route.h
View file @
808c8a58
...
@@ -37,8 +37,10 @@ extern void ip6_route_cleanup(void);
...
@@ -37,8 +37,10 @@ extern void ip6_route_cleanup(void);
extern
int
ipv6_route_ioctl
(
unsigned
int
cmd
,
void
*
arg
);
extern
int
ipv6_route_ioctl
(
unsigned
int
cmd
,
void
*
arg
);
extern
int
ip6_route_add
(
struct
in6_rtmsg
*
rtmsg
);
extern
int
ip6_route_add
(
struct
in6_rtmsg
*
rtmsg
,
extern
int
ip6_del_rt
(
struct
rt6_info
*
);
struct
nlmsghdr
*
);
extern
int
ip6_del_rt
(
struct
rt6_info
*
,
struct
nlmsghdr
*
);
extern
int
ip6_rt_addr_add
(
struct
in6_addr
*
addr
,
extern
int
ip6_rt_addr_add
(
struct
in6_addr
*
addr
,
struct
net_device
*
dev
);
struct
net_device
*
dev
);
...
...
kernel/timer.c
View file @
808c8a58
...
@@ -1091,7 +1091,7 @@ asmlinkage long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp)
...
@@ -1091,7 +1091,7 @@ asmlinkage long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp)
/*
/*
* sys_sysinfo - fill in sysinfo struct
* sys_sysinfo - fill in sysinfo struct
*/
*/
asmlinkage
long
sys_sysinfo
(
struct
sysinfo
*
info
)
asmlinkage
long
sys_sysinfo
(
struct
sysinfo
__user
*
info
)
{
{
struct
sysinfo
val
;
struct
sysinfo
val
;
u64
uptime
;
u64
uptime
;
...
...
net/bridge/br.c
View file @
808c8a58
...
@@ -49,8 +49,9 @@ static int __init br_init(void)
...
@@ -49,8 +49,9 @@ static int __init br_init(void)
if
(
br_netfilter_init
())
if
(
br_netfilter_init
())
return
1
;
return
1
;
#endif
#endif
brioctl_set
(
br_ioctl_deviceless_stub
);
br_handle_frame_hook
=
br_handle_frame
;
br_handle_frame_hook
=
br_handle_frame
;
br_ioctl_hook
=
br_ioctl_deviceless_stub
;
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
br_fdb_get_hook
=
br_fdb_get
;
br_fdb_get_hook
=
br_fdb_get
;
br_fdb_put_hook
=
br_fdb_put
;
br_fdb_put_hook
=
br_fdb_put
;
...
@@ -60,24 +61,18 @@ static int __init br_init(void)
...
@@ -60,24 +61,18 @@ static int __init br_init(void)
return
0
;
return
0
;
}
}
static
void
__br_clear_ioctl_hook
(
void
)
{
br_ioctl_hook
=
NULL
;
}
static
void
__exit
br_deinit
(
void
)
static
void
__exit
br_deinit
(
void
)
{
{
#ifdef CONFIG_NETFILTER
#ifdef CONFIG_NETFILTER
br_netfilter_fini
();
br_netfilter_fini
();
#endif
#endif
unregister_netdevice_notifier
(
&
br_device_notifier
);
unregister_netdevice_notifier
(
&
br_device_notifier
);
br_call_ioctl_atomic
(
__br_clear_ioctl_hook
);
br
_write_lock_bh
(
BR_NETPROTO_LOCK
);
br
ioctl_set
(
NULL
);
br_handle_frame_hook
=
NULL
;
br_handle_frame_hook
=
NULL
;
br_write_unlock_bh
(
BR_NETPROTO_LOCK
);
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
/* FIX ME. move into hook structure with ref count */
br_fdb_get_hook
=
NULL
;
br_fdb_get_hook
=
NULL
;
br_fdb_put_hook
=
NULL
;
br_fdb_put_hook
=
NULL
;
#endif
#endif
...
...
net/bridge/br_if.c
View file @
808c8a58
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "br_private.h"
#include "br_private.h"
static
struct
net_bridge
*
bridge_list
;
static
struct
net_bridge
*
bridge_list
;
static
spinlock_t
bridge_lock
=
SPIN_LOCK_UNLOCKED
;
static
int
br_initial_port_cost
(
struct
net_device
*
dev
)
static
int
br_initial_port_cost
(
struct
net_device
*
dev
)
{
{
...
@@ -69,6 +70,7 @@ static int __br_del_if(struct net_bridge *br, struct net_device *dev)
...
@@ -69,6 +70,7 @@ static int __br_del_if(struct net_bridge *br, struct net_device *dev)
return
0
;
return
0
;
}
}
/* called with bridge_lock */
static
struct
net_bridge
**
__find_br
(
char
*
name
)
static
struct
net_bridge
**
__find_br
(
char
*
name
)
{
{
struct
net_bridge
**
b
;
struct
net_bridge
**
b
;
...
@@ -188,8 +190,10 @@ int br_add_bridge(char *name)
...
@@ -188,8 +190,10 @@ int br_add_bridge(char *name)
return
-
EEXIST
;
return
-
EEXIST
;
}
}
spin_lock
(
&
bridge_lock
);
br
->
next
=
bridge_list
;
br
->
next
=
bridge_list
;
bridge_list
=
br
;
bridge_list
=
br
;
spin_unlock
(
&
bridge_lock
);
br_inc_use_count
();
br_inc_use_count
();
register_netdev
(
&
br
->
dev
);
register_netdev
(
&
br
->
dev
);
...
@@ -202,17 +206,22 @@ int br_del_bridge(char *name)
...
@@ -202,17 +206,22 @@ int br_del_bridge(char *name)
struct
net_bridge
**
b
;
struct
net_bridge
**
b
;
struct
net_bridge
*
br
;
struct
net_bridge
*
br
;
if
((
b
=
__find_br
(
name
))
==
NULL
)
spin_lock
(
&
bridge_lock
);
if
((
b
=
__find_br
(
name
))
==
NULL
)
{
spin_unlock
(
&
bridge_lock
);
return
-
ENXIO
;
return
-
ENXIO
;
}
br
=
*
b
;
br
=
*
b
;
if
(
br
->
dev
.
flags
&
IFF_UP
)
{
if
(
br
->
dev
.
flags
&
IFF_UP
)
spin_unlock
(
&
bridge_lock
);
return
-
EBUSY
;
return
-
EBUSY
;
}
del_ifs
(
br
);
*
b
=
br
->
next
;
*
b
=
br
->
next
;
spin_unlock
(
&
bridge_lock
);
del_ifs
(
br
);
unregister_netdev
(
&
br
->
dev
);
unregister_netdev
(
&
br
->
dev
);
kfree
(
br
);
kfree
(
br
);
...
@@ -272,6 +281,7 @@ int br_get_bridge_ifindices(int *indices, int num)
...
@@ -272,6 +281,7 @@ int br_get_bridge_ifindices(int *indices, int num)
struct
net_bridge
*
br
;
struct
net_bridge
*
br
;
int
i
;
int
i
;
spin_lock
(
&
bridge_lock
);
br
=
bridge_list
;
br
=
bridge_list
;
for
(
i
=
0
;
i
<
num
;
i
++
)
{
for
(
i
=
0
;
i
<
num
;
i
++
)
{
if
(
br
==
NULL
)
if
(
br
==
NULL
)
...
@@ -280,6 +290,7 @@ int br_get_bridge_ifindices(int *indices, int num)
...
@@ -280,6 +290,7 @@ int br_get_bridge_ifindices(int *indices, int num)
indices
[
i
]
=
br
->
dev
.
ifindex
;
indices
[
i
]
=
br
->
dev
.
ifindex
;
br
=
br
->
next
;
br
=
br
->
next
;
}
}
spin_unlock
(
&
bridge_lock
);
return
i
;
return
i
;
}
}
...
@@ -289,9 +300,11 @@ void br_get_port_ifindices(struct net_bridge *br, int *ifindices)
...
@@ -289,9 +300,11 @@ void br_get_port_ifindices(struct net_bridge *br, int *ifindices)
{
{
struct
net_bridge_port
*
p
;
struct
net_bridge_port
*
p
;
read_lock
(
&
br
->
lock
);
p
=
br
->
port_list
;
p
=
br
->
port_list
;
while
(
p
!=
NULL
)
{
while
(
p
!=
NULL
)
{
ifindices
[
p
->
port_no
]
=
p
->
dev
->
ifindex
;
ifindices
[
p
->
port_no
]
=
p
->
dev
->
ifindex
;
p
=
p
->
next
;
p
=
p
->
next
;
}
}
read_unlock
(
&
br
->
lock
);
}
}
net/bridge/br_ioctl.c
View file @
808c8a58
...
@@ -53,6 +53,7 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -53,6 +53,7 @@ static int br_ioctl_device(struct net_bridge *br,
{
{
struct
__bridge_info
b
;
struct
__bridge_info
b
;
read_lock
(
&
br
->
lock
);
memset
(
&
b
,
0
,
sizeof
(
struct
__bridge_info
));
memset
(
&
b
,
0
,
sizeof
(
struct
__bridge_info
));
memcpy
(
&
b
.
designated_root
,
&
br
->
designated_root
,
8
);
memcpy
(
&
b
.
designated_root
,
&
br
->
designated_root
,
8
);
memcpy
(
&
b
.
bridge_id
,
&
br
->
bridge_id
,
8
);
memcpy
(
&
b
.
bridge_id
,
&
br
->
bridge_id
,
8
);
...
@@ -73,6 +74,7 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -73,6 +74,7 @@ static int br_ioctl_device(struct net_bridge *br,
b
.
tcn_timer_value
=
br_timer_get_residue
(
&
br
->
tcn_timer
);
b
.
tcn_timer_value
=
br_timer_get_residue
(
&
br
->
tcn_timer
);
b
.
topology_change_timer_value
=
br_timer_get_residue
(
&
br
->
topology_change_timer
);
b
.
topology_change_timer_value
=
br_timer_get_residue
(
&
br
->
topology_change_timer
);
b
.
gc_timer_value
=
br_timer_get_residue
(
&
br
->
gc_timer
);
b
.
gc_timer_value
=
br_timer_get_residue
(
&
br
->
gc_timer
);
read_unlock
(
&
br
->
lock
);
if
(
copy_to_user
((
void
*
)
arg0
,
&
b
,
sizeof
(
b
)))
if
(
copy_to_user
((
void
*
)
arg0
,
&
b
,
sizeof
(
b
)))
return
-
EFAULT
;
return
-
EFAULT
;
...
@@ -96,21 +98,27 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -96,21 +98,27 @@ static int br_ioctl_device(struct net_bridge *br,
}
}
case
BRCTL_SET_BRIDGE_FORWARD_DELAY
:
case
BRCTL_SET_BRIDGE_FORWARD_DELAY
:
write_lock
(
&
br
->
lock
);
br
->
bridge_forward_delay
=
arg0
;
br
->
bridge_forward_delay
=
arg0
;
if
(
br_is_root_bridge
(
br
))
if
(
br_is_root_bridge
(
br
))
br
->
forward_delay
=
arg0
;
br
->
forward_delay
=
arg0
;
write_unlock
(
&
br
->
lock
);
return
0
;
return
0
;
case
BRCTL_SET_BRIDGE_HELLO_TIME
:
case
BRCTL_SET_BRIDGE_HELLO_TIME
:
write_lock
(
&
br
->
lock
);
br
->
bridge_hello_time
=
arg0
;
br
->
bridge_hello_time
=
arg0
;
if
(
br_is_root_bridge
(
br
))
if
(
br_is_root_bridge
(
br
))
br
->
hello_time
=
arg0
;
br
->
hello_time
=
arg0
;
write_unlock
(
&
br
->
lock
);
return
0
;
return
0
;
case
BRCTL_SET_BRIDGE_MAX_AGE
:
case
BRCTL_SET_BRIDGE_MAX_AGE
:
write_lock
(
&
br
->
lock
);
br
->
bridge_max_age
=
arg0
;
br
->
bridge_max_age
=
arg0
;
if
(
br_is_root_bridge
(
br
))
if
(
br_is_root_bridge
(
br
))
br
->
max_age
=
arg0
;
br
->
max_age
=
arg0
;
write_unlock
(
&
br
->
lock
);
return
0
;
return
0
;
case
BRCTL_SET_AGEING_TIME
:
case
BRCTL_SET_AGEING_TIME
:
...
@@ -126,6 +134,7 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -126,6 +134,7 @@ static int br_ioctl_device(struct net_bridge *br,
struct
__port_info
p
;
struct
__port_info
p
;
struct
net_bridge_port
*
pt
;
struct
net_bridge_port
*
pt
;
read_lock
(
&
br
->
lock
);
if
((
pt
=
br_get_port
(
br
,
arg1
))
==
NULL
)
if
((
pt
=
br_get_port
(
br
,
arg1
))
==
NULL
)
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -143,6 +152,8 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -143,6 +152,8 @@ static int br_ioctl_device(struct net_bridge *br,
p
.
forward_delay_timer_value
=
br_timer_get_residue
(
&
pt
->
forward_delay_timer
);
p
.
forward_delay_timer_value
=
br_timer_get_residue
(
&
pt
->
forward_delay_timer
);
p
.
hold_timer_value
=
br_timer_get_residue
(
&
pt
->
hold_timer
);
p
.
hold_timer_value
=
br_timer_get_residue
(
&
pt
->
hold_timer
);
read_unlock
(
&
br
->
lock
);
if
(
copy_to_user
((
void
*
)
arg0
,
&
p
,
sizeof
(
p
)))
if
(
copy_to_user
((
void
*
)
arg0
,
&
p
,
sizeof
(
p
)))
return
-
EFAULT
;
return
-
EFAULT
;
...
@@ -154,16 +165,20 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -154,16 +165,20 @@ static int br_ioctl_device(struct net_bridge *br,
return
0
;
return
0
;
case
BRCTL_SET_BRIDGE_PRIORITY
:
case
BRCTL_SET_BRIDGE_PRIORITY
:
write_lock
(
&
br
->
lock
);
br_stp_set_bridge_priority
(
br
,
arg0
);
br_stp_set_bridge_priority
(
br
,
arg0
);
write_unlock
(
&
br
->
lock
);
return
0
;
return
0
;
case
BRCTL_SET_PORT_PRIORITY
:
case
BRCTL_SET_PORT_PRIORITY
:
{
{
struct
net_bridge_port
*
p
;
struct
net_bridge_port
*
p
;
write_lock
(
&
br
->
lock
);
if
((
p
=
br_get_port
(
br
,
arg0
))
==
NULL
)
if
((
p
=
br_get_port
(
br
,
arg0
))
==
NULL
)
return
-
EINVAL
;
return
-
EINVAL
;
br_stp_set_port_priority
(
p
,
arg1
);
br_stp_set_port_priority
(
p
,
arg1
);
write_unlock
(
&
br
->
lock
);
return
0
;
return
0
;
}
}
...
@@ -171,9 +186,11 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -171,9 +186,11 @@ static int br_ioctl_device(struct net_bridge *br,
{
{
struct
net_bridge_port
*
p
;
struct
net_bridge_port
*
p
;
write_lock
(
&
br
->
lock
);
if
((
p
=
br_get_port
(
br
,
arg0
))
==
NULL
)
if
((
p
=
br_get_port
(
br
,
arg0
))
==
NULL
)
return
-
EINVAL
;
return
-
EINVAL
;
br_stp_set_path_cost
(
p
,
arg1
);
br_stp_set_path_cost
(
p
,
arg1
);
write_unlock
(
&
br
->
lock
);
return
0
;
return
0
;
}
}
...
@@ -230,11 +247,9 @@ static int br_ioctl_deviceless(unsigned int cmd,
...
@@ -230,11 +247,9 @@ static int br_ioctl_deviceless(unsigned int cmd,
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
static
DECLARE_MUTEX
(
ioctl_mutex
);
int
br_ioctl_deviceless_stub
(
unsigned
long
arg
)
int
br_ioctl_deviceless_stub
(
unsigned
long
arg
)
{
{
int
err
;
unsigned
long
i
[
3
];
unsigned
long
i
[
3
];
if
(
!
capable
(
CAP_NET_ADMIN
))
if
(
!
capable
(
CAP_NET_ADMIN
))
...
@@ -243,11 +258,7 @@ int br_ioctl_deviceless_stub(unsigned long arg)
...
@@ -243,11 +258,7 @@ int br_ioctl_deviceless_stub(unsigned long arg)
if
(
copy_from_user
(
i
,
(
void
*
)
arg
,
3
*
sizeof
(
unsigned
long
)))
if
(
copy_from_user
(
i
,
(
void
*
)
arg
,
3
*
sizeof
(
unsigned
long
)))
return
-
EFAULT
;
return
-
EFAULT
;
down
(
&
ioctl_mutex
);
return
br_ioctl_deviceless
(
i
[
0
],
i
[
1
],
i
[
2
]);
err
=
br_ioctl_deviceless
(
i
[
0
],
i
[
1
],
i
[
2
]);
up
(
&
ioctl_mutex
);
return
err
;
}
}
int
br_ioctl
(
struct
net_bridge
*
br
,
unsigned
int
cmd
,
unsigned
long
arg0
,
unsigned
long
arg1
,
unsigned
long
arg2
)
int
br_ioctl
(
struct
net_bridge
*
br
,
unsigned
int
cmd
,
unsigned
long
arg0
,
unsigned
long
arg1
,
unsigned
long
arg2
)
...
@@ -257,18 +268,9 @@ int br_ioctl(struct net_bridge *br, unsigned int cmd, unsigned long arg0, unsign
...
@@ -257,18 +268,9 @@ int br_ioctl(struct net_bridge *br, unsigned int cmd, unsigned long arg0, unsign
if
(
!
capable
(
CAP_NET_ADMIN
))
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
return
-
EPERM
;
down
(
&
ioctl_mutex
);
err
=
br_ioctl_deviceless
(
cmd
,
arg0
,
arg1
);
err
=
br_ioctl_deviceless
(
cmd
,
arg0
,
arg1
);
if
(
err
==
-
EOPNOTSUPP
)
if
(
err
==
-
EOPNOTSUPP
)
err
=
br_ioctl_device
(
br
,
cmd
,
arg0
,
arg1
,
arg2
);
err
=
br_ioctl_device
(
br
,
cmd
,
arg0
,
arg1
,
arg2
);
up
(
&
ioctl_mutex
);
return
err
;
return
err
;
}
}
void
br_call_ioctl_atomic
(
void
(
*
fn
)(
void
))
{
down
(
&
ioctl_mutex
);
fn
();
up
(
&
ioctl_mutex
);
}
net/bridge/br_notify.c
View file @
808c8a58
...
@@ -21,15 +21,14 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
...
@@ -21,15 +21,14 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
struct
notifier_block
br_device_notifier
=
struct
notifier_block
br_device_notifier
=
{
{
br_device_event
,
.
notifier_call
=
br_device_event
NULL
,
0
};
};
static
int
br_device_event
(
struct
notifier_block
*
unused
,
unsigned
long
event
,
void
*
ptr
)
static
int
br_device_event
(
struct
notifier_block
*
unused
,
unsigned
long
event
,
void
*
ptr
)
{
{
struct
net_device
*
dev
;
struct
net_device
*
dev
;
struct
net_bridge_port
*
p
;
struct
net_bridge_port
*
p
;
struct
net_bridge
*
br
;
dev
=
ptr
;
dev
=
ptr
;
p
=
dev
->
br_port
;
p
=
dev
->
br_port
;
...
@@ -37,13 +36,15 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
...
@@ -37,13 +36,15 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
if
(
p
==
NULL
)
if
(
p
==
NULL
)
return
NOTIFY_DONE
;
return
NOTIFY_DONE
;
switch
(
event
)
br
=
p
->
br
;
switch
(
event
)
{
{
case
NETDEV_CHANGEADDR
:
case
NETDEV_CHANGEADDR
:
read_lock
(
&
p
->
br
->
lock
);
write_lock_bh
(
&
br
->
lock
);
br_fdb_changeaddr
(
p
,
dev
->
dev_addr
);
br_fdb_changeaddr
(
p
,
dev
->
dev_addr
);
br_stp_recalculate_bridge_id
(
p
->
br
);
br_stp_recalculate_bridge_id
(
br
);
read_unlock
(
&
p
->
br
->
lock
);
write_unlock_bh
(
&
br
->
lock
);
break
;
break
;
case
NETDEV_GOING_DOWN
:
case
NETDEV_GOING_DOWN
:
...
@@ -51,23 +52,23 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
...
@@ -51,23 +52,23 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
break
;
break
;
case
NETDEV_DOWN
:
case
NETDEV_DOWN
:
if
(
p
->
br
->
dev
.
flags
&
IFF_UP
)
{
if
(
br
->
dev
.
flags
&
IFF_UP
)
{
read_lock
(
&
p
->
br
->
lock
);
write_lock_bh
(
&
br
->
lock
);
br_stp_disable_port
(
dev
->
br_port
);
br_stp_disable_port
(
p
);
read_unlock
(
&
p
->
br
->
lock
);
write_unlock_bh
(
&
br
->
lock
);
}
}
break
;
break
;
case
NETDEV_UP
:
case
NETDEV_UP
:
if
(
p
->
br
->
dev
.
flags
&
IFF_UP
)
{
if
(
!
(
br
->
dev
.
flags
&
IFF_UP
)
)
{
read_lock
(
&
p
->
br
->
lock
);
write_lock_bh
(
&
br
->
lock
);
br_stp_enable_port
(
dev
->
br_port
);
br_stp_enable_port
(
p
);
read_unlock
(
&
p
->
br
->
lock
);
write_unlock_bh
(
&
br
->
lock
);
}
}
break
;
break
;
case
NETDEV_UNREGISTER
:
case
NETDEV_UNREGISTER
:
br_del_if
(
dev
->
br_port
->
br
,
dev
);
br_del_if
(
br
,
dev
);
break
;
break
;
}
}
...
...
net/core/dev.c
View file @
808c8a58
...
@@ -1433,9 +1433,8 @@ static void net_tx_action(struct softirq_action *h)
...
@@ -1433,9 +1433,8 @@ static void net_tx_action(struct softirq_action *h)
}
}
}
}
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
#if defined(CONFIG_BRIDGE) || defined
(CONFIG_BRIDGE_MODULE)
int
(
*
br_handle_frame_hook
)(
struct
sk_buff
*
skb
)
=
NULL
;
int
(
*
br_handle_frame_hook
)(
struct
sk_buff
*
skb
)
=
NULL
;
#endif
static
__inline__
int
handle_bridge
(
struct
sk_buff
*
skb
,
static
__inline__
int
handle_bridge
(
struct
sk_buff
*
skb
,
struct
packet_type
*
pt_prev
)
struct
packet_type
*
pt_prev
)
...
@@ -1454,6 +1453,7 @@ static __inline__ int handle_bridge(struct sk_buff *skb,
...
@@ -1454,6 +1453,7 @@ static __inline__ int handle_bridge(struct sk_buff *skb,
return
ret
;
return
ret
;
}
}
#endif
#ifdef CONFIG_NET_DIVERT
#ifdef CONFIG_NET_DIVERT
static
inline
int
handle_diverter
(
struct
sk_buff
*
skb
)
static
inline
int
handle_diverter
(
struct
sk_buff
*
skb
)
...
@@ -1510,12 +1510,13 @@ int netif_receive_skb(struct sk_buff *skb)
...
@@ -1510,12 +1510,13 @@ int netif_receive_skb(struct sk_buff *skb)
#endif
/* CONFIG_NET_DIVERT */
#endif
/* CONFIG_NET_DIVERT */
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
if
(
skb
->
dev
->
br_port
&&
br_handle_frame_hook
)
{
if
(
skb
->
dev
->
br_port
)
{
int
ret
;
int
ret
;
ret
=
handle_bridge
(
skb
,
pt_prev
);
ret
=
handle_bridge
(
skb
,
pt_prev
);
if
(
br_handle_frame_hook
(
skb
)
==
0
)
if
(
br_handle_frame_hook
(
skb
)
==
0
)
return
ret
;
return
ret
;
pt_prev
=
NULL
;
pt_prev
=
NULL
;
}
}
#endif
#endif
...
...
net/ipv4/Kconfig
View file @
808c8a58
...
@@ -362,5 +362,13 @@ config INET_ESP
...
@@ -362,5 +362,13 @@ config INET_ESP
If unsure, say Y.
If unsure, say Y.
config INET_IPCOMP
tristate "IP: IPComp transformation"
---help---
Support for IP Paylod Compression (RFC3173), typically needed
for IPsec.
If unsure, say Y.
source "net/ipv4/netfilter/Kconfig"
source "net/ipv4/netfilter/Kconfig"
net/ipv4/Makefile
View file @
808c8a58
...
@@ -18,6 +18,7 @@ obj-$(CONFIG_NET_IPGRE) += ip_gre.o
...
@@ -18,6 +18,7 @@ obj-$(CONFIG_NET_IPGRE) += ip_gre.o
obj-$(CONFIG_SYN_COOKIES)
+=
syncookies.o
obj-$(CONFIG_SYN_COOKIES)
+=
syncookies.o
obj-$(CONFIG_INET_AH)
+=
ah.o
obj-$(CONFIG_INET_AH)
+=
ah.o
obj-$(CONFIG_INET_ESP)
+=
esp.o
obj-$(CONFIG_INET_ESP)
+=
esp.o
obj-$(CONFIG_INET_IPCOMP)
+=
ipcomp.o
obj-$(CONFIG_IP_PNP)
+=
ipconfig.o
obj-$(CONFIG_IP_PNP)
+=
ipconfig.o
obj-$(CONFIG_NETFILTER)
+=
netfilter/
obj-$(CONFIG_NETFILTER)
+=
netfilter/
...
...
net/ipv4/igmp.c
View file @
808c8a58
This diff is collapsed.
Click to expand it.
net/ipv4/ip_output.c
View file @
808c8a58
...
@@ -1312,5 +1312,6 @@ void __init ip_init(void)
...
@@ -1312,5 +1312,6 @@ void __init ip_init(void)
#ifdef CONFIG_IP_MULTICAST
#ifdef CONFIG_IP_MULTICAST
proc_net_create
(
"igmp"
,
0
,
ip_mc_procinfo
);
proc_net_create
(
"igmp"
,
0
,
ip_mc_procinfo
);
proc_net_create
(
"mcfilter"
,
0
,
ip_mcf_procinfo
);
#endif
#endif
}
}
net/ipv4/ip_sockglue.c
View file @
808c8a58
...
@@ -610,9 +610,67 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
...
@@ -610,9 +610,67 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
}
}
if
(
optname
==
IP_ADD_MEMBERSHIP
)
if
(
optname
==
IP_ADD_MEMBERSHIP
)
err
=
ip_mc_join_group
(
sk
,
&
mreq
);
err
=
ip_mc_join_group
(
sk
,
&
mreq
);
else
else
err
=
ip_mc_leave_group
(
sk
,
&
mreq
);
err
=
ip_mc_leave_group
(
sk
,
&
mreq
);
break
;
}
case
IP_MSFILTER
:
{
struct
ip_msfilter
*
msf
;
if
(
optlen
<
IP_MSFILTER_SIZE
(
0
))
goto
e_inval
;
msf
=
(
struct
ip_msfilter
*
)
kmalloc
(
optlen
,
GFP_KERNEL
);
if
(
msf
==
0
)
{
err
=
-
ENOBUFS
;
break
;
}
err
=
-
EFAULT
;
if
(
copy_from_user
(
msf
,
optval
,
optlen
))
{
kfree
(
msf
);
break
;
}
err
=
ip_mc_msfilter
(
sk
,
msf
);
kfree
(
msf
);
break
;
}
case
IP_BLOCK_SOURCE
:
case
IP_UNBLOCK_SOURCE
:
case
IP_ADD_SOURCE_MEMBERSHIP
:
case
IP_DROP_SOURCE_MEMBERSHIP
:
{
struct
ip_mreq_source
mreqs
;
int
omode
,
add
;
if
(
optlen
!=
sizeof
(
struct
ip_mreq_source
))
goto
e_inval
;
if
(
copy_from_user
(
&
mreqs
,
optval
,
sizeof
(
mreqs
)))
{
err
=
-
EFAULT
;
break
;
}
if
(
optname
==
IP_BLOCK_SOURCE
)
{
omode
=
MCAST_EXCLUDE
;
add
=
1
;
}
else
if
(
optname
==
IP_UNBLOCK_SOURCE
)
{
omode
=
MCAST_EXCLUDE
;
add
=
0
;
}
else
if
(
optname
==
IP_ADD_SOURCE_MEMBERSHIP
)
{
struct
ip_mreqn
mreq
;
mreq
.
imr_multiaddr
.
s_addr
=
mreqs
.
imr_multiaddr
;
mreq
.
imr_address
.
s_addr
=
mreqs
.
imr_interface
;
mreq
.
imr_ifindex
=
0
;
err
=
ip_mc_join_group
(
sk
,
&
mreq
);
if
(
err
)
break
;
omode
=
MCAST_INCLUDE
;
add
=
1
;
}
else
/*IP_DROP_SOURCE_MEMBERSHIP */
{
omode
=
MCAST_INCLUDE
;
add
=
0
;
}
err
=
ip_mc_source
(
add
,
omode
,
sk
,
&
mreqs
);
break
;
break
;
}
}
case
IP_ROUTER_ALERT
:
case
IP_ROUTER_ALERT
:
...
@@ -763,6 +821,20 @@ int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *op
...
@@ -763,6 +821,20 @@ int ip_getsockopt(struct sock *sk, int level, int optname, char *optval, int *op
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
}
}
case
IP_MSFILTER
:
{
struct
ip_msfilter
msf
;
int
err
;
if
(
len
<
IP_MSFILTER_SIZE
(
0
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
msf
,
optval
,
IP_MSFILTER_SIZE
(
0
)))
return
-
EFAULT
;
err
=
ip_mc_msfget
(
sk
,
&
msf
,
(
struct
ip_msfilter
*
)
optval
,
optlen
);
release_sock
(
sk
);
return
err
;
}
case
IP_PKTOPTIONS
:
case
IP_PKTOPTIONS
:
{
{
struct
msghdr
msg
;
struct
msghdr
msg
;
...
...
net/ipv4/ipcomp.c
0 → 100644
View file @
808c8a58
/*
* IP Payload Compression Protocol (IPComp) - RFC3713.
*
* Copyright (c) 2003 James Morris <jmorris@intercode.com.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Todo:
* - Tunable compression parameters.
* - Compression stats.
* - Adaptive compression.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/scatterlist.h>
#include <linux/crypto.h>
#include <linux/pfkeyv2.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/icmp.h>
#include <net/esp.h>
#define IPCOMP_SCRATCH_SIZE 65400
struct
ipcomp_hdr
{
u8
nexthdr
;
u8
flags
;
u16
cpi
;
};
struct
ipcomp_data
{
u16
threshold
;
u8
*
scratch
;
struct
crypto_tfm
*
tfm
;
};
static
int
ipcomp_decompress
(
struct
xfrm_state
*
x
,
struct
sk_buff
*
skb
)
{
int
err
,
plen
,
dlen
;
struct
iphdr
*
iph
;
struct
ipcomp_data
*
ipcd
=
x
->
data
;
u8
*
start
,
*
scratch
=
ipcd
->
scratch
;
plen
=
skb
->
len
;
dlen
=
IPCOMP_SCRATCH_SIZE
;
start
=
skb
->
data
;
err
=
crypto_comp_decompress
(
ipcd
->
tfm
,
start
,
plen
,
scratch
,
&
dlen
);
if
(
err
)
goto
out
;
if
(
dlen
<
(
plen
+
sizeof
(
struct
ipcomp_hdr
)))
{
err
=
-
EINVAL
;
goto
out
;
}
err
=
pskb_expand_head
(
skb
,
0
,
dlen
-
plen
,
GFP_ATOMIC
);
if
(
err
)
goto
out
;
skb_put
(
skb
,
dlen
-
plen
);
memcpy
(
skb
->
data
,
scratch
,
dlen
);
iph
=
skb
->
nh
.
iph
;
iph
->
tot_len
=
htons
(
dlen
+
iph
->
ihl
*
4
);
out:
return
err
;
}
static
int
ipcomp_input
(
struct
xfrm_state
*
x
,
struct
xfrm_decap_state
*
decap
,
struct
sk_buff
*
skb
)
{
u8
nexthdr
;
int
err
=
0
;
struct
iphdr
*
iph
;
union
{
struct
iphdr
iph
;
char
buf
[
60
];
}
tmp_iph
;
if
((
skb_is_nonlinear
(
skb
)
||
skb_cloned
(
skb
))
&&
skb_linearize
(
skb
,
GFP_ATOMIC
)
!=
0
)
{
err
=
-
ENOMEM
;
goto
out
;
}
skb
->
ip_summed
=
CHECKSUM_NONE
;
/* Remove ipcomp header and decompress original payload */
iph
=
skb
->
nh
.
iph
;
memcpy
(
&
tmp_iph
,
iph
,
iph
->
ihl
*
4
);
nexthdr
=
*
(
u8
*
)
skb
->
data
;
skb_pull
(
skb
,
sizeof
(
struct
ipcomp_hdr
));
memcpy
(
skb
->
nh
.
raw
,
&
tmp_iph
,
tmp_iph
.
iph
.
ihl
*
4
);
iph
->
tot_len
=
htons
(
ntohs
(
iph
->
tot_len
)
-
sizeof
(
struct
ipcomp_hdr
));
iph
->
protocol
=
nexthdr
;
skb
->
h
.
raw
=
skb
->
data
;
err
=
ipcomp_decompress
(
x
,
skb
);
out:
return
err
;
}
static
int
ipcomp_compress
(
struct
xfrm_state
*
x
,
struct
sk_buff
*
skb
)
{
int
err
,
plen
,
dlen
,
ihlen
;
struct
iphdr
*
iph
=
skb
->
nh
.
iph
;
struct
ipcomp_data
*
ipcd
=
x
->
data
;
u8
*
start
,
*
scratch
=
ipcd
->
scratch
;
ihlen
=
iph
->
ihl
*
4
;
plen
=
skb
->
len
-
ihlen
;
dlen
=
IPCOMP_SCRATCH_SIZE
;
start
=
skb
->
data
+
ihlen
;
err
=
crypto_comp_compress
(
ipcd
->
tfm
,
start
,
plen
,
scratch
,
&
dlen
);
if
(
err
)
goto
out
;
if
((
dlen
+
sizeof
(
struct
ipcomp_hdr
))
>=
plen
)
{
err
=
-
EMSGSIZE
;
goto
out
;
}
memcpy
(
start
,
scratch
,
dlen
);
pskb_trim
(
skb
,
ihlen
+
dlen
);
out:
return
err
;
}
static
void
ipcomp_tunnel_encap
(
struct
xfrm_state
*
x
,
struct
sk_buff
*
skb
,
int
compress
)
{
struct
dst_entry
*
dst
=
skb
->
dst
;
struct
iphdr
*
iph
,
*
top_iph
;
iph
=
skb
->
nh
.
iph
;
top_iph
=
(
struct
iphdr
*
)
skb_push
(
skb
,
sizeof
(
struct
iphdr
));
top_iph
->
ihl
=
5
;
top_iph
->
version
=
4
;
top_iph
->
tos
=
iph
->
tos
;
top_iph
->
tot_len
=
htons
(
skb
->
len
);
if
(
!
(
iph
->
frag_off
&
htons
(
IP_DF
)))
__ip_select_ident
(
top_iph
,
dst
,
0
);
top_iph
->
ttl
=
iph
->
ttl
;
top_iph
->
protocol
=
compress
?
IPPROTO_COMP
:
IPPROTO_IPIP
;
top_iph
->
check
=
0
;
top_iph
->
saddr
=
x
->
props
.
saddr
.
a4
;
top_iph
->
daddr
=
x
->
id
.
daddr
.
a4
;
top_iph
->
frag_off
=
iph
->
frag_off
&~
htons
(
IP_MF
|
IP_OFFSET
);
memset
(
&
(
IPCB
(
skb
)
->
opt
),
0
,
sizeof
(
struct
ip_options
));
skb
->
nh
.
raw
=
skb
->
data
;
}
static
int
ipcomp_output
(
struct
sk_buff
*
skb
)
{
int
err
;
struct
dst_entry
*
dst
=
skb
->
dst
;
struct
xfrm_state
*
x
=
dst
->
xfrm
;
struct
iphdr
*
iph
,
*
top_iph
;
struct
ipcomp_hdr
*
ipch
;
struct
ipcomp_data
*
ipcd
=
x
->
data
;
union
{
struct
iphdr
iph
;
char
buf
[
60
];
}
tmp_iph
;
if
(
skb
->
ip_summed
==
CHECKSUM_HW
&&
skb_checksum_help
(
skb
)
==
NULL
)
{
err
=
-
EINVAL
;
goto
error_nolock
;
}
spin_lock_bh
(
&
x
->
lock
);
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
goto
error
;
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
goto
error
;
/* Don't bother compressing */
if
(
skb
->
len
<
ipcd
->
threshold
)
{
if
(
x
->
props
.
mode
)
{
ipcomp_tunnel_encap
(
x
,
skb
,
0
);
iph
=
skb
->
nh
.
iph
;
ip_send_check
(
iph
);
}
goto
out_ok
;
}
if
(
x
->
props
.
mode
)
ipcomp_tunnel_encap
(
x
,
skb
,
1
);
if
((
skb_is_nonlinear
(
skb
)
||
skb_cloned
(
skb
))
&&
skb_linearize
(
skb
,
GFP_ATOMIC
)
!=
0
)
{
err
=
-
ENOMEM
;
goto
error
;
}
err
=
ipcomp_compress
(
x
,
skb
);
if
(
err
)
{
if
(
err
==
-
EMSGSIZE
)
goto
out_ok
;
goto
error
;
}
/* Install ipcomp header, convert into ipcomp datagram. */
iph
=
skb
->
nh
.
iph
;
memcpy
(
&
tmp_iph
,
iph
,
iph
->
ihl
*
4
);
top_iph
=
(
struct
iphdr
*
)
skb_push
(
skb
,
sizeof
(
struct
ipcomp_hdr
));
memcpy
(
top_iph
,
&
tmp_iph
,
iph
->
ihl
*
4
);
iph
=
top_iph
;
iph
->
tot_len
=
htons
(
skb
->
len
);
iph
->
protocol
=
IPPROTO_COMP
;
iph
->
check
=
0
;
ipch
=
(
struct
ipcomp_hdr
*
)((
char
*
)
iph
+
iph
->
ihl
*
4
);
ipch
->
nexthdr
=
x
->
props
.
mode
?
IPPROTO_IPIP
:
tmp_iph
.
iph
.
protocol
;
ipch
->
flags
=
0
;
ipch
->
cpi
=
htons
((
u16
)
ntohl
(
x
->
id
.
spi
));
ip_send_check
(
iph
);
skb
->
nh
.
raw
=
skb
->
data
;
out_ok:
x
->
curlft
.
bytes
+=
skb
->
len
;
x
->
curlft
.
packets
++
;
spin_unlock_bh
(
&
x
->
lock
);
if
((
skb
->
dst
=
dst_pop
(
dst
))
==
NULL
)
{
err
=
-
EHOSTUNREACH
;
goto
error_nolock
;
}
err
=
NET_XMIT_BYPASS
;
out_exit:
return
err
;
error:
spin_unlock_bh
(
&
x
->
lock
);
error_nolock:
kfree_skb
(
skb
);
goto
out_exit
;
}
static
void
ipcomp4_err
(
struct
sk_buff
*
skb
,
u32
info
)
{
u32
spi
;
struct
iphdr
*
iph
=
(
struct
iphdr
*
)
skb
->
data
;
struct
ipcomp_hdr
*
ipch
=
(
struct
ipcomp_hdr
*
)(
skb
->
data
+
(
iph
->
ihl
<<
2
));
struct
xfrm_state
*
x
;
if
(
skb
->
h
.
icmph
->
type
!=
ICMP_DEST_UNREACH
||
skb
->
h
.
icmph
->
code
!=
ICMP_FRAG_NEEDED
)
return
;
spi
=
ntohl
(
ntohs
(
ipch
->
cpi
));
x
=
xfrm_state_lookup
((
xfrm_address_t
*
)
&
iph
->
daddr
,
spi
,
IPPROTO_COMP
,
AF_INET
);
if
(
!
x
)
return
;
printk
(
KERN_DEBUG
"pmtu discvovery on SA IPCOMP/%08x/%u.%u.%u.%u
\n
"
,
spi
,
NIPQUAD
(
iph
->
daddr
));
xfrm_state_put
(
x
);
}
static
void
ipcomp_free_data
(
struct
ipcomp_data
*
ipcd
)
{
if
(
ipcd
->
tfm
)
crypto_free_tfm
(
ipcd
->
tfm
);
if
(
ipcd
->
scratch
)
kfree
(
ipcd
->
scratch
);
}
static
void
ipcomp_destroy
(
struct
xfrm_state
*
x
)
{
struct
ipcomp_data
*
ipcd
=
x
->
data
;
ipcomp_free_data
(
ipcd
);
kfree
(
ipcd
);
}
static
int
ipcomp_init_state
(
struct
xfrm_state
*
x
,
void
*
args
)
{
int
err
=
-
ENOMEM
;
struct
ipcomp_data
*
ipcd
;
struct
xfrm_algo_desc
*
calg_desc
;
ipcd
=
kmalloc
(
sizeof
(
*
ipcd
),
GFP_KERNEL
);
if
(
!
ipcd
)
goto
error
;
memset
(
ipcd
,
0
,
sizeof
(
*
ipcd
));
x
->
props
.
header_len
=
sizeof
(
struct
ipcomp_hdr
);
if
(
x
->
props
.
mode
)
x
->
props
.
header_len
+=
sizeof
(
struct
iphdr
);
x
->
data
=
ipcd
;
ipcd
->
scratch
=
kmalloc
(
IPCOMP_SCRATCH_SIZE
,
GFP_KERNEL
);
if
(
!
ipcd
->
scratch
)
goto
error
;
ipcd
->
tfm
=
crypto_alloc_tfm
(
x
->
calg
->
alg_name
,
0
);
if
(
!
ipcd
->
tfm
)
goto
error
;
calg_desc
=
xfrm_calg_get_byname
(
x
->
calg
->
alg_name
);
BUG_ON
(
!
calg_desc
);
ipcd
->
threshold
=
calg_desc
->
uinfo
.
comp
.
threshold
;
err
=
0
;
out:
return
err
;
error:
if
(
ipcd
)
{
ipcomp_free_data
(
ipcd
);
kfree
(
ipcd
);
}
goto
out
;
}
static
struct
xfrm_type
ipcomp_type
=
{
.
description
=
"IPCOMP4"
,
.
proto
=
IPPROTO_COMP
,
.
init_state
=
ipcomp_init_state
,
.
destructor
=
ipcomp_destroy
,
.
input
=
ipcomp_input
,
.
output
=
ipcomp_output
};
static
struct
inet_protocol
ipcomp4_protocol
=
{
.
handler
=
xfrm4_rcv
,
.
err_handler
=
ipcomp4_err
,
.
no_policy
=
1
,
};
static
int
__init
ipcomp4_init
(
void
)
{
SET_MODULE_OWNER
(
&
ipcomp_type
);
if
(
xfrm_register_type
(
&
ipcomp_type
,
AF_INET
)
<
0
)
{
printk
(
KERN_INFO
"ipcomp init: can't add xfrm type
\n
"
);
return
-
EAGAIN
;
}
if
(
inet_add_protocol
(
&
ipcomp4_protocol
,
IPPROTO_COMP
)
<
0
)
{
printk
(
KERN_INFO
"ipcomp init: can't add protocol
\n
"
);
xfrm_unregister_type
(
&
ipcomp_type
,
AF_INET
);
return
-
EAGAIN
;
}
return
0
;
}
static
void
__exit
ipcomp4_fini
(
void
)
{
if
(
inet_del_protocol
(
&
ipcomp4_protocol
,
IPPROTO_COMP
)
<
0
)
printk
(
KERN_INFO
"ip ipcomp close: can't remove protocol
\n
"
);
if
(
xfrm_unregister_type
(
&
ipcomp_type
,
AF_INET
)
<
0
)
printk
(
KERN_INFO
"ip ipcomp close: can't remove xfrm type
\n
"
);
}
module_init
(
ipcomp4_init
);
module_exit
(
ipcomp4_fini
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DESCRIPTION
(
"IP Payload Compression Protocol (IPComp) - RFC3713"
);
MODULE_AUTHOR
(
"James Morris <jmorris@intercode.com.au>"
);
net/ipv4/netfilter/ip_conntrack_core.c
View file @
808c8a58
...
@@ -273,6 +273,8 @@ static void remove_expectations(struct ip_conntrack *ct)
...
@@ -273,6 +273,8 @@ static void remove_expectations(struct ip_conntrack *ct)
* the un-established ones only */
* the un-established ones only */
if
(
exp
->
sibling
)
{
if
(
exp
->
sibling
)
{
DEBUGP
(
"remove_expectations: skipping established %p of %p
\n
"
,
exp
->
sibling
,
ct
);
DEBUGP
(
"remove_expectations: skipping established %p of %p
\n
"
,
exp
->
sibling
,
ct
);
/* Indicate that this expectations parent is dead */
exp
->
expectant
=
NULL
;
continue
;
continue
;
}
}
...
@@ -324,6 +326,9 @@ destroy_conntrack(struct nf_conntrack *nfct)
...
@@ -324,6 +326,9 @@ destroy_conntrack(struct nf_conntrack *nfct)
ip_conntrack_destroyed
(
ct
);
ip_conntrack_destroyed
(
ct
);
WRITE_LOCK
(
&
ip_conntrack_lock
);
WRITE_LOCK
(
&
ip_conntrack_lock
);
/* Delete us from our own list to prevent corruption later */
list_del
(
&
ct
->
sibling_list
);
/* Delete our master expectation */
/* Delete our master expectation */
if
(
ct
->
master
)
{
if
(
ct
->
master
)
{
/* can't call __unexpect_related here,
/* can't call __unexpect_related here,
...
...
net/ipv4/route.c
View file @
808c8a58
...
@@ -1790,7 +1790,8 @@ int ip_route_input(struct sk_buff *skb, u32 daddr, u32 saddr,
...
@@ -1790,7 +1790,8 @@ int ip_route_input(struct sk_buff *skb, u32 daddr, u32 saddr,
read_lock
(
&
inetdev_lock
);
read_lock
(
&
inetdev_lock
);
if
((
in_dev
=
__in_dev_get
(
dev
))
!=
NULL
)
{
if
((
in_dev
=
__in_dev_get
(
dev
))
!=
NULL
)
{
int
our
=
ip_check_mc
(
in_dev
,
daddr
);
int
our
=
ip_check_mc
(
in_dev
,
daddr
,
saddr
,
skb
->
nh
.
iph
->
protocol
);
if
(
our
if
(
our
#ifdef CONFIG_IP_MROUTE
#ifdef CONFIG_IP_MROUTE
||
(
!
LOCAL_MCAST
(
daddr
)
&&
IN_DEV_MFORWARD
(
in_dev
))
||
(
!
LOCAL_MCAST
(
daddr
)
&&
IN_DEV_MFORWARD
(
in_dev
))
...
@@ -2020,7 +2021,7 @@ int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
...
@@ -2020,7 +2021,7 @@ int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
}
}
}
else
if
(
res
.
type
==
RTN_MULTICAST
)
{
}
else
if
(
res
.
type
==
RTN_MULTICAST
)
{
flags
|=
RTCF_MULTICAST
|
RTCF_LOCAL
;
flags
|=
RTCF_MULTICAST
|
RTCF_LOCAL
;
if
(
!
ip_check_mc
(
in_dev
,
oldflp
->
fl4_dst
))
if
(
!
ip_check_mc
(
in_dev
,
oldflp
->
fl4_dst
,
oldflp
->
fl4_src
,
oldflp
->
proto
))
flags
&=
~
RTCF_LOCAL
;
flags
&=
~
RTCF_LOCAL
;
/* If multicast route do not exist use
/* If multicast route do not exist use
default one, but do not gateway in this case.
default one, but do not gateway in this case.
...
...
net/ipv4/udp.c
View file @
808c8a58
...
@@ -298,6 +298,8 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
...
@@ -298,6 +298,8 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
ipv6_only_sock
(
s
)
||
ipv6_only_sock
(
s
)
||
(
s
->
bound_dev_if
&&
s
->
bound_dev_if
!=
dif
))
(
s
->
bound_dev_if
&&
s
->
bound_dev_if
!=
dif
))
continue
;
continue
;
if
(
!
ip_mc_sf_allow
(
sk
,
loc_addr
,
rmt_addr
,
dif
))
continue
;
break
;
break
;
}
}
return
s
;
return
s
;
...
...
net/ipv4/xfrm4_input.c
View file @
808c8a58
...
@@ -48,6 +48,9 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
...
@@ -48,6 +48,9 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
if
(
x
->
props
.
replay_window
&&
xfrm_replay_check
(
x
,
seq
))
if
(
x
->
props
.
replay_window
&&
xfrm_replay_check
(
x
,
seq
))
goto
drop_unlock
;
goto
drop_unlock
;
if
(
xfrm_state_check_expire
(
x
))
goto
drop_unlock
;
xfrm_vec
[
xfrm_nr
].
decap
.
decap_type
=
encap_type
;
xfrm_vec
[
xfrm_nr
].
decap
.
decap_type
=
encap_type
;
if
(
x
->
type
->
input
(
x
,
&
(
xfrm_vec
[
xfrm_nr
].
decap
),
skb
))
if
(
x
->
type
->
input
(
x
,
&
(
xfrm_vec
[
xfrm_nr
].
decap
),
skb
))
goto
drop_unlock
;
goto
drop_unlock
;
...
...
net/ipv4/xfrm4_policy.c
View file @
808c8a58
...
@@ -201,6 +201,13 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
...
@@ -201,6 +201,13 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
}
}
break
;
break
;
case
IPPROTO_COMP
:
if
(
pskb_may_pull
(
skb
,
xprth
+
4
-
skb
->
data
))
{
u16
*
ipcomp_hdr
=
(
u16
*
)
xprth
;
fl
->
uli_u
.
spi
=
ntohl
(
ntohs
(
ipcomp_hdr
[
1
]));
}
break
;
default:
default:
fl
->
uli_u
.
spi
=
0
;
fl
->
uli_u
.
spi
=
0
;
break
;
break
;
...
...
net/ipv6/addrconf.c
View file @
808c8a58
...
@@ -1202,7 +1202,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
...
@@ -1202,7 +1202,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
if
(
dev
->
type
==
ARPHRD_SIT
&&
(
dev
->
flags
&
IFF_POINTOPOINT
))
if
(
dev
->
type
==
ARPHRD_SIT
&&
(
dev
->
flags
&
IFF_POINTOPOINT
))
rtmsg
.
rtmsg_flags
|=
RTF_NONEXTHOP
;
rtmsg
.
rtmsg_flags
|=
RTF_NONEXTHOP
;
ip6_route_add
(
&
rtmsg
);
ip6_route_add
(
&
rtmsg
,
NULL
);
}
}
/* Create "default" multicast route to the interface */
/* Create "default" multicast route to the interface */
...
@@ -1219,7 +1219,7 @@ static void addrconf_add_mroute(struct net_device *dev)
...
@@ -1219,7 +1219,7 @@ static void addrconf_add_mroute(struct net_device *dev)
rtmsg
.
rtmsg_ifindex
=
dev
->
ifindex
;
rtmsg
.
rtmsg_ifindex
=
dev
->
ifindex
;
rtmsg
.
rtmsg_flags
=
RTF_UP
|
RTF_ADDRCONF
;
rtmsg
.
rtmsg_flags
=
RTF_UP
|
RTF_ADDRCONF
;
rtmsg
.
rtmsg_type
=
RTMSG_NEWROUTE
;
rtmsg
.
rtmsg_type
=
RTMSG_NEWROUTE
;
ip6_route_add
(
&
rtmsg
);
ip6_route_add
(
&
rtmsg
,
NULL
);
}
}
static
void
sit_route_add
(
struct
net_device
*
dev
)
static
void
sit_route_add
(
struct
net_device
*
dev
)
...
@@ -1236,7 +1236,7 @@ static void sit_route_add(struct net_device *dev)
...
@@ -1236,7 +1236,7 @@ static void sit_route_add(struct net_device *dev)
rtmsg
.
rtmsg_flags
=
RTF_UP
|
RTF_NONEXTHOP
;
rtmsg
.
rtmsg_flags
=
RTF_UP
|
RTF_NONEXTHOP
;
rtmsg
.
rtmsg_ifindex
=
dev
->
ifindex
;
rtmsg
.
rtmsg_ifindex
=
dev
->
ifindex
;
ip6_route_add
(
&
rtmsg
);
ip6_route_add
(
&
rtmsg
,
NULL
);
}
}
static
void
addrconf_add_lroute
(
struct
net_device
*
dev
)
static
void
addrconf_add_lroute
(
struct
net_device
*
dev
)
...
@@ -1328,7 +1328,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
...
@@ -1328,7 +1328,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
if
(
rt
&&
((
rt
->
rt6i_flags
&
(
RTF_GATEWAY
|
RTF_DEFAULT
))
==
0
))
{
if
(
rt
&&
((
rt
->
rt6i_flags
&
(
RTF_GATEWAY
|
RTF_DEFAULT
))
==
0
))
{
if
(
rt
->
rt6i_flags
&
RTF_EXPIRES
)
{
if
(
rt
->
rt6i_flags
&
RTF_EXPIRES
)
{
if
(
pinfo
->
onlink
==
0
||
valid_lft
==
0
)
{
if
(
pinfo
->
onlink
==
0
||
valid_lft
==
0
)
{
ip6_del_rt
(
rt
);
ip6_del_rt
(
rt
,
NULL
);
rt
=
NULL
;
rt
=
NULL
;
}
else
{
}
else
{
rt
->
rt6i_expires
=
rt_expires
;
rt
->
rt6i_expires
=
rt_expires
;
...
@@ -1952,7 +1952,7 @@ static void addrconf_rs_timer(unsigned long data)
...
@@ -1952,7 +1952,7 @@ static void addrconf_rs_timer(unsigned long data)
rtmsg
.
rtmsg_ifindex
=
ifp
->
idev
->
dev
->
ifindex
;
rtmsg
.
rtmsg_ifindex
=
ifp
->
idev
->
dev
->
ifindex
;
ip6_route_add
(
&
rtmsg
);
ip6_route_add
(
&
rtmsg
,
NULL
);
}
}
out:
out:
...
...
net/ipv6/ip6_fib.c
View file @
808c8a58
...
@@ -423,7 +423,8 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
...
@@ -423,7 +423,8 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
* Insert routing information in a node.
* Insert routing information in a node.
*/
*/
static
int
fib6_add_rt2node
(
struct
fib6_node
*
fn
,
struct
rt6_info
*
rt
)
static
int
fib6_add_rt2node
(
struct
fib6_node
*
fn
,
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
)
{
{
struct
rt6_info
*
iter
=
NULL
;
struct
rt6_info
*
iter
=
NULL
;
struct
rt6_info
**
ins
;
struct
rt6_info
**
ins
;
...
@@ -480,7 +481,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt)
...
@@ -480,7 +481,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt)
*
ins
=
rt
;
*
ins
=
rt
;
rt
->
rt6i_node
=
fn
;
rt
->
rt6i_node
=
fn
;
atomic_inc
(
&
rt
->
rt6i_ref
);
atomic_inc
(
&
rt
->
rt6i_ref
);
inet6_rt_notify
(
RTM_NEWROUTE
,
rt
);
inet6_rt_notify
(
RTM_NEWROUTE
,
rt
,
nlh
);
rt6_stats
.
fib_rt_entries
++
;
rt6_stats
.
fib_rt_entries
++
;
if
((
fn
->
fn_flags
&
RTN_RTINFO
)
==
0
)
{
if
((
fn
->
fn_flags
&
RTN_RTINFO
)
==
0
)
{
...
@@ -504,7 +505,7 @@ static __inline__ void fib6_start_gc(struct rt6_info *rt)
...
@@ -504,7 +505,7 @@ static __inline__ void fib6_start_gc(struct rt6_info *rt)
* with source addr info in sub-trees
* with source addr info in sub-trees
*/
*/
int
fib6_add
(
struct
fib6_node
*
root
,
struct
rt6_info
*
rt
)
int
fib6_add
(
struct
fib6_node
*
root
,
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
)
{
{
struct
fib6_node
*
fn
;
struct
fib6_node
*
fn
;
int
err
=
-
ENOMEM
;
int
err
=
-
ENOMEM
;
...
@@ -577,7 +578,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt)
...
@@ -577,7 +578,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt)
}
}
#endif
#endif
err
=
fib6_add_rt2node
(
fn
,
rt
);
err
=
fib6_add_rt2node
(
fn
,
rt
,
nlh
);
if
(
err
==
0
)
{
if
(
err
==
0
)
{
fib6_start_gc
(
rt
);
fib6_start_gc
(
rt
);
...
@@ -885,7 +886,8 @@ static struct fib6_node * fib6_repair_tree(struct fib6_node *fn)
...
@@ -885,7 +886,8 @@ static struct fib6_node * fib6_repair_tree(struct fib6_node *fn)
}
}
}
}
static
void
fib6_del_route
(
struct
fib6_node
*
fn
,
struct
rt6_info
**
rtp
)
static
void
fib6_del_route
(
struct
fib6_node
*
fn
,
struct
rt6_info
**
rtp
,
struct
nlmsghdr
*
nlh
)
{
{
struct
fib6_walker_t
*
w
;
struct
fib6_walker_t
*
w
;
struct
rt6_info
*
rt
=
*
rtp
;
struct
rt6_info
*
rt
=
*
rtp
;
...
@@ -940,11 +942,11 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp)
...
@@ -940,11 +942,11 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp)
if
(
atomic_read
(
&
rt
->
rt6i_ref
)
!=
1
)
BUG
();
if
(
atomic_read
(
&
rt
->
rt6i_ref
)
!=
1
)
BUG
();
}
}
inet6_rt_notify
(
RTM_DELROUTE
,
rt
);
inet6_rt_notify
(
RTM_DELROUTE
,
rt
,
nlh
);
rt6_release
(
rt
);
rt6_release
(
rt
);
}
}
int
fib6_del
(
struct
rt6_info
*
rt
)
int
fib6_del
(
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
)
{
{
struct
fib6_node
*
fn
=
rt
->
rt6i_node
;
struct
fib6_node
*
fn
=
rt
->
rt6i_node
;
struct
rt6_info
**
rtp
;
struct
rt6_info
**
rtp
;
...
@@ -969,7 +971,7 @@ int fib6_del(struct rt6_info *rt)
...
@@ -969,7 +971,7 @@ int fib6_del(struct rt6_info *rt)
for
(
rtp
=
&
fn
->
leaf
;
*
rtp
;
rtp
=
&
(
*
rtp
)
->
u
.
next
)
{
for
(
rtp
=
&
fn
->
leaf
;
*
rtp
;
rtp
=
&
(
*
rtp
)
->
u
.
next
)
{
if
(
*
rtp
==
rt
)
{
if
(
*
rtp
==
rt
)
{
fib6_del_route
(
fn
,
rtp
);
fib6_del_route
(
fn
,
rtp
,
nlh
);
return
0
;
return
0
;
}
}
}
}
...
@@ -1098,7 +1100,7 @@ static int fib6_clean_node(struct fib6_walker_t *w)
...
@@ -1098,7 +1100,7 @@ static int fib6_clean_node(struct fib6_walker_t *w)
res
=
c
->
func
(
rt
,
c
->
arg
);
res
=
c
->
func
(
rt
,
c
->
arg
);
if
(
res
<
0
)
{
if
(
res
<
0
)
{
w
->
leaf
=
rt
;
w
->
leaf
=
rt
;
res
=
fib6_del
(
rt
);
res
=
fib6_del
(
rt
,
NULL
);
if
(
res
)
{
if
(
res
)
{
#if RT6_DEBUG >= 2
#if RT6_DEBUG >= 2
printk
(
KERN_DEBUG
"fib6_clean_node: del failed: rt=%p@%p err=%d
\n
"
,
rt
,
rt
->
rt6i_node
,
res
);
printk
(
KERN_DEBUG
"fib6_clean_node: del failed: rt=%p@%p err=%d
\n
"
,
rt
,
rt
->
rt6i_node
,
res
);
...
...
net/ipv6/ndisc.c
View file @
808c8a58
...
@@ -961,7 +961,7 @@ void ndisc_recv_na(struct sk_buff *skb)
...
@@ -961,7 +961,7 @@ void ndisc_recv_na(struct sk_buff *skb)
struct
rt6_info
*
rt
;
struct
rt6_info
*
rt
;
rt
=
rt6_get_dflt_router
(
saddr
,
dev
);
rt
=
rt6_get_dflt_router
(
saddr
,
dev
);
if
(
rt
)
if
(
rt
)
ip6_del_rt
(
rt
);
ip6_del_rt
(
rt
,
NULL
);
}
}
}
else
{
}
else
{
if
(
msg
->
icmph
.
icmp6_router
)
if
(
msg
->
icmph
.
icmp6_router
)
...
@@ -1035,7 +1035,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
...
@@ -1035,7 +1035,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
rt
=
rt6_get_dflt_router
(
&
skb
->
nh
.
ipv6h
->
saddr
,
skb
->
dev
);
rt
=
rt6_get_dflt_router
(
&
skb
->
nh
.
ipv6h
->
saddr
,
skb
->
dev
);
if
(
rt
&&
lifetime
==
0
)
{
if
(
rt
&&
lifetime
==
0
)
{
ip6_del_rt
(
rt
);
ip6_del_rt
(
rt
,
NULL
);
rt
=
NULL
;
rt
=
NULL
;
}
}
...
...
net/ipv6/route.c
View file @
808c8a58
...
@@ -318,12 +318,12 @@ struct rt6_info *rt6_lookup(struct in6_addr *daddr, struct in6_addr *saddr,
...
@@ -318,12 +318,12 @@ struct rt6_info *rt6_lookup(struct in6_addr *daddr, struct in6_addr *saddr,
be destroyed.
be destroyed.
*/
*/
static
int
rt6_ins
(
struct
rt6_info
*
rt
)
static
int
rt6_ins
(
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
)
{
{
int
err
;
int
err
;
write_lock_bh
(
&
rt6_lock
);
write_lock_bh
(
&
rt6_lock
);
err
=
fib6_add
(
&
ip6_routing_table
,
rt
);
err
=
fib6_add
(
&
ip6_routing_table
,
rt
,
nlh
);
write_unlock_bh
(
&
rt6_lock
);
write_unlock_bh
(
&
rt6_lock
);
return
err
;
return
err
;
...
@@ -366,7 +366,7 @@ static struct rt6_info *rt6_cow(struct rt6_info *ort, struct in6_addr *daddr,
...
@@ -366,7 +366,7 @@ static struct rt6_info *rt6_cow(struct rt6_info *ort, struct in6_addr *daddr,
dst_hold
(
&
rt
->
u
.
dst
);
dst_hold
(
&
rt
->
u
.
dst
);
err
=
rt6_ins
(
rt
);
err
=
rt6_ins
(
rt
,
NULL
);
if
(
err
==
0
)
if
(
err
==
0
)
return
rt
;
return
rt
;
...
@@ -522,7 +522,7 @@ static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)
...
@@ -522,7 +522,7 @@ static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)
if
(
rt
)
{
if
(
rt
)
{
if
(
rt
->
rt6i_flags
&
RTF_CACHE
)
if
(
rt
->
rt6i_flags
&
RTF_CACHE
)
ip6_del_rt
(
rt
);
ip6_del_rt
(
rt
,
NULL
);
else
else
dst_release
(
dst
);
dst_release
(
dst
);
}
}
...
@@ -625,9 +625,10 @@ static int ipv6_get_hoplimit(struct net_device *dev)
...
@@ -625,9 +625,10 @@ static int ipv6_get_hoplimit(struct net_device *dev)
*
*
*/
*/
int
ip6_route_add
(
struct
in6_rtmsg
*
rtmsg
)
int
ip6_route_add
(
struct
in6_rtmsg
*
rtmsg
,
struct
nlmsghdr
*
nlh
)
{
{
int
err
;
int
err
;
struct
rtmsg
*
r
;
struct
rt6_info
*
rt
;
struct
rt6_info
*
rt
;
struct
net_device
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
int
addr_type
;
int
addr_type
;
...
@@ -648,6 +649,11 @@ int ip6_route_add(struct in6_rtmsg *rtmsg)
...
@@ -648,6 +649,11 @@ int ip6_route_add(struct in6_rtmsg *rtmsg)
rt
->
u
.
dst
.
obsolete
=
-
1
;
rt
->
u
.
dst
.
obsolete
=
-
1
;
rt
->
rt6i_expires
=
rtmsg
->
rtmsg_info
;
rt
->
rt6i_expires
=
rtmsg
->
rtmsg_info
;
if
(
nlh
&&
(
r
=
NLMSG_DATA
(
nlh
)))
{
rt
->
rt6i_protocol
=
r
->
rtm_protocol
;
}
else
{
rt
->
rt6i_protocol
=
RTPROT_BOOT
;
}
addr_type
=
ipv6_addr_type
(
&
rtmsg
->
rtmsg_dst
);
addr_type
=
ipv6_addr_type
(
&
rtmsg
->
rtmsg_dst
);
...
@@ -772,7 +778,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg)
...
@@ -772,7 +778,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg)
if
(
dst_metric
(
&
rt
->
u
.
dst
,
RTAX_ADVMSS
)
>
65535
-
20
)
if
(
dst_metric
(
&
rt
->
u
.
dst
,
RTAX_ADVMSS
)
>
65535
-
20
)
rt
->
u
.
dst
.
metrics
[
RTAX_ADVMSS
-
1
]
=
65535
;
rt
->
u
.
dst
.
metrics
[
RTAX_ADVMSS
-
1
]
=
65535
;
rt
->
u
.
dst
.
dev
=
dev
;
rt
->
u
.
dst
.
dev
=
dev
;
return
rt6_ins
(
rt
);
return
rt6_ins
(
rt
,
nlh
);
out:
out:
if
(
dev
)
if
(
dev
)
...
@@ -781,7 +787,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg)
...
@@ -781,7 +787,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg)
return
err
;
return
err
;
}
}
int
ip6_del_rt
(
struct
rt6_info
*
rt
)
int
ip6_del_rt
(
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
)
{
{
int
err
;
int
err
;
...
@@ -793,13 +799,13 @@ int ip6_del_rt(struct rt6_info *rt)
...
@@ -793,13 +799,13 @@ int ip6_del_rt(struct rt6_info *rt)
dst_release
(
&
rt
->
u
.
dst
);
dst_release
(
&
rt
->
u
.
dst
);
err
=
fib6_del
(
rt
);
err
=
fib6_del
(
rt
,
nlh
);
write_unlock_bh
(
&
rt6_lock
);
write_unlock_bh
(
&
rt6_lock
);
return
err
;
return
err
;
}
}
static
int
ip6_route_del
(
struct
in6_rtmsg
*
rtmsg
)
static
int
ip6_route_del
(
struct
in6_rtmsg
*
rtmsg
,
struct
nlmsghdr
*
nlh
)
{
{
struct
fib6_node
*
fn
;
struct
fib6_node
*
fn
;
struct
rt6_info
*
rt
;
struct
rt6_info
*
rt
;
...
@@ -826,7 +832,7 @@ static int ip6_route_del(struct in6_rtmsg *rtmsg)
...
@@ -826,7 +832,7 @@ static int ip6_route_del(struct in6_rtmsg *rtmsg)
dst_hold
(
&
rt
->
u
.
dst
);
dst_hold
(
&
rt
->
u
.
dst
);
read_unlock_bh
(
&
rt6_lock
);
read_unlock_bh
(
&
rt6_lock
);
return
ip6_del_rt
(
rt
);
return
ip6_del_rt
(
rt
,
nlh
);
}
}
}
}
read_unlock_bh
(
&
rt6_lock
);
read_unlock_bh
(
&
rt6_lock
);
...
@@ -928,11 +934,11 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
...
@@ -928,11 +934,11 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
nrt
->
u
.
dst
.
metrics
[
RTAX_ADVMSS
-
1
]
=
65535
;
nrt
->
u
.
dst
.
metrics
[
RTAX_ADVMSS
-
1
]
=
65535
;
nrt
->
rt6i_hoplimit
=
ipv6_get_hoplimit
(
neigh
->
dev
);
nrt
->
rt6i_hoplimit
=
ipv6_get_hoplimit
(
neigh
->
dev
);
if
(
rt6_ins
(
nrt
))
if
(
rt6_ins
(
nrt
,
NULL
))
goto
out
;
goto
out
;
if
(
rt
->
rt6i_flags
&
RTF_CACHE
)
{
if
(
rt
->
rt6i_flags
&
RTF_CACHE
)
{
ip6_del_rt
(
rt
);
ip6_del_rt
(
rt
,
NULL
);
return
;
return
;
}
}
...
@@ -1018,7 +1024,7 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
...
@@ -1018,7 +1024,7 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
dst_set_expires
(
&
nrt
->
u
.
dst
,
ip6_rt_mtu_expires
);
dst_set_expires
(
&
nrt
->
u
.
dst
,
ip6_rt_mtu_expires
);
nrt
->
rt6i_flags
|=
RTF_DYNAMIC
|
RTF_CACHE
|
RTF_EXPIRES
;
nrt
->
rt6i_flags
|=
RTF_DYNAMIC
|
RTF_CACHE
|
RTF_EXPIRES
;
nrt
->
u
.
dst
.
metrics
[
RTAX_MTU
-
1
]
=
pmtu
;
nrt
->
u
.
dst
.
metrics
[
RTAX_MTU
-
1
]
=
pmtu
;
rt6_ins
(
nrt
);
rt6_ins
(
nrt
,
NULL
);
}
}
out:
out:
...
@@ -1091,7 +1097,7 @@ struct rt6_info *rt6_add_dflt_router(struct in6_addr *gwaddr,
...
@@ -1091,7 +1097,7 @@ struct rt6_info *rt6_add_dflt_router(struct in6_addr *gwaddr,
rtmsg
.
rtmsg_ifindex
=
dev
->
ifindex
;
rtmsg
.
rtmsg_ifindex
=
dev
->
ifindex
;
ip6_route_add
(
&
rtmsg
);
ip6_route_add
(
&
rtmsg
,
NULL
);
return
rt6_get_dflt_router
(
gwaddr
,
dev
);
return
rt6_get_dflt_router
(
gwaddr
,
dev
);
}
}
...
@@ -1117,7 +1123,7 @@ void rt6_purge_dflt_routers(int last_resort)
...
@@ -1117,7 +1123,7 @@ void rt6_purge_dflt_routers(int last_resort)
read_unlock_bh
(
&
rt6_lock
);
read_unlock_bh
(
&
rt6_lock
);
ip6_del_rt
(
rt
);
ip6_del_rt
(
rt
,
NULL
);
goto
restart
;
goto
restart
;
}
}
...
@@ -1143,10 +1149,10 @@ int ipv6_route_ioctl(unsigned int cmd, void *arg)
...
@@ -1143,10 +1149,10 @@ int ipv6_route_ioctl(unsigned int cmd, void *arg)
rtnl_lock
();
rtnl_lock
();
switch
(
cmd
)
{
switch
(
cmd
)
{
case
SIOCADDRT
:
case
SIOCADDRT
:
err
=
ip6_route_add
(
&
rtmsg
);
err
=
ip6_route_add
(
&
rtmsg
,
NULL
);
break
;
break
;
case
SIOCDELRT
:
case
SIOCDELRT
:
err
=
ip6_route_del
(
&
rtmsg
);
err
=
ip6_route_del
(
&
rtmsg
,
NULL
);
break
;
break
;
default:
default:
err
=
-
EINVAL
;
err
=
-
EINVAL
;
...
@@ -1203,7 +1209,7 @@ int ip6_rt_addr_add(struct in6_addr *addr, struct net_device *dev)
...
@@ -1203,7 +1209,7 @@ int ip6_rt_addr_add(struct in6_addr *addr, struct net_device *dev)
ipv6_addr_copy
(
&
rt
->
rt6i_dst
.
addr
,
addr
);
ipv6_addr_copy
(
&
rt
->
rt6i_dst
.
addr
,
addr
);
rt
->
rt6i_dst
.
plen
=
128
;
rt
->
rt6i_dst
.
plen
=
128
;
rt6_ins
(
rt
);
rt6_ins
(
rt
,
NULL
);
return
0
;
return
0
;
}
}
...
@@ -1220,7 +1226,7 @@ int ip6_rt_addr_del(struct in6_addr *addr, struct net_device *dev)
...
@@ -1220,7 +1226,7 @@ int ip6_rt_addr_del(struct in6_addr *addr, struct net_device *dev)
rt
=
rt6_lookup
(
addr
,
NULL
,
loopback_dev
.
ifindex
,
1
);
rt
=
rt6_lookup
(
addr
,
NULL
,
loopback_dev
.
ifindex
,
1
);
if
(
rt
)
{
if
(
rt
)
{
if
(
rt
->
rt6i_dst
.
plen
==
128
)
if
(
rt
->
rt6i_dst
.
plen
==
128
)
err
=
ip6_del_rt
(
rt
);
err
=
ip6_del_rt
(
rt
,
NULL
);
else
else
dst_release
(
&
rt
->
u
.
dst
);
dst_release
(
&
rt
->
u
.
dst
);
}
}
...
@@ -1350,7 +1356,7 @@ int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
...
@@ -1350,7 +1356,7 @@ int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
if
(
inet6_rtm_to_rtmsg
(
r
,
arg
,
&
rtmsg
))
if
(
inet6_rtm_to_rtmsg
(
r
,
arg
,
&
rtmsg
))
return
-
EINVAL
;
return
-
EINVAL
;
return
ip6_route_del
(
&
rtmsg
);
return
ip6_route_del
(
&
rtmsg
,
nlh
);
}
}
int
inet6_rtm_newroute
(
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
void
*
arg
)
int
inet6_rtm_newroute
(
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
void
*
arg
)
...
@@ -1360,7 +1366,7 @@ int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
...
@@ -1360,7 +1366,7 @@ int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
if
(
inet6_rtm_to_rtmsg
(
r
,
arg
,
&
rtmsg
))
if
(
inet6_rtm_to_rtmsg
(
r
,
arg
,
&
rtmsg
))
return
-
EINVAL
;
return
-
EINVAL
;
return
ip6_route_add
(
&
rtmsg
);
return
ip6_route_add
(
&
rtmsg
,
nlh
);
}
}
struct
rt6_rtnl_dump_arg
struct
rt6_rtnl_dump_arg
...
@@ -1373,13 +1379,18 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
...
@@ -1373,13 +1379,18 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
struct
in6_addr
*
dst
,
struct
in6_addr
*
dst
,
struct
in6_addr
*
src
,
struct
in6_addr
*
src
,
int
iif
,
int
iif
,
int
type
,
u32
pid
,
u32
seq
)
int
type
,
u32
pid
,
u32
seq
,
struct
nlmsghdr
*
in_nlh
)
{
{
struct
rtmsg
*
rtm
;
struct
rtmsg
*
rtm
;
struct
nlmsghdr
*
nlh
;
struct
nlmsghdr
*
nlh
;
unsigned
char
*
b
=
skb
->
tail
;
unsigned
char
*
b
=
skb
->
tail
;
struct
rta_cacheinfo
ci
;
struct
rta_cacheinfo
ci
;
if
(
!
pid
&&
in_nlh
)
{
pid
=
in_nlh
->
nlmsg_pid
;
}
nlh
=
NLMSG_PUT
(
skb
,
pid
,
seq
,
type
,
sizeof
(
*
rtm
));
nlh
=
NLMSG_PUT
(
skb
,
pid
,
seq
,
type
,
sizeof
(
*
rtm
));
rtm
=
NLMSG_DATA
(
nlh
);
rtm
=
NLMSG_DATA
(
nlh
);
rtm
->
rtm_family
=
AF_INET6
;
rtm
->
rtm_family
=
AF_INET6
;
...
@@ -1395,7 +1406,7 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
...
@@ -1395,7 +1406,7 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
rtm
->
rtm_type
=
RTN_UNICAST
;
rtm
->
rtm_type
=
RTN_UNICAST
;
rtm
->
rtm_flags
=
0
;
rtm
->
rtm_flags
=
0
;
rtm
->
rtm_scope
=
RT_SCOPE_UNIVERSE
;
rtm
->
rtm_scope
=
RT_SCOPE_UNIVERSE
;
rtm
->
rtm_protocol
=
RTPROT_BOOT
;
rtm
->
rtm_protocol
=
rt
->
rt6i_protocol
;
if
(
rt
->
rt6i_flags
&
RTF_DYNAMIC
)
if
(
rt
->
rt6i_flags
&
RTF_DYNAMIC
)
rtm
->
rtm_protocol
=
RTPROT_REDIRECT
;
rtm
->
rtm_protocol
=
RTPROT_REDIRECT
;
else
if
(
rt
->
rt6i_flags
&
(
RTF_ADDRCONF
|
RTF_ALLONLINK
))
else
if
(
rt
->
rt6i_flags
&
(
RTF_ADDRCONF
|
RTF_ALLONLINK
))
...
@@ -1458,7 +1469,8 @@ static int rt6_dump_route(struct rt6_info *rt, void *p_arg)
...
@@ -1458,7 +1469,8 @@ static int rt6_dump_route(struct rt6_info *rt, void *p_arg)
struct
rt6_rtnl_dump_arg
*
arg
=
(
struct
rt6_rtnl_dump_arg
*
)
p_arg
;
struct
rt6_rtnl_dump_arg
*
arg
=
(
struct
rt6_rtnl_dump_arg
*
)
p_arg
;
return
rt6_fill_node
(
arg
->
skb
,
rt
,
NULL
,
NULL
,
0
,
RTM_NEWROUTE
,
return
rt6_fill_node
(
arg
->
skb
,
rt
,
NULL
,
NULL
,
0
,
RTM_NEWROUTE
,
NETLINK_CB
(
arg
->
cb
->
skb
).
pid
,
arg
->
cb
->
nlh
->
nlmsg_seq
);
NETLINK_CB
(
arg
->
cb
->
skb
).
pid
,
arg
->
cb
->
nlh
->
nlmsg_seq
,
NULL
);
}
}
static
int
fib6_dump_node
(
struct
fib6_walker_t
*
w
)
static
int
fib6_dump_node
(
struct
fib6_walker_t
*
w
)
...
@@ -1608,7 +1620,8 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
...
@@ -1608,7 +1620,8 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
fl
.
nl_u
.
ip6_u
.
daddr
,
fl
.
nl_u
.
ip6_u
.
daddr
,
fl
.
nl_u
.
ip6_u
.
saddr
,
fl
.
nl_u
.
ip6_u
.
saddr
,
iif
,
iif
,
RTM_NEWROUTE
,
NETLINK_CB
(
in_skb
).
pid
,
nlh
->
nlmsg_seq
);
RTM_NEWROUTE
,
NETLINK_CB
(
in_skb
).
pid
,
nlh
->
nlmsg_seq
,
nlh
);
if
(
err
<
0
)
{
if
(
err
<
0
)
{
err
=
-
EMSGSIZE
;
err
=
-
EMSGSIZE
;
goto
out_free
;
goto
out_free
;
...
@@ -1624,7 +1637,7 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
...
@@ -1624,7 +1637,7 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
goto
out
;
goto
out
;
}
}
void
inet6_rt_notify
(
int
event
,
struct
rt6_info
*
rt
)
void
inet6_rt_notify
(
int
event
,
struct
rt6_info
*
rt
,
struct
nlmsghdr
*
nlh
)
{
{
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
int
size
=
NLMSG_SPACE
(
sizeof
(
struct
rtmsg
)
+
256
);
int
size
=
NLMSG_SPACE
(
sizeof
(
struct
rtmsg
)
+
256
);
...
@@ -1634,7 +1647,7 @@ void inet6_rt_notify(int event, struct rt6_info *rt)
...
@@ -1634,7 +1647,7 @@ void inet6_rt_notify(int event, struct rt6_info *rt)
netlink_set_err
(
rtnl
,
0
,
RTMGRP_IPV6_ROUTE
,
ENOBUFS
);
netlink_set_err
(
rtnl
,
0
,
RTMGRP_IPV6_ROUTE
,
ENOBUFS
);
return
;
return
;
}
}
if
(
rt6_fill_node
(
skb
,
rt
,
NULL
,
NULL
,
0
,
event
,
0
,
0
)
<
0
)
{
if
(
rt6_fill_node
(
skb
,
rt
,
NULL
,
NULL
,
0
,
event
,
0
,
0
,
nlh
)
<
0
)
{
kfree_skb
(
skb
);
kfree_skb
(
skb
);
netlink_set_err
(
rtnl
,
0
,
RTMGRP_IPV6_ROUTE
,
EINVAL
);
netlink_set_err
(
rtnl
,
0
,
RTMGRP_IPV6_ROUTE
,
EINVAL
);
return
;
return
;
...
...
net/ipv6/xfrm6_input.c
View file @
808c8a58
...
@@ -172,6 +172,9 @@ int xfrm6_rcv(struct sk_buff **pskb)
...
@@ -172,6 +172,9 @@ int xfrm6_rcv(struct sk_buff **pskb)
if
(
x
->
props
.
replay_window
&&
xfrm_replay_check
(
x
,
seq
))
if
(
x
->
props
.
replay_window
&&
xfrm_replay_check
(
x
,
seq
))
goto
drop_unlock
;
goto
drop_unlock
;
if
(
xfrm_state_check_expire
(
x
))
goto
drop_unlock
;
nexthdr
=
x
->
type
->
input
(
x
,
&
(
xfrm_vec
[
xfrm_nr
].
decap
),
skb
);
nexthdr
=
x
->
type
->
input
(
x
,
&
(
xfrm_vec
[
xfrm_nr
].
decap
),
skb
);
if
(
nexthdr
<=
0
)
if
(
nexthdr
<=
0
)
goto
drop_unlock
;
goto
drop_unlock
;
...
...
net/ipv6/xfrm6_policy.c
View file @
808c8a58
...
@@ -203,6 +203,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
...
@@ -203,6 +203,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
/* XXX Why are there these headers? */
/* XXX Why are there these headers? */
case
IPPROTO_AH
:
case
IPPROTO_AH
:
case
IPPROTO_ESP
:
case
IPPROTO_ESP
:
case
IPPROTO_COMP
:
default:
default:
fl
->
uli_u
.
spi
=
0
;
fl
->
uli_u
.
spi
=
0
;
return
;
return
;
...
...
net/netsyms.c
View file @
808c8a58
...
@@ -234,8 +234,8 @@ EXPORT_SYMBOL(scm_detach_fds);
...
@@ -234,8 +234,8 @@ EXPORT_SYMBOL(scm_detach_fds);
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
EXPORT_SYMBOL
(
br_handle_frame_hook
);
EXPORT_SYMBOL
(
br_handle_frame_hook
);
EXPORT_SYMBOL
(
brioctl_set
);
#endif
#endif
EXPORT_SYMBOL
(
br_ioctl_hook
);
#ifdef CONFIG_NET_DIVERT
#ifdef CONFIG_NET_DIVERT
EXPORT_SYMBOL
(
alloc_divert_blk
);
EXPORT_SYMBOL
(
alloc_divert_blk
);
...
...
net/sched/sch_csz.c
View file @
808c8a58
...
@@ -749,6 +749,14 @@ csz_reset(struct Qdisc* sch)
...
@@ -749,6 +749,14 @@ csz_reset(struct Qdisc* sch)
static
void
static
void
csz_destroy
(
struct
Qdisc
*
sch
)
csz_destroy
(
struct
Qdisc
*
sch
)
{
{
struct
csz_sched_data
*
q
=
(
struct
csz_sched_data
*
)
sch
->
data
;
struct
tcf_proto
*
tp
;
while
((
tp
=
q
->
filter_list
)
!=
NULL
)
{
q
->
filter_list
=
tp
->
next
;
tp
->
ops
->
destroy
(
tp
);
}
MOD_DEC_USE_COUNT
;
MOD_DEC_USE_COUNT
;
}
}
...
...
net/sched/sch_htb.c
View file @
808c8a58
...
@@ -102,7 +102,9 @@
...
@@ -102,7 +102,9 @@
#define HTB_PASSQ q,
#define HTB_PASSQ q,
#define HTB_ARGQ struct htb_sched *q,
#define HTB_ARGQ struct htb_sched *q,
#define static
#define static
#undef __inline__
#define __inline__
#define __inline__
#undef inline
#define inline
#define inline
#define HTB_CMAGIC 0xFEFAFEF1
#define HTB_CMAGIC 0xFEFAFEF1
#define htb_safe_rb_erase(N,R) do { BUG_TRAP((N)->rb_color != -1); \
#define htb_safe_rb_erase(N,R) do { BUG_TRAP((N)->rb_color != -1); \
...
...
net/sched/sch_prio.c
View file @
808c8a58
...
@@ -158,6 +158,12 @@ prio_destroy(struct Qdisc* sch)
...
@@ -158,6 +158,12 @@ prio_destroy(struct Qdisc* sch)
{
{
int
prio
;
int
prio
;
struct
prio_sched_data
*
q
=
(
struct
prio_sched_data
*
)
sch
->
data
;
struct
prio_sched_data
*
q
=
(
struct
prio_sched_data
*
)
sch
->
data
;
struct
tcf_proto
*
tp
;
while
((
tp
=
q
->
filter_list
)
!=
NULL
)
{
q
->
filter_list
=
tp
->
next
;
tp
->
ops
->
destroy
(
tp
);
}
for
(
prio
=
0
;
prio
<
q
->
bands
;
prio
++
)
{
for
(
prio
=
0
;
prio
<
q
->
bands
;
prio
++
)
{
qdisc_destroy
(
q
->
queues
[
prio
]);
qdisc_destroy
(
q
->
queues
[
prio
]);
...
...
net/socket.c
View file @
808c8a58
...
@@ -71,6 +71,7 @@
...
@@ -71,6 +71,7 @@
#include <linux/wanrouter.h>
#include <linux/wanrouter.h>
#include <linux/netlink.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/rtnetlink.h>
#include <linux/if_bridge.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/poll.h>
#include <linux/poll.h>
#include <linux/cache.h>
#include <linux/cache.h>
...
@@ -712,7 +713,18 @@ static ssize_t sock_writev(struct file *file, const struct iovec *vector,
...
@@ -712,7 +713,18 @@ static ssize_t sock_writev(struct file *file, const struct iovec *vector,
file
,
vector
,
count
,
tot_len
);
file
,
vector
,
count
,
tot_len
);
}
}
int
(
*
br_ioctl_hook
)(
unsigned
long
arg
);
static
DECLARE_MUTEX
(
br_ioctl_mutex
);
static
int
(
*
br_ioctl_hook
)(
unsigned
long
arg
)
=
NULL
;
void
brioctl_set
(
int
(
*
hook
)(
unsigned
long
))
{
down
(
&
br_ioctl_mutex
);
br_ioctl_hook
=
hook
;
up
(
&
br_ioctl_mutex
);
}
int
(
*
vlan_ioctl_hook
)(
unsigned
long
arg
);
int
(
*
vlan_ioctl_hook
)(
unsigned
long
arg
);
#ifdef CONFIG_DLCI
#ifdef CONFIG_DLCI
...
@@ -759,12 +771,16 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -759,12 +771,16 @@ static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case
SIOCGIFBR
:
case
SIOCGIFBR
:
case
SIOCSIFBR
:
case
SIOCSIFBR
:
err
=
-
ENOPKG
;
err
=
-
ENOPKG
;
#ifdef CONFIG_KMOD
#ifdef CONFIG_KMOD
if
(
!
br_ioctl_hook
)
if
(
!
br_ioctl_hook
)
request_module
(
"bridge"
);
request_module
(
"bridge"
);
#endif
#endif
if
(
br_ioctl_hook
)
down
(
&
br_ioctl_mutex
);
if
(
br_ioctl_hook
)
err
=
br_ioctl_hook
(
arg
);
err
=
br_ioctl_hook
(
arg
);
up
(
&
br_ioctl_mutex
);
break
;
break
;
case
SIOCGIFVLAN
:
case
SIOCGIFVLAN
:
case
SIOCSIFVLAN
:
case
SIOCSIFVLAN
:
...
...
sound/core/ioctl32/pcm32.c
View file @
808c8a58
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <sound/driver.h>
#include <sound/driver.h>
#include <linux/time.h>
#include <linux/time.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <sound/core.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm.h>
#include "ioctl32.h"
#include "ioctl32.h"
...
@@ -136,15 +137,10 @@ struct sndrv_pcm_channel_info32 {
...
@@ -136,15 +137,10 @@ struct sndrv_pcm_channel_info32 {
COPY(step);\
COPY(step);\
}
}
struct
timeval32
{
s32
tv_sec
;
s32
tv_usec
;
}
__attribute__
((
packed
));
struct
sndrv_pcm_status32
{
struct
sndrv_pcm_status32
{
s32
state
;
s32
state
;
struct
timeval32
trigger_tstamp
;
struct
compat_timespec
trigger_tstamp
;
struct
timeval32
tstamp
;
struct
compat_timespec
tstamp
;
u32
appl_ptr
;
u32
appl_ptr
;
u32
hw_ptr
;
u32
hw_ptr
;
s32
delay
;
s32
delay
;
...
@@ -159,9 +155,9 @@ struct sndrv_pcm_status32 {
...
@@ -159,9 +155,9 @@ struct sndrv_pcm_status32 {
{\
{\
COPY(state);\
COPY(state);\
COPY(trigger_tstamp.tv_sec);\
COPY(trigger_tstamp.tv_sec);\
COPY(trigger_tstamp.tv_
u
sec);\
COPY(trigger_tstamp.tv_
n
sec);\
COPY(tstamp.tv_sec);\
COPY(tstamp.tv_sec);\
COPY(tstamp.tv_
u
sec);\
COPY(tstamp.tv_
n
sec);\
COPY(appl_ptr);\
COPY(appl_ptr);\
COPY(hw_ptr);\
COPY(hw_ptr);\
COPY(delay);\
COPY(delay);\
...
...
sound/core/ioctl32/rawmidi32.c
View file @
808c8a58
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <sound/driver.h>
#include <sound/driver.h>
#include <linux/time.h>
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/compat.h>
#include <sound/core.h>
#include <sound/core.h>
#include <sound/rawmidi.h>
#include <sound/rawmidi.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
...
@@ -42,14 +43,9 @@ struct sndrv_rawmidi_params32 {
...
@@ -42,14 +43,9 @@ struct sndrv_rawmidi_params32 {
COPY(no_active_sensing);\
COPY(no_active_sensing);\
}
}
struct
timeval32
{
s32
tv_sec
;
s32
tv_usec
;
}
__attribute__
((
packed
));
struct
sndrv_rawmidi_status32
{
struct
sndrv_rawmidi_status32
{
s32
stream
;
s32
stream
;
struct
timeval32
tstamp
;
struct
compat_timespec
tstamp
;
u32
avail
;
u32
avail
;
u32
xruns
;
u32
xruns
;
unsigned
char
reserved
[
16
];
unsigned
char
reserved
[
16
];
...
@@ -59,7 +55,7 @@ struct sndrv_rawmidi_status32 {
...
@@ -59,7 +55,7 @@ struct sndrv_rawmidi_status32 {
{\
{\
COPY(stream);\
COPY(stream);\
COPY(tstamp.tv_sec);\
COPY(tstamp.tv_sec);\
COPY(tstamp.tv_
u
sec);\
COPY(tstamp.tv_
n
sec);\
COPY(avail);\
COPY(avail);\
COPY(xruns);\
COPY(xruns);\
}
}
...
...
sound/core/ioctl32/timer32.c
View file @
808c8a58
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <sound/driver.h>
#include <sound/driver.h>
#include <linux/time.h>
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/compat.h>
#include <sound/core.h>
#include <sound/core.h>
#include <sound/timer.h>
#include <sound/timer.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
...
@@ -31,7 +32,7 @@ struct sndrv_timer_info32 {
...
@@ -31,7 +32,7 @@ struct sndrv_timer_info32 {
s32
card
;
s32
card
;
unsigned
char
id
[
64
];
unsigned
char
id
[
64
];
unsigned
char
name
[
80
];
unsigned
char
name
[
80
];
u32
ticks
;
u32
reserved0
;
u32
resolution
;
u32
resolution
;
unsigned
char
reserved
[
64
];
unsigned
char
reserved
[
64
];
};
};
...
@@ -42,17 +43,11 @@ struct sndrv_timer_info32 {
...
@@ -42,17 +43,11 @@ struct sndrv_timer_info32 {
COPY(card);\
COPY(card);\
memcpy(dst->id, src->id, sizeof(src->id));\
memcpy(dst->id, src->id, sizeof(src->id));\
memcpy(dst->name, src->name, sizeof(src->name));\
memcpy(dst->name, src->name, sizeof(src->name));\
COPY(ticks);\
COPY(resolution);\
COPY(resolution);\
}
}
struct
timeval32
{
s32
tv_sec
;
s32
tv_usec
;
};
struct
sndrv_timer_status32
{
struct
sndrv_timer_status32
{
struct
timeval32
tstamp
;
struct
compat_timespec
tstamp
;
u32
resolution
;
u32
resolution
;
u32
lost
;
u32
lost
;
u32
overrun
;
u32
overrun
;
...
@@ -63,7 +58,7 @@ struct sndrv_timer_status32 {
...
@@ -63,7 +58,7 @@ struct sndrv_timer_status32 {
#define CVT_sndrv_timer_status()\
#define CVT_sndrv_timer_status()\
{\
{\
COPY(tstamp.tv_sec);\
COPY(tstamp.tv_sec);\
COPY(tstamp.tv_
u
sec);\
COPY(tstamp.tv_
n
sec);\
COPY(resolution);\
COPY(resolution);\
COPY(lost);\
COPY(lost);\
COPY(overrun);\
COPY(overrun);\
...
...
sound/core/memalloc.c
View file @
808c8a58
...
@@ -205,7 +205,7 @@ int snd_dma_alloc_pages(const struct snd_dma_device *dev, size_t size,
...
@@ -205,7 +205,7 @@ int snd_dma_alloc_pages(const struct snd_dma_device *dev, size_t size,
#endif
#endif
#ifdef CONFIG_SBUS
#ifdef CONFIG_SBUS
case
SNDRV_DMA_TYPE_SBUS
:
case
SNDRV_DMA_TYPE_SBUS
:
dmab
->
area
=
snd_malloc_
pci
_pages
(
dev
->
dev
.
sbus
,
size
,
&
dmab
->
addr
);
dmab
->
area
=
snd_malloc_
sbus
_pages
(
dev
->
dev
.
sbus
,
size
,
&
dmab
->
addr
);
break
;
break
;
#endif
#endif
default:
default:
...
@@ -248,7 +248,7 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer
...
@@ -248,7 +248,7 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer
#endif
#endif
#ifdef CONFIG_SBUS
#ifdef CONFIG_SBUS
case
SNDRV_DMA_TYPE_SBUS
:
case
SNDRV_DMA_TYPE_SBUS
:
snd_free_sbus_pages
(
dev
->
dev
.
sbus
,
dmab
->
size
,
dmab
->
are
,
dmab
->
addr
);
snd_free_sbus_pages
(
dev
->
dev
.
sbus
,
dmab
->
bytes
,
dmab
->
area
,
dmab
->
addr
);
break
;
break
;
#endif
#endif
default:
default:
...
...
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