提交 3d412f60 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
  [PKT_SCHED]: vlan tag match
  [NET]: Add if_addrlabel.h to sanitized headers.
  [NET] rtnetlink.c: remove no longer used functions
  [ICMP]: Restore pskb_pull calls in receive function
  [INET]: Fix accidentally broken inet(6)_hash_connect's port offset calculations.
  [NET]: Remove further references to net-modules.txt
  bluetooth rfcomm tty: destroy before tty_close()
  bluetooth: blacklist another Broadcom BCM2035 device
  drivers/bluetooth/btsdio.c: fix double-free
  drivers/bluetooth/bpa10x.c: fix memleak
  bluetooth: uninlining
  bluetooth: hidp_process_hid_control remove unnecessary parameter dealing
  tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI
  hamradio: fix dmascc section mismatch
  [SCTP]: Fix kernel panic while received AUTH chunk with BAD shared key identifier
  [SCTP]: Fix kernel panic while received AUTH chunk while enabled auth
  [IPV4]: Formatting fix for /proc/net/fib_trie.
  [IPV6]: Fix sysctl compilation error.
  [NET_SCHED]: Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)
  [IPV4]: Fix compile error building without CONFIG_FS_PROC
  ...
...@@ -423,6 +423,7 @@ static int bpa10x_send_frame(struct sk_buff *skb) ...@@ -423,6 +423,7 @@ static int bpa10x_send_frame(struct sk_buff *skb)
break; break;
default: default:
usb_free_urb(urb);
return -EILSEQ; return -EILSEQ;
} }
......
...@@ -162,10 +162,8 @@ static int btsdio_rx_packet(struct btsdio_data *data) ...@@ -162,10 +162,8 @@ static int btsdio_rx_packet(struct btsdio_data *data)
bt_cb(skb)->pkt_type = hdr[3]; bt_cb(skb)->pkt_type = hdr[3];
err = hci_recv_frame(skb); err = hci_recv_frame(skb);
if (err < 0) { if (err < 0)
kfree(skb);
return err; return err;
}
sdio_writeb(data->func, 0x00, REG_PC_RRT, NULL); sdio_writeb(data->func, 0x00, REG_PC_RRT, NULL);
......
...@@ -111,6 +111,7 @@ static struct usb_device_id blacklist_ids[] = { ...@@ -111,6 +111,7 @@ static struct usb_device_id blacklist_ids[] = {
{ USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE }, { USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE },
/* Broadcom BCM2035 */ /* Broadcom BCM2035 */
{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, { USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 }, { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
......
...@@ -920,8 +920,7 @@ config ENC28J60 ...@@ -920,8 +920,7 @@ config ENC28J60
---help--- ---help---
Support for the Microchip EN28J60 ethernet chip. Support for the Microchip EN28J60 ethernet chip.
To compile this driver as a module, choose M here and read To compile this driver as a module, choose M here. The module will be
<file:Documentation/networking/net-modules.txt>. The module will be
called enc28j60. called enc28j60.
config ENC28J60_WRITEVERIFY config ENC28J60_WRITEVERIFY
...@@ -2041,8 +2040,7 @@ config IGB ...@@ -2041,8 +2040,7 @@ config IGB
More specific information on configuring the driver is in More specific information on configuring the driver is in
<file:Documentation/networking/e1000.txt>. <file:Documentation/networking/e1000.txt>.
To compile this driver as a module, choose M here and read To compile this driver as a module, choose M here. The module
<file:Documentation/networking/net-modules.txt>. The module
will be called igb. will be called igb.
source "drivers/net/ixp2000/Kconfig" source "drivers/net/ixp2000/Kconfig"
......
...@@ -262,8 +262,8 @@ static void tm_isr(struct scc_priv *priv); ...@@ -262,8 +262,8 @@ static void tm_isr(struct scc_priv *priv);
static int io[MAX_NUM_DEVS] __initdata = { 0, }; static int io[MAX_NUM_DEVS] __initdata = { 0, };
/* Beware! hw[] is also used in cleanup_module(). */ /* Beware! hw[] is also used in dmascc_exit(). */
static struct scc_hardware hw[NUM_TYPES] __initdata_or_module = HARDWARE; static struct scc_hardware hw[NUM_TYPES] = HARDWARE;
/* Global variables */ /* Global variables */
......
...@@ -529,9 +529,13 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr) ...@@ -529,9 +529,13 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr)
if (ifr->ifr_flags & IFF_NO_PI) if (ifr->ifr_flags & IFF_NO_PI)
tun->flags |= TUN_NO_PI; tun->flags |= TUN_NO_PI;
else
tun->flags &= ~TUN_NO_PI;
if (ifr->ifr_flags & IFF_ONE_QUEUE) if (ifr->ifr_flags & IFF_ONE_QUEUE)
tun->flags |= TUN_ONE_QUEUE; tun->flags |= TUN_ONE_QUEUE;
else
tun->flags &= ~TUN_ONE_QUEUE;
file->private_data = tun; file->private_data = tun;
tun->attached = 1; tun->attached = 1;
......
...@@ -219,6 +219,7 @@ unifdef-y += i2c-dev.h ...@@ -219,6 +219,7 @@ unifdef-y += i2c-dev.h
unifdef-y += icmp.h unifdef-y += icmp.h
unifdef-y += icmpv6.h unifdef-y += icmpv6.h
unifdef-y += if_addr.h unifdef-y += if_addr.h
unifdef-y += if_addrlabel.h
unifdef-y += if_arp.h unifdef-y += if_arp.h
unifdef-y += if_bridge.h unifdef-y += if_bridge.h
unifdef-y += if_ec.h unifdef-y += if_ec.h
......
...@@ -459,7 +459,8 @@ enum ...@@ -459,7 +459,8 @@ enum
#define TCF_EM_U32 3 #define TCF_EM_U32 3
#define TCF_EM_META 4 #define TCF_EM_META 4
#define TCF_EM_TEXT 5 #define TCF_EM_TEXT 5
#define TCF_EM_MAX 5 #define TCF_EM_VLAN 6
#define TCF_EM_MAX 6
enum enum
{ {
......
...@@ -602,24 +602,12 @@ struct tcamsg ...@@ -602,24 +602,12 @@ struct tcamsg
#include <linux/mutex.h> #include <linux/mutex.h>
extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size);
static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
{ {
int len = strlen(str) + 1; int len = strlen(str) + 1;
return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
} }
extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len);
extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
struct rtattr *rta, int len);
#define rtattr_parse_nested(tb, max, rta) \
rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta)))
#define rtattr_parse_nested_compat(tb, max, rta, data, len) \
({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
__rtattr_parse_nested_compat(tb, max, rta, len); })
extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
......
...@@ -81,6 +81,7 @@ enum ...@@ -81,6 +81,7 @@ enum
TCF_META_ID_SK_SNDTIMEO, TCF_META_ID_SK_SNDTIMEO,
TCF_META_ID_SK_SENDMSG_OFF, TCF_META_ID_SK_SENDMSG_OFF,
TCF_META_ID_SK_WRITE_PENDING, TCF_META_ID_SK_WRITE_PENDING,
TCF_META_ID_VLAN_TAG,
__TCF_META_ID_MAX __TCF_META_ID_MAX
}; };
#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
......
...@@ -389,7 +389,7 @@ static inline struct sock *inet_lookup(struct net *net, ...@@ -389,7 +389,7 @@ static inline struct sock *inet_lookup(struct net *net,
} }
extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, extern int __inet_hash_connect(struct inet_timewait_death_row *death_row,
struct sock *sk, struct sock *sk, u32 port_offset,
int (*check_established)(struct inet_timewait_death_row *, int (*check_established)(struct inet_timewait_death_row *,
struct sock *, __u16, struct inet_timewait_sock **), struct sock *, __u16, struct inet_timewait_sock **),
void (*hash)(struct sock *sk)); void (*hash)(struct sock *sk));
......
...@@ -266,6 +266,14 @@ static inline void fib_res_put(struct fib_result *res) ...@@ -266,6 +266,14 @@ static inline void fib_res_put(struct fib_result *res)
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern int __net_init fib_proc_init(struct net *net); extern int __net_init fib_proc_init(struct net *net);
extern void __net_exit fib_proc_exit(struct net *net); extern void __net_exit fib_proc_exit(struct net *net);
#else
static inline int fib_proc_init(struct net *net)
{
return 0;
}
static inline void fib_proc_exit(struct net *net)
{
}
#endif #endif
#endif /* _NET_FIB_H */ #endif /* _NET_FIB_H */
...@@ -110,7 +110,6 @@ struct frag_hdr { ...@@ -110,7 +110,6 @@ struct frag_hdr {
/* sysctls */ /* sysctls */
extern int sysctl_mld_max_msf; extern int sysctl_mld_max_msf;
extern struct ctl_path net_ipv6_ctl_path[]; extern struct ctl_path net_ipv6_ctl_path[];
#define _DEVINC(statname, modifier, idev, field) \ #define _DEVINC(statname, modifier, idev, field) \
...@@ -586,9 +585,6 @@ extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, ...@@ -586,9 +585,6 @@ extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
int __user *optlen); int __user *optlen);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
extern int ac6_proc_init(void); extern int ac6_proc_init(void);
extern void ac6_proc_exit(void); extern void ac6_proc_exit(void);
extern int raw6_proc_init(void); extern int raw6_proc_init(void);
...@@ -621,6 +617,8 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) ...@@ -621,6 +617,8 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev)
extern ctl_table ipv6_route_table_template[]; extern ctl_table ipv6_route_table_template[];
extern ctl_table ipv6_icmp_table_template[]; extern ctl_table ipv6_icmp_table_template[];
extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
extern int ipv6_sysctl_register(void); extern int ipv6_sysctl_register(void);
extern void ipv6_sysctl_unregister(void); extern void ipv6_sysctl_unregister(void);
#endif #endif
......
...@@ -135,8 +135,8 @@ static void __hidp_copy_session(struct hidp_session *session, struct hidp_connin ...@@ -135,8 +135,8 @@ static void __hidp_copy_session(struct hidp_session *session, struct hidp_connin
} }
} }
static inline int hidp_queue_event(struct hidp_session *session, struct input_dev *dev, static int hidp_queue_event(struct hidp_session *session, struct input_dev *dev,
unsigned int type, unsigned int code, int value) unsigned int type, unsigned int code, int value)
{ {
unsigned char newleds; unsigned char newleds;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -243,7 +243,8 @@ static void hidp_input_report(struct hidp_session *session, struct sk_buff *skb) ...@@ -243,7 +243,8 @@ static void hidp_input_report(struct hidp_session *session, struct sk_buff *skb)
input_sync(dev); input_sync(dev);
} }
static inline int hidp_queue_report(struct hidp_session *session, unsigned char *data, int size) static int hidp_queue_report(struct hidp_session *session,
unsigned char *data, int size)
{ {
struct sk_buff *skb; struct sk_buff *skb;
...@@ -287,7 +288,7 @@ static void hidp_idle_timeout(unsigned long arg) ...@@ -287,7 +288,7 @@ static void hidp_idle_timeout(unsigned long arg)
hidp_schedule(session); hidp_schedule(session);
} }
static inline void hidp_set_timer(struct hidp_session *session) static void hidp_set_timer(struct hidp_session *session)
{ {
if (session->idle_to > 0) if (session->idle_to > 0)
mod_timer(&session->timer, jiffies + HZ * session->idle_to); mod_timer(&session->timer, jiffies + HZ * session->idle_to);
...@@ -332,7 +333,8 @@ static inline int hidp_send_ctrl_message(struct hidp_session *session, ...@@ -332,7 +333,8 @@ static inline int hidp_send_ctrl_message(struct hidp_session *session,
return err; return err;
} }
static inline void hidp_process_handshake(struct hidp_session *session, unsigned char param) static void hidp_process_handshake(struct hidp_session *session,
unsigned char param)
{ {
BT_DBG("session %p param 0x%02x", session, param); BT_DBG("session %p param 0x%02x", session, param);
...@@ -365,38 +367,23 @@ static inline void hidp_process_handshake(struct hidp_session *session, unsigned ...@@ -365,38 +367,23 @@ static inline void hidp_process_handshake(struct hidp_session *session, unsigned
} }
} }
static inline void hidp_process_hid_control(struct hidp_session *session, unsigned char param) static void hidp_process_hid_control(struct hidp_session *session,
unsigned char param)
{ {
BT_DBG("session %p param 0x%02x", session, param); BT_DBG("session %p param 0x%02x", session, param);
switch (param) { if (param == HIDP_CTRL_VIRTUAL_CABLE_UNPLUG) {
case HIDP_CTRL_NOP:
break;
case HIDP_CTRL_VIRTUAL_CABLE_UNPLUG:
/* Flush the transmit queues */ /* Flush the transmit queues */
skb_queue_purge(&session->ctrl_transmit); skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit); skb_queue_purge(&session->intr_transmit);
/* Kill session thread */ /* Kill session thread */
atomic_inc(&session->terminate); atomic_inc(&session->terminate);
break;
case HIDP_CTRL_HARD_RESET:
case HIDP_CTRL_SOFT_RESET:
case HIDP_CTRL_SUSPEND:
case HIDP_CTRL_EXIT_SUSPEND:
/* FIXME: We have to parse these and return no error */
break;
default:
__hidp_send_ctrl_message(session,
HIDP_TRANS_HANDSHAKE | HIDP_HSHK_ERR_INVALID_PARAMETER, NULL, 0);
break;
} }
} }
static inline void hidp_process_data(struct hidp_session *session, struct sk_buff *skb, unsigned char param) static void hidp_process_data(struct hidp_session *session, struct sk_buff *skb,
unsigned char param)
{ {
BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, param); BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, param);
...@@ -423,7 +410,8 @@ static inline void hidp_process_data(struct hidp_session *session, struct sk_buf ...@@ -423,7 +410,8 @@ static inline void hidp_process_data(struct hidp_session *session, struct sk_buf
} }
} }
static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct sk_buff *skb) static void hidp_recv_ctrl_frame(struct hidp_session *session,
struct sk_buff *skb)
{ {
unsigned char hdr, type, param; unsigned char hdr, type, param;
...@@ -457,7 +445,8 @@ static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct sk_ ...@@ -457,7 +445,8 @@ static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct sk_
kfree_skb(skb); kfree_skb(skb);
} }
static inline void hidp_recv_intr_frame(struct hidp_session *session, struct sk_buff *skb) static void hidp_recv_intr_frame(struct hidp_session *session,
struct sk_buff *skb)
{ {
unsigned char hdr; unsigned char hdr;
...@@ -625,7 +614,8 @@ static struct device *hidp_get_device(struct hidp_session *session) ...@@ -625,7 +614,8 @@ static struct device *hidp_get_device(struct hidp_session *session)
return conn ? &conn->dev : NULL; return conn ? &conn->dev : NULL;
} }
static inline int hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) static int hidp_setup_input(struct hidp_session *session,
struct hidp_connadd_req *req)
{ {
struct input_dev *input = session->input; struct input_dev *input = session->input;
int i; int i;
...@@ -702,7 +692,8 @@ static void hidp_setup_quirks(struct hid_device *hid) ...@@ -702,7 +692,8 @@ static void hidp_setup_quirks(struct hid_device *hid)
hid->quirks = hidp_blacklist[n].quirks; hid->quirks = hidp_blacklist[n].quirks;
} }
static inline void hidp_setup_hid(struct hidp_session *session, struct hidp_connadd_req *req) static void hidp_setup_hid(struct hidp_session *session,
struct hidp_connadd_req *req)
{ {
struct hid_device *hid = session->hid; struct hid_device *hid = session->hid;
struct hid_report *report; struct hid_report *report;
......
...@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __user *arg) ...@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __user *arg)
if (dev->tty) if (dev->tty)
tty_vhangup(dev->tty); tty_vhangup(dev->tty);
rfcomm_dev_del(dev); if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
rfcomm_dev_del(dev);
rfcomm_dev_put(dev); rfcomm_dev_put(dev);
return 0; return 0;
} }
......
...@@ -82,32 +82,6 @@ int rtnl_trylock(void) ...@@ -82,32 +82,6 @@ int rtnl_trylock(void)
return mutex_trylock(&rtnl_mutex); return mutex_trylock(&rtnl_mutex);
} }
int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len)
{
memset(tb, 0, sizeof(struct rtattr*)*maxattr);
while (RTA_OK(rta, len)) {
unsigned flavor = rta->rta_type;
if (flavor && flavor <= maxattr)
tb[flavor-1] = rta;
rta = RTA_NEXT(rta, len);
}
return 0;
}
int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
struct rtattr *rta, int len)
{
if (RTA_PAYLOAD(rta) < len)
return -1;
if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) {
rta = RTA_DATA(rta) + RTA_ALIGN(len);
return rtattr_parse_nested(tb, maxattr, rta);
}
memset(tb, 0, sizeof(struct rtattr *) * maxattr);
return 0;
}
static struct rtnl_link *rtnl_msg_handlers[NPROTO]; static struct rtnl_link *rtnl_msg_handlers[NPROTO];
static inline int rtm_msgindex(int msgtype) static inline int rtm_msgindex(int msgtype)
...@@ -442,21 +416,6 @@ void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data ...@@ -442,21 +416,6 @@ void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data
memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size); memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
} }
size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size)
{
size_t ret = RTA_PAYLOAD(rta);
char *src = RTA_DATA(rta);
if (ret > 0 && src[ret - 1] == '\0')
ret--;
if (size > 0) {
size_t len = (ret >= size) ? size - 1 : ret;
memset(dest, 0, size);
memcpy(dest, src, len);
}
return ret;
}
int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo) int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo)
{ {
struct sock *rtnl = net->rtnl; struct sock *rtnl = net->rtnl;
...@@ -1411,9 +1370,6 @@ void __init rtnetlink_init(void) ...@@ -1411,9 +1370,6 @@ void __init rtnetlink_init(void)
} }
EXPORT_SYMBOL(__rta_fill); EXPORT_SYMBOL(__rta_fill);
EXPORT_SYMBOL(rtattr_strlcpy);
EXPORT_SYMBOL(rtattr_parse);
EXPORT_SYMBOL(__rtattr_parse_nested_compat);
EXPORT_SYMBOL(rtnetlink_put_metrics); EXPORT_SYMBOL(rtnetlink_put_metrics);
EXPORT_SYMBOL(rtnl_lock); EXPORT_SYMBOL(rtnl_lock);
EXPORT_SYMBOL(rtnl_trylock); EXPORT_SYMBOL(rtnl_trylock);
......
...@@ -2431,8 +2431,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v) ...@@ -2431,8 +2431,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
rtn_type(buf2, sizeof(buf2), rtn_type(buf2, sizeof(buf2),
fa->fa_type)); fa->fa_type));
if (fa->fa_tos) if (fa->fa_tos)
seq_printf(seq, "tos =%d\n", seq_printf(seq, " tos=%d", fa->fa_tos);
fa->fa_tos);
seq_putc(seq, '\n'); seq_putc(seq, '\n');
} }
} }
......
...@@ -1015,7 +1015,8 @@ int icmp_rcv(struct sk_buff *skb) ...@@ -1015,7 +1015,8 @@ int icmp_rcv(struct sk_buff *skb)
goto error; goto error;
} }
__skb_pull(skb, sizeof(*icmph)); if (!pskb_pull(skb, sizeof(*icmph)))
goto error;
icmph = icmp_hdr(skb); icmph = icmp_hdr(skb);
......
...@@ -398,7 +398,7 @@ void inet_unhash(struct sock *sk) ...@@ -398,7 +398,7 @@ void inet_unhash(struct sock *sk)
EXPORT_SYMBOL_GPL(inet_unhash); EXPORT_SYMBOL_GPL(inet_unhash);
int __inet_hash_connect(struct inet_timewait_death_row *death_row, int __inet_hash_connect(struct inet_timewait_death_row *death_row,
struct sock *sk, struct sock *sk, u32 port_offset,
int (*check_established)(struct inet_timewait_death_row *, int (*check_established)(struct inet_timewait_death_row *,
struct sock *, __u16, struct inet_timewait_sock **), struct sock *, __u16, struct inet_timewait_sock **),
void (*hash)(struct sock *sk)) void (*hash)(struct sock *sk))
...@@ -413,7 +413,7 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row, ...@@ -413,7 +413,7 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
if (!snum) { if (!snum) {
int i, remaining, low, high, port; int i, remaining, low, high, port;
static u32 hint; static u32 hint;
u32 offset = hint + inet_sk_port_offset(sk); u32 offset = hint + port_offset;
struct hlist_node *node; struct hlist_node *node;
struct inet_timewait_sock *tw = NULL; struct inet_timewait_sock *tw = NULL;
...@@ -502,7 +502,7 @@ EXPORT_SYMBOL_GPL(__inet_hash_connect); ...@@ -502,7 +502,7 @@ EXPORT_SYMBOL_GPL(__inet_hash_connect);
int inet_hash_connect(struct inet_timewait_death_row *death_row, int inet_hash_connect(struct inet_timewait_death_row *death_row,
struct sock *sk) struct sock *sk)
{ {
return __inet_hash_connect(death_row, sk, return __inet_hash_connect(death_row, sk, inet_sk_port_offset(sk),
__inet_check_established, __inet_hash_nolisten); __inet_check_established, __inet_hash_nolisten);
} }
......
...@@ -102,7 +102,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb) ...@@ -102,7 +102,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
XFRM_MODE_SKB_CB(skb)->protocol = ph->nexthdr; XFRM_MODE_SKB_CB(skb)->protocol = ph->nexthdr;
if (!pskb_may_pull(skb, phlen)); if (!pskb_may_pull(skb, phlen))
goto out; goto out;
__skb_pull(skb, phlen); __skb_pull(skb, phlen);
} }
......
...@@ -683,7 +683,8 @@ static int icmpv6_rcv(struct sk_buff *skb) ...@@ -683,7 +683,8 @@ static int icmpv6_rcv(struct sk_buff *skb)
} }
} }
__skb_pull(skb, sizeof(*hdr)); if (!pskb_pull(skb, sizeof(*hdr)))
goto discard_it;
hdr = icmp6_hdr(skb); hdr = icmp6_hdr(skb);
......
...@@ -236,7 +236,7 @@ static inline u32 inet6_sk_port_offset(const struct sock *sk) ...@@ -236,7 +236,7 @@ static inline u32 inet6_sk_port_offset(const struct sock *sk)
int inet6_hash_connect(struct inet_timewait_death_row *death_row, int inet6_hash_connect(struct inet_timewait_death_row *death_row,
struct sock *sk) struct sock *sk)
{ {
return __inet_hash_connect(death_row, sk, return __inet_hash_connect(death_row, sk, inet6_sk_port_offset(sk),
__inet6_check_established, __inet6_hash); __inet6_check_established, __inet6_hash);
} }
......
...@@ -594,11 +594,11 @@ static int flow_dump(struct tcf_proto *tp, unsigned long fh, ...@@ -594,11 +594,11 @@ static int flow_dump(struct tcf_proto *tp, unsigned long fh,
if (tcf_exts_dump(skb, &f->exts, &flow_ext_map) < 0) if (tcf_exts_dump(skb, &f->exts, &flow_ext_map) < 0)
goto nla_put_failure; goto nla_put_failure;
#ifdef CONFIG_NET_EMATCH
if (f->ematches.hdr.nmatches && if (f->ematches.hdr.nmatches &&
tcf_em_tree_dump(skb, &f->ematches, TCA_FLOW_EMATCHES) < 0) tcf_em_tree_dump(skb, &f->ematches, TCA_FLOW_EMATCHES) < 0)
goto nla_put_failure; goto nla_put_failure;
#endif
nla_nest_end(skb, nest); nla_nest_end(skb, nest);
if (tcf_exts_dump_stats(skb, &f->exts, &flow_ext_map) < 0) if (tcf_exts_dump_stats(skb, &f->exts, &flow_ext_map) < 0)
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/if_vlan.h>
#include <linux/tc_ematch/tc_em_meta.h> #include <linux/tc_ematch/tc_em_meta.h>
#include <net/dst.h> #include <net/dst.h>
#include <net/route.h> #include <net/route.h>
...@@ -169,6 +170,21 @@ META_COLLECTOR(var_dev) ...@@ -169,6 +170,21 @@ META_COLLECTOR(var_dev)
*err = var_dev(skb->dev, dst); *err = var_dev(skb->dev, dst);
} }
/**************************************************************************
* vlan tag
**************************************************************************/
META_COLLECTOR(int_vlan_tag)
{
unsigned short tag;
if (vlan_get_tag(skb, &tag) < 0)
*err = -1;
else
dst->value = tag;
}
/************************************************************************** /**************************************************************************
* skb attributes * skb attributes
**************************************************************************/ **************************************************************************/
...@@ -520,6 +536,7 @@ static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = { ...@@ -520,6 +536,7 @@ static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = {
[META_ID(SK_SNDTIMEO)] = META_FUNC(int_sk_sndtimeo), [META_ID(SK_SNDTIMEO)] = META_FUNC(int_sk_sndtimeo),
[META_ID(SK_SENDMSG_OFF)] = META_FUNC(int_sk_sendmsg_off), [META_ID(SK_SENDMSG_OFF)] = META_FUNC(int_sk_sendmsg_off),
[META_ID(SK_WRITE_PENDING)] = META_FUNC(int_sk_write_pend), [META_ID(SK_WRITE_PENDING)] = META_FUNC(int_sk_write_pend),
[META_ID(VLAN_TAG)] = META_FUNC(int_vlan_tag),
} }
}; };
......
...@@ -420,15 +420,15 @@ struct sctp_shared_key *sctp_auth_get_shkey( ...@@ -420,15 +420,15 @@ struct sctp_shared_key *sctp_auth_get_shkey(
const struct sctp_association *asoc, const struct sctp_association *asoc,
__u16 key_id) __u16 key_id)
{ {
struct sctp_shared_key *key = NULL; struct sctp_shared_key *key;
/* First search associations set of endpoint pair shared keys */ /* First search associations set of endpoint pair shared keys */
key_for_each(key, &asoc->endpoint_shared_keys) { key_for_each(key, &asoc->endpoint_shared_keys) {
if (key->key_id == key_id) if (key->key_id == key_id)
break; return key;
} }
return key; return NULL;
} }
/* /*
......
...@@ -3865,6 +3865,10 @@ sctp_disposition_t sctp_sf_eat_auth(const struct sctp_endpoint *ep, ...@@ -3865,6 +3865,10 @@ sctp_disposition_t sctp_sf_eat_auth(const struct sctp_endpoint *ep,
struct sctp_chunk *err_chunk; struct sctp_chunk *err_chunk;
sctp_ierror_t error; sctp_ierror_t error;
/* Make sure that the peer has AUTH capable */
if (!asoc->peer.auth_capable)
return sctp_sf_unk_chunk(ep, asoc, type, arg, commands);
if (!sctp_vtag_verify(chunk, asoc)) { if (!sctp_vtag_verify(chunk, asoc)) {
sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
SCTP_NULL()); SCTP_NULL());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册