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
3b100d90
Commit
3b100d90
authored
Nov 23, 2007
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import 0.99.14h
parent
9d094864
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
183 additions
and
287 deletions
+183
-287
Makefile
Makefile
+19
-16
drivers/block/floppy.c
drivers/block/floppy.c
+1
-4
drivers/char/mem.c
drivers/char/mem.c
+1
-2
drivers/char/serial.c
drivers/char/serial.c
+5
-8
drivers/sound/Makefile
drivers/sound/Makefile
+2
-12
fs/devices.c
fs/devices.c
+0
-1
fs/ext/fsync.c
fs/ext/fsync.c
+0
-1
fs/ext/truncate.c
fs/ext/truncate.c
+0
-1
fs/minix/fsync.c
fs/minix/fsync.c
+0
-1
fs/minix/truncate.c
fs/minix/truncate.c
+0
-1
fs/proc/kmsg.c
fs/proc/kmsg.c
+0
-1
fs/xiafs/fsync.c
fs/xiafs/fsync.c
+0
-1
fs/xiafs/truncate.c
fs/xiafs/truncate.c
+0
-1
include/linux/sys.h
include/linux/sys.h
+3
-0
include/linux/tty.h
include/linux/tty.h
+0
-1
kernel/ptrace.c
kernel/ptrace.c
+6
-0
net/inet/loopback.c
net/inet/loopback.c
+5
-5
net/inet/raw.c
net/inet/raw.c
+0
-4
net/inet/route.c
net/inet/route.c
+140
-227
net/inet/route.h
net/inet/route.h
+1
-0
No files found.
Makefile
View file @
3b100d90
VERSION
=
0.99
VERSION
=
0.99
PATCHLEVEL
=
14
PATCHLEVEL
=
14
ALPHA
=
g
ALPHA
=
i
all
:
Version zImage
all
:
Version zImage
...
@@ -135,14 +135,13 @@ tools/version.h: $(CONFIGURE) Makefile
...
@@ -135,14 +135,13 @@ tools/version.h: $(CONFIGURE) Makefile
@
echo
\#
define LINUX_COMPILE_HOST
\"
`
hostname
`
\"
>>
tools/version.h
@
echo
\#
define LINUX_COMPILE_HOST
\"
`
hostname
`
\"
>>
tools/version.h
@
echo
\#
define LINUX_COMPILE_DOMAIN
\"
`
domainname
`
\"
>>
tools/version.h
@
echo
\#
define LINUX_COMPILE_DOMAIN
\"
`
domainname
`
\"
>>
tools/version.h
tools/build
:
$(CONFIGURE) tools/build.c
tools/build
:
tools/build.c $(CONFIGURE)
$(HOSTCC)
$(CFLAGS)
\
$(HOSTCC)
$(CFLAGS)
-o
$@
$<
-o
tools/build tools/build.c
boot/head.o
:
$(CONFIGURE) boot/head.s
boot/head.o
:
$(CONFIGURE) boot/head.s
boot/head.s
:
$(CONFIGURE) boot/head.S
include/linux/tasks.h
boot/head.s
:
boot/head.S $(CONFIGURE)
include/linux/tasks.h
$(CPP)
-traditional
boot/head.S
-o
boot/head.s
$(CPP)
-traditional
$<
-o
$@
tools/version.o
:
tools/version.c tools/version.h
tools/version.o
:
tools/version.c tools/version.h
...
@@ -159,19 +158,23 @@ tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs
...
@@ -159,19 +158,23 @@ tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs
nm tools/zSystem |
grep
-v
'\(compiled\)\|\(\.o$$\)\|\( a \)'
|
\
nm tools/zSystem |
grep
-v
'\(compiled\)\|\(\.o$$\)\|\( a \)'
|
\
sort
>
System.map
sort
>
System.map
boot/setup
:
boot/setup.s
boot/setup
:
boot/setup.o
$(AS86)
-o
boot/setup.o boot/setup.s
$(LD86)
-s
-o
$@
$<
$(LD86)
-s
-o
boot/setup boot/setup.o
boot/setup.
s
:
$(CONFIGURE) boot/setup.S include/linux/config.h Makefile
boot/setup.
o
:
boot/setup.s
$(
CPP)
-traditional
$(SVGA_MODE)
$(RAMDISK)
boot/setup.S
-o
boot/setup.s
$(
AS86)
-o
$@
$<
boot/
bootsect.s
:
$(CONFIGURE) boot/bootsect.S
include/linux/config.h Makefile
boot/
setup.s
:
boot/setup.S $(CONFIGURE)
include/linux/config.h Makefile
$(CPP)
-traditional
$(SVGA_MODE)
$(RAMDISK)
boot/bootsect.S
-o
boot/bootsect.s
$(CPP)
-traditional
$(SVGA_MODE)
$(RAMDISK)
$<
-o
$@
boot/bootsect
:
boot/bootsect.s
boot/bootsect
:
boot/bootsect.o
$(AS86)
-o
boot/bootsect.o boot/bootsect.s
$(LD86)
-s
-o
$@
$<
$(LD86)
-s
-o
boot/bootsect boot/bootsect.o
boot/bootsect.o
:
boot/bootsect.s
$(AS86)
-o
$@
$<
boot/bootsect.s
:
boot/bootsect.S $(CONFIGURE) include/linux/config.h Makefile
$(CPP)
-traditional
$(SVGA_MODE)
$(RAMDISK)
$<
-o
$@
zBoot/zSystem
:
zBoot/*.c zBoot/*.S tools/zSystem
zBoot/zSystem
:
zBoot/*.c zBoot/*.S tools/zSystem
$(MAKE)
-C
zBoot
$(MAKE)
-C
zBoot
...
...
drivers/block/floppy.c
View file @
3b100d90
...
@@ -419,10 +419,7 @@ int floppy_change(struct buffer_head * bh)
...
@@ -419,10 +419,7 @@ int floppy_change(struct buffer_head * bh)
bh
->
b_uptodate
=
0
;
bh
->
b_uptodate
=
0
;
ll_rw_block
(
READ
,
1
,
&
bh
);
ll_rw_block
(
READ
,
1
,
&
bh
);
}
}
cli
();
wait_on_buffer
(
bh
);
while
(
bh
->
b_lock
)
sleep_on
(
&
bh
->
b_wait
);
sti
();
if
(
changed_floppies
&
mask
)
{
if
(
changed_floppies
&
mask
)
{
changed_floppies
&=
~
mask
;
changed_floppies
&=
~
mask
;
recalibrate
=
1
;
recalibrate
=
1
;
...
...
drivers/char/mem.c
View file @
3b100d90
...
@@ -196,8 +196,7 @@ static int mmap_zero(struct inode * inode, struct file * file,
...
@@ -196,8 +196,7 @@ static int mmap_zero(struct inode * inode, struct file * file,
mpnt
->
vm_end
=
addr
+
len
;
mpnt
->
vm_end
=
addr
+
len
;
mpnt
->
vm_page_prot
=
prot
;
mpnt
->
vm_page_prot
=
prot
;
mpnt
->
vm_share
=
NULL
;
mpnt
->
vm_share
=
NULL
;
mpnt
->
vm_inode
=
inode
;
mpnt
->
vm_inode
=
NULL
;
inode
->
i_count
++
;
mpnt
->
vm_offset
=
off
;
mpnt
->
vm_offset
=
off
;
mpnt
->
vm_ops
=
NULL
;
mpnt
->
vm_ops
=
NULL
;
insert_vm_struct
(
current
,
mpnt
);
insert_vm_struct
(
current
,
mpnt
);
...
...
drivers/char/serial.c
View file @
3b100d90
...
@@ -1573,7 +1573,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
...
@@ -1573,7 +1573,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
*/
*/
if
(
info
->
flags
&
ASYNC_CLOSING
)
{
if
(
info
->
flags
&
ASYNC_CLOSING
)
{
interruptible_sleep_on
(
&
info
->
close_wait
);
interruptible_sleep_on
(
&
info
->
close_wait
);
return
-
E
RESTARTNOINTR
;
return
-
E
AGAIN
;
}
}
/*
/*
...
@@ -1631,10 +1631,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
...
@@ -1631,10 +1631,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
current
->
state
=
TASK_INTERRUPTIBLE
;
current
->
state
=
TASK_INTERRUPTIBLE
;
if
(
tty_hung_up_p
(
filp
)
||
if
(
tty_hung_up_p
(
filp
)
||
!
(
info
->
flags
&
ASYNC_INITIALIZED
))
{
!
(
info
->
flags
&
ASYNC_INITIALIZED
))
{
if
(
info
->
flags
&
ASYNC_HUP_NOTIFY
)
retval
=
-
EAGAIN
;
retval
=
-
EAGAIN
;
else
retval
=
-
ERESTARTNOINTR
;
break
;
break
;
}
}
if
(
!
(
info
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
&&
if
(
!
(
info
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
&&
...
@@ -1696,10 +1693,10 @@ int rs_open(struct tty_struct *tty, struct file * filp)
...
@@ -1696,10 +1693,10 @@ int rs_open(struct tty_struct *tty, struct file * filp)
tty
->
stop
=
rs_stop
;
tty
->
stop
=
rs_stop
;
tty
->
start
=
rs_start
;
tty
->
start
=
rs_start
;
tty
->
hangup
=
rs_hangup
;
tty
->
hangup
=
rs_hangup
;
if
(
info
->
flags
&
ASYNC_SPLIT_TERMIOS
)
{
if
(
(
info
->
count
==
1
)
&&
(
info
->
flags
&
ASYNC_SPLIT_TERMIOS
)
)
{
if
(
info
->
flags
&
ASYNC_NORMAL_ACTIVE
)
if
(
MAJOR
(
filp
->
f_rdev
)
==
4
)
*
tty
->
termios
=
info
->
normal_termios
;
*
tty
->
termios
=
info
->
normal_termios
;
if
(
info
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
else
*
tty
->
termios
=
info
->
callout_termios
;
*
tty
->
termios
=
info
->
callout_termios
;
}
}
/*
/*
...
...
drivers/sound/Makefile
View file @
3b100d90
...
@@ -28,11 +28,6 @@ all: local.h sound.a
...
@@ -28,11 +28,6 @@ all: local.h sound.a
@
echo
"Please make a new /usr/include/sys/soundcard.h containing
@
echo
"Please make a new /usr/include/sys/soundcard.h containing
@
echo "
just a line
#include <linux/soundcard.h>"
@
echo "
just a line
#include <linux/soundcard.h>"
os.h
:
@
$(MAKE)
setup-
$(TARGET_OS)
@
$(MAKE)
config
@
$(MAKE)
dep
sound.a
:
$(OBJS)
sound.a
:
$(OBJS)
-
rm
-f
sound.a
-
rm
-f
sound.a
$(AR)
rcs sound.a
$(OBJS)
$(AR)
rcs sound.a
$(OBJS)
...
@@ -40,7 +35,7 @@ sound.a: $(OBJS)
...
@@ -40,7 +35,7 @@ sound.a: $(OBJS)
clean
:
clean
:
rm
-f
core core.
*
*
.o
*
.a tmp_make
*
~ x z
*
%
rm
-f
core core.
*
*
.o
*
.a tmp_make
*
~ x z
*
%
rm
-f
configure
Makefile
sound_stub.c
rm
-f
configure sound_stub.c
for
i
in
*
.c
;
do
rm
-f
`
basename
$$
i .c
`
.s
;
done
for
i
in
*
.c
;
do
rm
-f
`
basename
$$
i .c
`
.s
;
done
indent
:
indent
:
...
@@ -48,15 +43,10 @@ indent:
...
@@ -48,15 +43,10 @@ indent:
local.h
:
local.h
:
$(MAKE)
clean
$(MAKE)
clean
$(MAKE)
setup-
$(TARGET_OS)
$(MAKE)
config
$(MAKE)
config
$(MAKE)
dep
$(MAKE)
dep
soundcard.c
:
$(TARGET_OS)/soundcard.c
ln
-sf
$(TARGET_OS)
/soundcard.c soundcard.c
config
:
configure /usr/include/sys/soundcard.h
config
:
configure /usr/include/sys/soundcard.h
@
$(MAKE)
setup-
$(TARGET_OS)
@
echo
Compiling Sound Driver v
$(VERSION)
for
Linux
@
echo
Compiling Sound Driver v
$(VERSION)
for
Linux
@
./configure
>
local.h
@
./configure
>
local.h
@
echo
\#
define SOUND_VERSION_STRING
\"
$(VERSION)
\"
>>
local.h
@
echo
\#
define SOUND_VERSION_STRING
\"
$(VERSION)
\"
>>
local.h
...
@@ -66,7 +56,7 @@ config: configure /usr/include/sys/soundcard.h
...
@@ -66,7 +56,7 @@ config: configure /usr/include/sys/soundcard.h
@
echo
\#
define SOUND_CONFIG_DOMAIN
\"
`
domainname
`
\"
>>
local.h
@
echo
\#
define SOUND_CONFIG_DOMAIN
\"
`
domainname
`
\"
>>
local.h
clrconf
:
clrconf
:
rm
-f
local.h .depend
os.h soundcard.c
rm
-f
local.h .depend
configure
:
configure.c /usr/include/sys/soundcard.h
configure
:
configure.c /usr/include/sys/soundcard.h
$(HOSTCC)
-o
configure configure.c
$(HOSTCC)
-o
configure configure.c
...
...
fs/devices.c
View file @
3b100d90
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#include <linux/string.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/ext_fs.h>
#include <linux/ext_fs.h>
#include <linux/tty.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
#include <linux/errno.h>
#include <linux/errno.h>
...
...
fs/ext/fsync.c
View file @
3b100d90
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
#include <linux/locks.h>
#include <linux/locks.h>
...
...
fs/ext/truncate.c
View file @
3b100d90
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/ext_fs.h>
#include <linux/ext_fs.h>
#include <linux/tty.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
#include <linux/errno.h>
#include <linux/errno.h>
...
...
fs/minix/fsync.c
View file @
3b100d90
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
#include <linux/locks.h>
#include <linux/locks.h>
...
...
fs/minix/truncate.c
View file @
3b100d90
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/minix_fs.h>
#include <linux/minix_fs.h>
#include <linux/tty.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
...
...
fs/proc/kmsg.c
View file @
3b100d90
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <asm/segment.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <asm/io.h>
...
...
fs/xiafs/fsync.c
View file @
3b100d90
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
#include <linux/locks.h>
#include <linux/locks.h>
...
...
fs/xiafs/truncate.c
View file @
3b100d90
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/xia_fs.h>
#include <linux/xia_fs.h>
#include <linux/tty.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
...
...
include/linux/sys.h
View file @
3b100d90
#ifndef _LINUX_SYS_H
#define _LINUX_SYS_H
/*
/*
* system call entry points
* system call entry points
*/
*/
...
@@ -170,3 +172,4 @@ typedef int (*fn_ptr)();
...
@@ -170,3 +172,4 @@ typedef int (*fn_ptr)();
}
}
#endif
#endif
#endif
include/linux/tty.h
View file @
3b100d90
...
@@ -97,7 +97,6 @@ struct serial_struct {
...
@@ -97,7 +97,6 @@ struct serial_struct {
/*
/*
* Definitions for async_struct (and serial_struct) flags field
* Definitions for async_struct (and serial_struct) flags field
*/
*/
#define ASYNC_HUP_NOTIFY 0x0001
/* Notify blocked open on hangups */
#define ASYNC_FOURPORT 0x0002
/* Set OU1, OUT2 per AST Fourport settings */
#define ASYNC_FOURPORT 0x0002
/* Set OU1, OUT2 per AST Fourport settings */
#define ASYNC_SAK 0x0004
/* Secure Attention Key (Orange book) */
#define ASYNC_SAK 0x0004
/* Secure Attention Key (Orange book) */
#define ASYNC_SPLIT_TERMIOS 0x0008
/* Separate termios for dialin/callout */
#define ASYNC_SPLIT_TERMIOS 0x0008
/* Separate termios for dialin/callout */
...
...
kernel/ptrace.c
View file @
3b100d90
...
@@ -101,6 +101,9 @@ static unsigned long get_long(struct task_struct * tsk,
...
@@ -101,6 +101,9 @@ static unsigned long get_long(struct task_struct * tsk,
do_no_page
(
0
,
addr
,
tsk
,
0
);
do_no_page
(
0
,
addr
,
tsk
,
0
);
goto
repeat
;
goto
repeat
;
}
}
/* this is a hack for non-kernel-mapped video buffers and similar */
if
(
page
>=
high_memory
)
return
0
;
page
&=
PAGE_MASK
;
page
&=
PAGE_MASK
;
page
+=
addr
&
~
PAGE_MASK
;
page
+=
addr
&
~
PAGE_MASK
;
return
*
(
unsigned
long
*
)
page
;
return
*
(
unsigned
long
*
)
page
;
...
@@ -139,6 +142,9 @@ static void put_long(struct task_struct * tsk, unsigned long addr,
...
@@ -139,6 +142,9 @@ static void put_long(struct task_struct * tsk, unsigned long addr,
do_wp_page
(
PAGE_RW
|
PAGE_PRESENT
,
addr
,
tsk
,
0
);
do_wp_page
(
PAGE_RW
|
PAGE_PRESENT
,
addr
,
tsk
,
0
);
goto
repeat
;
goto
repeat
;
}
}
/* this is a hack for non-kernel-mapped video buffers and similar */
if
(
page
>=
high_memory
)
return
;
/* we're bypassing pagetables, so we have to set the dirty bit ourselves */
/* we're bypassing pagetables, so we have to set the dirty bit ourselves */
*
(
unsigned
long
*
)
pte
|=
(
PAGE_DIRTY
|
PAGE_COW
);
*
(
unsigned
long
*
)
pte
|=
(
PAGE_DIRTY
|
PAGE_COW
);
page
&=
PAGE_MASK
;
page
&=
PAGE_MASK
;
...
...
net/inet/loopback.c
View file @
3b100d90
...
@@ -16,22 +16,22 @@
...
@@ -16,22 +16,22 @@
* as published by the Free Software Foundation; either version
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* 2 of the License, or (at your option) any later version.
*/
*/
#include <asm/system.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <linux/config.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/tty.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/string.h>
#include <linux/socket.h>
#include <linux/socket.h>
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
#include <linux/in.h>
#include <linux/in.h>
#include <linux/if_ether.h>
/* For the statistics structure. */
#include <linux/if_ether.h>
/* For the statistics structure. */
#include <asm/system.h>
#include <asm/segment.h>
#include <asm/io.h>
#include "inet.h"
#include "inet.h"
#include "dev.h"
#include "dev.h"
#include "eth.h"
#include "eth.h"
...
...
net/inet/raw.c
View file @
3b100d90
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
* Alan Cox : Checks sk->broadcast.
* Alan Cox : Checks sk->broadcast.
* Alan Cox : Uses skb_free_datagram/skb_copy_datagram
* Alan Cox : Uses skb_free_datagram/skb_copy_datagram
* Alan Cox : Raw passes ip options too
* Alan Cox : Raw passes ip options too
* Gerhard Koerting: Pass the right part of the data!
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
@@ -113,9 +112,6 @@ raw_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
...
@@ -113,9 +112,6 @@ raw_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
skb
->
sk
=
sk
;
skb
->
sk
=
sk
;
skb
->
len
=
len
;
skb
->
len
=
len
;
skb
->
dev
=
dev
;
skb
->
dev
=
dev
;
/* Undo IP's work and go get the IP header back [HACK] */
skb
->
h
.
raw
=
((
char
*
)(
skb
+
1
))
+
dev
->
hard_header_len
;
skb
->
len
+=
skb
->
h
.
iph
->
ihl
*
sizeof
(
long
);
skb
->
saddr
=
daddr
;
skb
->
saddr
=
daddr
;
skb
->
daddr
=
saddr
;
skb
->
daddr
=
saddr
;
...
...
net/inet/route.c
View file @
3b100d90
...
@@ -62,222 +62,143 @@ rt_print(struct rtable *rt)
...
@@ -62,222 +62,143 @@ rt_print(struct rtable *rt)
}
}
/* Remove a routing table entry. */
/*
static
void
* Remove a routing table entry.
rt_del
(
unsigned
long
dst
)
*/
static
void
rt_del
(
unsigned
long
dst
)
{
{
struct
rtable
*
r
,
*
x
,
*
p
;
struct
rtable
*
r
,
**
rp
;
unsigned
long
flags
;
unsigned
long
flags
;
DPRINTF
((
DBG_RT
,
"RT: flushing for dst %s
\n
"
,
in_ntoa
(
dst
)));
DPRINTF
((
DBG_RT
,
"RT: flushing for dst %s
\n
"
,
in_ntoa
(
dst
)));
if
((
r
=
rt_base
)
==
NULL
)
rp
=
&
rt_base
;
return
;
save_flags
(
flags
);
cli
();
save_flags
(
flags
);
while
((
r
=
*
rp
)
!=
NULL
)
{
cli
();
if
(
r
->
rt_dst
!=
dst
)
{
p
=
NULL
;
rp
=
&
r
->
rt_next
;
while
(
r
!=
NULL
)
continue
;
{
}
if
(
r
->
rt_dst
==
dst
)
*
rp
=
r
->
rt_next
;
{
if
(
p
==
NULL
)
rt_base
=
r
->
rt_next
;
else
p
->
rt_next
=
r
->
rt_next
;
x
=
r
->
rt_next
;
kfree_s
(
r
,
sizeof
(
struct
rtable
));
kfree_s
(
r
,
sizeof
(
struct
rtable
));
r
=
x
;
}
}
else
restore_flags
(
flags
);
{
p
=
r
;
r
=
r
->
rt_next
;
}
}
restore_flags
(
flags
);
}
}
/* Remove all routing table entries for a device. */
/*
void
* Remove all routing table entries for a device.
rt_flush
(
struct
device
*
dev
)
*/
void
rt_flush
(
struct
device
*
dev
)
{
{
struct
rtable
*
r
,
*
x
,
*
p
;
struct
rtable
*
r
;
unsigned
long
flags
;
struct
rtable
**
rp
;
unsigned
long
flags
;
DPRINTF
((
DBG_RT
,
"RT: flushing for dev 0x%08lx (%s)
\n
"
,
(
long
)
dev
,
dev
->
name
));
if
((
r
=
rt_base
)
==
NULL
)
return
;
DPRINTF
((
DBG_RT
,
"RT: flushing for dev 0x%08lx (%s)
\n
"
,
(
long
)
dev
,
dev
->
name
));
rp
=
&
rt_base
;
cli
();
cli
();
save_flags
(
flags
);
save_flags
(
flags
);
while
((
r
=
*
rp
)
!=
NULL
)
{
p
=
NULL
;
if
(
r
->
rt_dev
!=
dev
)
{
while
(
r
!=
NULL
)
rp
=
&
r
->
rt_next
;
{
continue
;
if
(
r
->
rt_dev
==
dev
)
}
{
*
rp
=
r
->
rt_next
;
if
(
p
==
NULL
)
rt_base
=
r
->
rt_next
;
else
p
->
rt_next
=
r
->
rt_next
;
x
=
r
->
rt_next
;
kfree_s
(
r
,
sizeof
(
struct
rtable
));
kfree_s
(
r
,
sizeof
(
struct
rtable
));
r
=
x
;
}
}
else
restore_flags
(
flags
);
{
p
=
r
;
r
=
r
->
rt_next
;
}
}
restore_flags
(
flags
);
}
}
/*
* Used by 'rt_add()' when we can't get the netmask from the device..
*/
static
unsigned
long
guess_mask
(
unsigned
long
dst
)
{
unsigned
long
mask
=
0xffffffff
;
while
(
mask
&
dst
)
mask
<<=
8
;
return
~
mask
;
}
/*
* rewrote rt_add(), as the old one was weird. Linus
*/
void
void
rt_add
(
short
flags
,
unsigned
long
dst
,
unsigned
long
gw
,
struct
device
*
dev
)
rt_add
(
short
flags
,
unsigned
long
dst
,
unsigned
long
gw
,
struct
device
*
dev
)
{
{
struct
rtable
*
r
,
*
r1
;
struct
rtable
*
r
,
*
rt
;
struct
rtable
*
rt
;
struct
rtable
**
rp
;
int
mask
=
0
;
unsigned
long
mask
;
unsigned
long
cpuflags
;
unsigned
long
cpuflags
;
/* Allocate an entry. */
/* Allocate an entry. */
rt
=
(
struct
rtable
*
)
kmalloc
(
sizeof
(
struct
rtable
),
GFP_ATOMIC
);
rt
=
(
struct
rtable
*
)
kmalloc
(
sizeof
(
struct
rtable
),
GFP_ATOMIC
);
if
(
rt
==
NULL
)
{
if
(
rt
==
NULL
)
{
DPRINTF
((
DBG_RT
,
"RT: no memory for new route!
\n
"
));
DPRINTF
((
DBG_RT
,
"RT: no memory for new route!
\n
"
));
return
;
return
;
}
}
/* Fill in the fields. */
/* Fill in the fields. */
memset
(
rt
,
0
,
sizeof
(
struct
rtable
));
memset
(
rt
,
0
,
sizeof
(
struct
rtable
));
rt
->
rt_flags
=
(
flags
|
RTF_UP
);
rt
->
rt_flags
=
(
flags
|
RTF_UP
);
/*
* Gateway to our own interface is really direct
/*
*/
* Gateway to our own interface is really direct
if
(
gw
==
dev
->
pa_addr
||
gw
==
dst
)
{
*/
gw
=
0
;
if
(
gw
==
dev
->
pa_addr
||
gw
==
dst
)
rt
->
rt_flags
&=~
RTF_GATEWAY
;
{
}
gw
=
0
;
if
(
gw
!=
0
)
rt
->
rt_flags
&=~
RTF_GATEWAY
;
rt
->
rt_flags
|=
RTF_GATEWAY
;
}
rt
->
rt_dev
=
dev
;
rt
->
rt_gateway
=
gw
;
if
(
gw
!=
0
)
if
(
flags
&
RTF_HOST
)
{
rt
->
rt_flags
|=
RTF_GATEWAY
;
mask
=
0xffffffff
;
rt
->
rt_dev
=
dev
;
rt
->
rt_dst
=
dst
;
rt
->
rt_gateway
=
gw
;
}
else
{
if
(
!
((
dst
^
dev
->
pa_addr
)
&
dev
->
pa_mask
))
{
/*
mask
=
dev
->
pa_mask
;
* If this is coming from an ICMP redirect message, truncate
dst
&=
mask
;
* the TARGET if we are creating an entry for a NETWORK. Use
if
(
flags
&
RTF_DYNAMIC
)
{
* an Internet class C network mask. Yuck :-(
kfree_s
(
rt
,
sizeof
(
struct
rtable
));
*/
/*printk("Dynamic route to my own net rejected\n");*/
if
(
flags
&
RTF_DYNAMIC
)
return
;
{
}
if
(
flags
&
RTF_HOST
)
}
else
mask
=
guess_mask
(
dst
);
rt
->
rt_dst
=
dst
;
rt
->
rt_dst
=
dst
;
else
{
/* Cut down to the route at interface mask level */
rt
->
rt_dst
=
(
dst
&
dev
->
pa_mask
);
mask
=
dev
->
pa_mask
;
/* We don't want new routes to our own net*/
if
(
rt
->
rt_dst
==
(
dev
->
pa_addr
&
dev
->
pa_mask
))
{
kfree_s
(
rt
,
sizeof
(
struct
rtable
));
/*printk("Dynamic route to my own net rejected\n");*/
return
;
}
}
}
}
rt
->
rt_mask
=
mask
;
else
rt_print
(
rt
);
rt
->
rt_dst
=
dst
;
/*
* What we have to do is loop though this until we have
rt_print
(
rt
);
* found the first address which has a higher generality than
* the one in rt. Then we can put rt in right before it.
if
(
rt_base
==
NULL
)
*/
{
save_flags
(
cpuflags
);
rt
->
rt_next
=
NULL
;
cli
();
rt_base
=
rt
;
/* remove old route if we are getting a duplicate. */
return
;
rp
=
&
rt_base
;
}
while
((
r
=
*
rp
)
!=
NULL
)
{
if
(
r
->
rt_dst
!=
dst
)
{
/*
rp
=
&
r
->
rt_next
;
* What we have to do is loop though this until we have
continue
;
* found the first address which has the same generality
}
* as the one in rt. Then we can put rt in after it.
*
rp
=
r
->
rt_next
;
*/
if
(
mask
==
0
)
/* Dont figure out masks for DYNAMIC routes. The mask is (our should be!)
the device mask (obtained above) */
{
for
(
mask
=
0xff000000L
;
mask
!=
0xffffffffL
;
mask
=
(
mask
>>
8
)
|
mask
)
{
if
(
mask
&
dst
)
{
mask
=
mask
<<
8
;
break
;
}
}
DPRINTF
((
DBG_RT
,
"RT: mask = %X
\n
"
,
mask
));
}
save_flags
(
cpuflags
);
cli
();
r1
=
rt_base
;
/* See if we are getting a duplicate. */
for
(
r
=
rt_base
;
r
!=
NULL
;
r
=
r
->
rt_next
)
{
if
(
r
->
rt_dst
==
dst
)
{
if
(
r
==
rt_base
)
{
rt
->
rt_next
=
r
->
rt_next
;
rt_base
=
rt
;
}
else
{
rt
->
rt_next
=
r
->
rt_next
;
r1
->
rt_next
=
rt
;
}
kfree_s
(
r
,
sizeof
(
struct
rtable
));
kfree_s
(
r
,
sizeof
(
struct
rtable
));
restore_flags
(
cpuflags
);
return
;
}
}
r1
=
r
;
/* add the new route */
}
rp
=
&
rt_base
;
while
((
r
=
*
rp
)
!=
NULL
)
{
r1
=
rt_base
;
if
((
r
->
rt_mask
&
mask
)
!=
mask
)
for
(
r
=
rt_base
;
r
!=
NULL
;
r
=
r
->
rt_next
)
break
;
{
rp
=
&
r
->
rt_next
;
/* When we find a route more general than ourselves, and we are not a gateway or it is a gateway then use it
This puts gateways after direct links in the table and sorts (most) of the bit aligned subnetting out */
if
(
!
(
r
->
rt_dst
&
mask
)
&&
(
gw
==
0
||
r
->
rt_flags
&
RTF_GATEWAY
))
{
DPRINTF
((
DBG_RT
,
"RT: adding before r=%X
\n
"
,
r
));
rt_print
(
r
);
if
(
r
==
rt_base
)
{
rt
->
rt_next
=
rt_base
;
rt_base
=
rt
;
restore_flags
(
cpuflags
);
return
;
}
rt
->
rt_next
=
r
;
r1
->
rt_next
=
rt
;
restore_flags
(
cpuflags
);
return
;
}
}
r1
=
r
;
rt
->
rt_next
=
r
;
}
*
rp
=
rt
;
DPRINTF
((
DBG_RT
,
"RT: adding after r1=%X
\n
"
,
r1
));
restore_flags
(
cpuflags
);
rt_print
(
r1
);
return
;
/* Goes at the end. */
rt
->
rt_next
=
NULL
;
r1
->
rt_next
=
rt
;
}
}
...
@@ -360,16 +281,18 @@ rt_get_info(char *buffer)
...
@@ -360,16 +281,18 @@ rt_get_info(char *buffer)
}
}
struct
rtable
*
/*
rt_route
(
unsigned
long
daddr
,
struct
options
*
opt
)
* rewrote this too.. Maybe somebody can understand it now. Linus
*/
struct
rtable
*
rt_route
(
unsigned
long
daddr
,
struct
options
*
opt
)
{
{
struct
rtable
*
rt
;
struct
rtable
*
rt
;
int
type
;
int
type
;
/*
/*
* This is a hack, I think. -FvK
* This is a hack, I think. -FvK
*/
*/
if
((
type
=
chk_addr
(
daddr
))
==
IS_MYADDR
)
daddr
=
my_addr
();
if
((
type
=
chk_addr
(
daddr
))
==
IS_MYADDR
)
daddr
=
my_addr
();
/*
/*
* Loop over the IP routing table to find a route suitable
* Loop over the IP routing table to find a route suitable
...
@@ -377,33 +300,23 @@ rt_route(unsigned long daddr, struct options *opt)
...
@@ -377,33 +300,23 @@ rt_route(unsigned long daddr, struct options *opt)
* at the IP options to see if we have been given a hint as
* at the IP options to see if we have been given a hint as
* to what kind of path we should use... -FvK
* to what kind of path we should use... -FvK
*/
*/
for
(
rt
=
rt_base
;
rt
!=
NULL
;
rt
=
rt
->
rt_next
)
/*
if
((
rt
->
rt_flags
&
RTF_HOST
)
&&
rt
->
rt_dst
==
daddr
)
{
* This depends on 'rt_mask' and the ordering set up in 'rt_add()' - Linus
DPRINTF
((
DBG_RT
,
"%s (%s)
\n
"
,
*/
rt
->
rt_dev
->
name
,
in_ntoa
(
rt
->
rt_gateway
)));
for
(
rt
=
rt_base
;
rt
!=
NULL
;
rt
=
rt
->
rt_next
)
{
rt
->
rt_use
++
;
if
(
!
((
rt
->
rt_dst
^
daddr
)
&
rt
->
rt_mask
))
{
return
(
rt
);
rt
->
rt_use
++
;
}
return
rt
;
for
(
rt
=
rt_base
;
rt
!=
NULL
;
rt
=
rt
->
rt_next
)
{
}
DPRINTF
((
DBG_RT
,
"RT: %s via "
,
in_ntoa
(
daddr
)));
/* broadcast addresses can be special cases.. */
if
(
!
(
rt
->
rt_flags
&
RTF_HOST
)
&&
ip_addr_match
(
rt
->
rt_dst
,
daddr
))
{
if
((
rt
->
rt_dev
->
flags
&
IFF_BROADCAST
)
&&
DPRINTF
((
DBG_RT
,
"%s (%s)
\n
"
,
rt
->
rt_dev
->
pa_brdaddr
==
daddr
)
{
rt
->
rt_dev
->
name
,
in_ntoa
(
rt
->
rt_gateway
)));
rt
->
rt_use
++
;
rt
->
rt_use
++
;
return
(
rt
);
return
(
rt
);
}
}
if
((
rt
->
rt_dev
->
flags
&
IFF_BROADCAST
)
&&
rt
->
rt_dev
->
pa_brdaddr
==
daddr
)
{
DPRINTF
((
DBG_RT
,
"%s (BCAST %s)
\n
"
,
rt
->
rt_dev
->
name
,
in_ntoa
(
rt
->
rt_dev
->
pa_brdaddr
)));
rt
->
rt_use
++
;
return
(
rt
);
}
}
}
return
NULL
;
}
DPRINTF
((
DBG_RT
,
"NONE
\n
"
));
return
(
NULL
);
};
int
int
...
...
net/inet/route.h
View file @
3b100d90
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
struct
rtable
{
struct
rtable
{
struct
rtable
*
rt_next
;
struct
rtable
*
rt_next
;
unsigned
long
rt_dst
;
unsigned
long
rt_dst
;
unsigned
long
rt_mask
;
unsigned
long
rt_gateway
;
unsigned
long
rt_gateway
;
u_char
rt_flags
;
u_char
rt_flags
;
u_char
rt_metric
;
u_char
rt_metric
;
...
...
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