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
8ff96da6
Commit
8ff96da6
authored
Sep 21, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge davem@nuts.davemloft.net:/disk1/BK/net-2.6
into kernel.bkbits.net:/home/davem/net-2.6
parents
f465882d
3adb8bfe
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
88 deletions
+48
-88
drivers/net/loopback.c
drivers/net/loopback.c
+13
-0
drivers/net/tulip/Kconfig
drivers/net/tulip/Kconfig
+1
-3
include/linux/rtnetlink.h
include/linux/rtnetlink.h
+11
-0
net/core/rtnetlink.c
net/core/rtnetlink.c
+16
-5
net/ipv4/Kconfig
net/ipv4/Kconfig
+2
-6
net/ipv4/fib_hash.c
net/ipv4/fib_hash.c
+1
-1
net/netlink/af_netlink.c
net/netlink/af_netlink.c
+4
-73
No files found.
drivers/net/loopback.c
View file @
8ff96da6
...
...
@@ -49,6 +49,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <net/sock.h>
#include <net/checksum.h>
#include <linux/if_ether.h>
/* For the statistics structure. */
...
...
@@ -183,6 +184,17 @@ static struct net_device_stats *get_stats(struct net_device *dev)
return
stats
;
}
u32
loopback_get_link
(
struct
net_device
*
dev
)
{
return
1
;
}
static
struct
ethtool_ops
loopback_ethtool_ops
=
{
.
get_link
=
loopback_get_link
,
.
get_tso
=
ethtool_op_get_tso
,
.
set_tso
=
ethtool_op_set_tso
,
};
struct
net_device
loopback_dev
=
{
.
name
=
"lo"
,
.
mtu
=
(
16
*
1024
)
+
20
+
20
+
12
,
...
...
@@ -199,6 +211,7 @@ struct net_device loopback_dev = {
.
features
=
NETIF_F_SG
|
NETIF_F_FRAGLIST
|
NETIF_F_NO_CSUM
|
NETIF_F_HIGHDMA
|
NETIF_F_LLTX
,
.
ethtool_ops
=
&
loopback_ethtool_ops
,
};
/* Setup and register the of the LOOPBACK device. */
...
...
drivers/net/tulip/Kconfig
View file @
8ff96da6
...
...
@@ -40,9 +40,7 @@ config TULIP
(smc9332dst), you can also try the driver for "Generic DECchip"
cards, above. However, most people with a network card of this type
will say Y here.) Do read the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>. More specific
information is contained in
<file:Documentation/networking/tulip.txt>.
<http://www.tldp.org/docs.html#howto>.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will
...
...
include/linux/rtnetlink.h
View file @
8ff96da6
...
...
@@ -577,6 +577,17 @@ struct rtnl_link_stats
__u32
tx_compressed
;
};
/* The struct should be in sync with struct ifmap */
struct
rtnl_link_ifmap
{
__u64
mem_start
;
__u64
mem_end
;
__u64
base_addr
;
__u16
irq
;
__u8
dma
;
__u8
port
;
};
enum
{
IFLA_UNSPEC
,
...
...
net/core/rtnetlink.c
View file @
8ff96da6
...
...
@@ -182,7 +182,7 @@ static int rtnetlink_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
}
if
(
1
)
{
struct
ifmap
map
=
{
struct
rtnl_link_
ifmap
map
=
{
.
mem_start
=
dev
->
mem_start
,
.
mem_end
=
dev
->
mem_end
,
.
base_addr
=
dev
->
base_addr
,
...
...
@@ -277,6 +277,9 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
dev_change_flags
(
dev
,
ifm
->
ifi_flags
);
if
(
ida
[
IFLA_MAP
-
1
])
{
struct
rtnl_link_ifmap
*
u_map
;
struct
ifmap
k_map
;
if
(
!
dev
->
set_config
)
{
err
=
-
EOPNOTSUPP
;
goto
out
;
...
...
@@ -287,11 +290,19 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
goto
out
;
}
if
(
ida
[
IFLA_MAP
-
1
]
->
rta_len
!=
RTA_LENGTH
(
sizeof
(
struct
if
map
)))
if
(
ida
[
IFLA_MAP
-
1
]
->
rta_len
!=
RTA_LENGTH
(
sizeof
(
*
u_
map
)))
goto
out
;
err
=
dev
->
set_config
(
dev
,
(
struct
ifmap
*
)
RTA_DATA
(
ida
[
IFLA_MAP
-
1
]));
u_map
=
RTA_DATA
(
ida
[
IFLA_MAP
-
1
]);
k_map
.
mem_start
=
(
unsigned
long
)
u_map
->
mem_start
;
k_map
.
mem_end
=
(
unsigned
long
)
u_map
->
mem_end
;
k_map
.
base_addr
=
(
unsigned
short
)
u_map
->
base_addr
;
k_map
.
irq
=
(
unsigned
char
)
u_map
->
irq
;
k_map
.
dma
=
(
unsigned
char
)
u_map
->
dma
;
k_map
.
port
=
(
unsigned
char
)
u_map
->
port
;
err
=
dev
->
set_config
(
dev
,
&
k_map
);
if
(
err
)
goto
out
;
...
...
net/ipv4/Kconfig
View file @
8ff96da6
...
...
@@ -60,12 +60,8 @@ config IP_MULTIPLE_TABLES
Normally, a router decides what to do with a received packet based
solely on the packet's final destination address. If you say Y here,
the Linux router will also be able to take the packet's source
address into account. Furthermore, if you also say Y to "Use TOS
value as routing key" below, the TOS (Type-Of-Service) field of the
packet can be used for routing decisions as well. In addition, if
you say Y here and to "Fast network address translation" below,
the router will also be able to modify source and destination
addresses of forwarded packets.
address into account. Furthermore, the TOS (Type-Of-Service) field
of the packet can be used for routing decisions as well.
If you are interested in this, please see the preliminary
documentation at <http://www.compendium.com.ar/policy-routing.txt>
...
...
net/ipv4/fib_hash.c
View file @
8ff96da6
...
...
@@ -536,7 +536,7 @@ fn_hash_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
* information.
*/
fa_orig
=
fa
;
list_for_each_entry
(
fa
,
fa
->
fa_list
.
prev
,
fa_list
)
{
list_for_each_entry
(
fa
,
fa
_orig
->
fa_list
.
prev
,
fa_list
)
{
if
(
fa
->
fa_info
->
fib_priority
!=
fi
->
fib_priority
)
break
;
if
(
fa
->
fa_type
==
type
&&
...
...
net/netlink/af_netlink.c
View file @
8ff96da6
...
...
@@ -46,7 +46,6 @@
#include <linux/security.h>
#include <net/sock.h>
#include <net/scm.h>
#include <linux/workqueue.h>
#define Nprintk(a...)
...
...
@@ -70,14 +69,6 @@ struct netlink_opt
#define nlk_sk(__sk) ((struct netlink_opt *)(__sk)->sk_protinfo)
struct
netlink_work
{
struct
sock
*
sk
;
int
len
;
struct
work_struct
work
;
};
static
struct
workqueue_struct
*
netlink_wq
;
static
struct
hlist_head
nl_table
[
MAX_LINKS
];
static
DECLARE_WAIT_QUEUE_HEAD
(
nl_table_wait
);
static
unsigned
nl_nonroot
[
MAX_LINKS
];
...
...
@@ -96,16 +87,6 @@ static atomic_t nl_table_users = ATOMIC_INIT(0);
static
struct
notifier_block
*
netlink_chain
;
/* netlink workqueue handler */
static
void
netlink_wq_handler
(
void
*
data
)
{
struct
netlink_work
*
work
=
data
;
work
->
sk
->
sk_data_ready
(
work
->
sk
,
work
->
len
);
sock_put
(
work
->
sk
);
kfree
(
work
);
}
static
void
netlink_sock_destruct
(
struct
sock
*
sk
)
{
skb_queue_purge
(
&
sk
->
sk_receive_queue
);
...
...
@@ -497,8 +478,6 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long t
if
(
atomic_read
(
&
sk
->
sk_rmem_alloc
)
>
sk
->
sk_rcvbuf
||
test_bit
(
0
,
&
nlk
->
state
))
{
DECLARE_WAITQUEUE
(
wait
,
current
);
task_t
*
client
;
if
(
!
timeo
)
{
if
(
!
nlk
->
pid
)
netlink_overrun
(
sk
);
...
...
@@ -507,19 +486,6 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long t
return
-
EAGAIN
;
}
if
(
nlk
->
pid
)
{
/* Kernel is sending information to user space
* and socket buffer is full: Wake up user
* process */
client
=
find_task_by_pid
(
nlk
->
pid
);
if
(
!
client
)
{
sock_put
(
sk
);
kfree_skb
(
skb
);
return
-
EAGAIN
;
}
wake_up_process
(
client
);
}
__set_current_state
(
TASK_INTERRUPTIBLE
);
add_wait_queue
(
&
nlk
->
wait
,
&
wait
);
...
...
@@ -559,24 +525,8 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol)
#endif
skb_queue_tail
(
&
sk
->
sk_receive_queue
,
skb
);
if
(
!
nlk
->
pid
)
{
struct
netlink_work
*
nlwork
=
kmalloc
(
sizeof
(
struct
netlink_work
),
GFP_KERNEL
);
if
(
!
nlwork
)
{
sock_put
(
sk
);
return
-
EAGAIN
;
}
INIT_WORK
(
&
nlwork
->
work
,
netlink_wq_handler
,
nlwork
);
nlwork
->
sk
=
sk
;
nlwork
->
len
=
len
;
queue_work
(
netlink_wq
,
&
nlwork
->
work
);
}
else
{
sk
->
sk_data_ready
(
sk
,
len
);
sock_put
(
sk
);
}
sk
->
sk_data_ready
(
sk
,
len
);
sock_put
(
sk
);
return
len
;
}
...
...
@@ -623,21 +573,7 @@ static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff
skb_orphan
(
skb
);
skb_set_owner_r
(
skb
,
sk
);
skb_queue_tail
(
&
sk
->
sk_receive_queue
,
skb
);
if
(
!
nlk
->
pid
)
{
struct
netlink_work
*
nlwork
=
kmalloc
(
sizeof
(
struct
netlink_work
),
GFP_KERNEL
);
if
(
!
nlwork
)
return
-
1
;
INIT_WORK
(
&
nlwork
->
work
,
netlink_wq_handler
,
nlwork
);
nlwork
->
sk
=
sk
;
nlwork
->
len
=
skb
->
len
;
queue_work
(
netlink_wq
,
&
nlwork
->
work
);
}
else
sk
->
sk_data_ready
(
sk
,
skb
->
len
);
sk
->
sk_data_ready
(
sk
,
skb
->
len
);
return
0
;
}
return
-
1
;
...
...
@@ -683,14 +619,13 @@ int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid,
netlink_overrun
(
sk
);
/* Clone failed. Notify ALL listeners. */
failure
=
1
;
sock_put
(
sk
);
}
else
if
(
netlink_broadcast_deliver
(
sk
,
skb2
))
{
netlink_overrun
(
sk
);
sock_put
(
sk
);
}
else
{
delivered
=
1
;
skb2
=
NULL
;
}
sock_put
(
sk
);
}
netlink_unlock_table
();
...
...
@@ -1267,9 +1202,6 @@ static int __init netlink_proto_init(void)
#endif
/* The netlink device handler may be needed early. */
rtnetlink_init
();
/* Create a work queue to handle callbacks to modules */
netlink_wq
=
create_workqueue
(
"netlink"
);
return
0
;
}
...
...
@@ -1277,7 +1209,6 @@ static void __exit netlink_proto_exit(void)
{
sock_unregister
(
PF_NETLINK
);
proc_net_remove
(
"netlink"
);
destroy_workqueue
(
netlink_wq
);
}
core_initcall
(
netlink_proto_init
);
...
...
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