Commit 797df80e authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5

into kernel.bkbits.net:/home/davem/net-2.5
parents d189d057 9a98fe28
......@@ -2761,7 +2761,6 @@ ctc_init_netdevice(struct net_device * dev, int alloc_device,
dev->addr_len = 0;
dev->type = ARPHRD_SLIP;
dev->tx_queue_len = 100;
dev_init_buffers(dev);
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
return dev;
}
......
......@@ -1630,7 +1630,6 @@ netiucv_init_netdevice(int ifno, char *username)
dev->addr_len = 0;
dev->type = ARPHRD_SLIP;
dev->tx_queue_len = NETIUCV_QUEUELEN_DEFAULT;
dev_init_buffers(dev);
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
return dev;
}
......
......@@ -624,11 +624,6 @@ static inline int netif_rx_ni(struct sk_buff *skb)
return err;
}
static inline void dev_init_buffers(struct net_device *dev)
{
/* WILL BE REMOVED IN 2.5.0 */
}
extern int netdev_finish_unregister(struct net_device *dev);
static inline void dev_put(struct net_device *dev)
......
......@@ -356,7 +356,7 @@ for (pos = (head)->next;\
static inline void sctp_skb_list_tail(struct sk_buff_head *list,
struct sk_buff_head *head)
{
int flags __attribute__ ((unused));
unsigned long flags;
sctp_spin_lock_irqsave(&head->lock, flags);
sctp_spin_lock(&list->lock);
......
......@@ -744,6 +744,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
struct xfrm_policy *xfrm_policy_delete(int dir, struct xfrm_selector *sel);
struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete);
void xfrm_policy_flush(void);
u32 xfrm_get_acqseq(void);
void xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
struct xfrm_state * xfrm_find_acq(u8 mode, u16 reqid, u8 proto,
xfrm_address_t *daddr, xfrm_address_t *saddr,
......
......@@ -224,6 +224,8 @@ config IPV6
source "net/ipv6/Kconfig"
source "net/xfrm/Kconfig"
source "net/sctp/Kconfig"
config ATM
......
......@@ -14,7 +14,7 @@ obj-$(CONFIG_COMPAT) += compat.o
# LLC has to be linked before the files in net/802/
obj-$(CONFIG_LLC) += llc/
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/
obj-$(CONFIG_INET) += ipv4/
obj-$(CONFIG_INET) += ipv4/ xfrm/
obj-$(CONFIG_UNIX) += unix/
obj-$(CONFIG_IPV6) += ipv6/
obj-$(CONFIG_PACKET) += packet/
......
......@@ -362,13 +362,5 @@ config INET_ESP
If unsure, say Y.
config XFRM_USER
tristate "IP: IPsec user configuration interface"
---help---
Support for IPsec user configuration interface used
by native Linux tools.
If unsure, say Y.
source "net/ipv4/netfilter/Kconfig"
......@@ -20,6 +20,5 @@ obj-$(CONFIG_INET_AH) += ah.o
obj-$(CONFIG_INET_ESP) += esp.o
obj-$(CONFIG_IP_PNP) += ipconfig.o
obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_XFRM_USER) += xfrm_user.o
obj-y += xfrm_policy.o xfrm4_policy.o xfrm_state.o xfrm4_state.o xfrm_input.o xfrm4_input.o xfrm_algo.o
obj-y += xfrm4_policy.o xfrm4_state.o xfrm4_input.o
......@@ -1189,7 +1189,8 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
from += copy;
copied += copy;
seglen -= copy;
if ((seglen -= copy) == 0 && iovlen == 0)
goto out;
if (skb->len != mss_now || (flags & MSG_OOB))
continue;
......
......@@ -653,9 +653,6 @@ static int udpv6_rcv(struct sk_buff **pskb)
if (!pskb_may_pull(skb, sizeof(struct udphdr)))
goto short_packet;
if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
goto discard;
saddr = &skb->nh.ipv6h->saddr;
daddr = &skb->nh.ipv6h->daddr;
uh = skb->h.uh;
......@@ -713,6 +710,9 @@ static int udpv6_rcv(struct sk_buff **pskb)
sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, dev->ifindex);
if (sk == NULL) {
if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
goto discard;
if (skb->ip_summed != CHECKSUM_UNNECESSARY &&
(unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)))
goto discard;
......
......@@ -316,6 +316,7 @@ EXPORT_SYMBOL(xfrm_replay_check);
EXPORT_SYMBOL(xfrm_replay_advance);
EXPORT_SYMBOL(xfrm_check_selectors);
EXPORT_SYMBOL(__secpath_destroy);
EXPORT_SYMBOL(xfrm_get_acqseq);
EXPORT_SYMBOL(xfrm_parse_spi);
EXPORT_SYMBOL(xfrm4_rcv);
EXPORT_SYMBOL(xfrm_register_type);
......
#
# XFRM configuration
#
config XFRM_USER
tristate "IPsec user configuration interface"
depends on INET
---help---
Support for IPsec user configuration interface used
by native Linux tools.
If unsure, say Y.
#
# Makefile for the XFRM subsystem.
#
obj-y := xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o
obj-$(CONFIG_XFRM_USER) += xfrm_user.o
......@@ -429,6 +429,17 @@ struct xfrm_state * xfrm_find_acq_byseq(u32 seq)
return NULL;
}
u32 xfrm_get_acqseq(void)
{
u32 res;
static u32 acqseq;
static spinlock_t acqseq_lock = SPIN_LOCK_UNLOCKED;
spin_lock_bh(&acqseq_lock);
res = (++acqseq ? : ++acqseq);
spin_unlock_bh(&acqseq_lock);
return res;
}
void
xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi)
......
......@@ -949,19 +949,6 @@ static int xfrm_send_notify(struct xfrm_state *x, int hard)
return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_EXPIRE, GFP_ATOMIC);
}
/* XXX Make this xfrm_state.c:xfrm_get_acqseq() */
static u32 get_acqseq(void)
{
u32 res;
static u32 acqseq;
static spinlock_t acqseq_lock = SPIN_LOCK_UNLOCKED;
spin_lock_bh(&acqseq_lock);
res = (++acqseq ? : ++acqseq);
spin_unlock_bh(&acqseq_lock);
return res;
}
static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
struct xfrm_tmpl *xt, struct xfrm_policy *xp,
int dir)
......@@ -969,7 +956,7 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
struct xfrm_user_acquire *ua;
struct nlmsghdr *nlh;
unsigned char *b = skb->tail;
__u32 seq = get_acqseq();
__u32 seq = xfrm_get_acqseq();
nlh = NLMSG_PUT(skb, 0, 0, XFRM_MSG_ACQUIRE,
sizeof(*ua));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment