diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/atmdev.h | 4 | ||||
-rw-r--r-- | include/linux/net.h | 1 | ||||
-rw-r--r-- | include/linux/netdevice.h | 18 | ||||
-rw-r--r-- | include/linux/security.h | 13 | ||||
-rw-r--r-- | include/linux/skbuff.h | 9 |
5 files changed, 31 insertions, 14 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 1eb238affb12..41788a31c438 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #define LINUX_ATMDEV_H | 7 | #define LINUX_ATMDEV_H |
8 | 8 | ||
9 | 9 | ||
10 | #include <linux/device.h> | ||
10 | #include <linux/atmapi.h> | 11 | #include <linux/atmapi.h> |
11 | #include <linux/atm.h> | 12 | #include <linux/atm.h> |
12 | #include <linux/atmioc.h> | 13 | #include <linux/atmioc.h> |
@@ -358,6 +359,7 @@ struct atm_dev { | |||
358 | struct proc_dir_entry *proc_entry; /* proc entry */ | 359 | struct proc_dir_entry *proc_entry; /* proc entry */ |
359 | char *proc_name; /* proc entry name */ | 360 | char *proc_name; /* proc entry name */ |
360 | #endif | 361 | #endif |
362 | struct class_device class_dev; /* sysfs class device */ | ||
361 | struct list_head dev_list; /* linkage */ | 363 | struct list_head dev_list; /* linkage */ |
362 | }; | 364 | }; |
363 | 365 | ||
@@ -459,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
459 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); | 461 | BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); |
460 | if (dev->ops->dev_close) | 462 | if (dev->ops->dev_close) |
461 | dev->ops->dev_close(dev); | 463 | dev->ops->dev_close(dev); |
462 | kfree(dev); | 464 | class_device_put(&dev->class_dev); |
463 | } | 465 | } |
464 | } | 466 | } |
465 | 467 | ||
diff --git a/include/linux/net.h b/include/linux/net.h index 385e68f5bd93..b20c53c74413 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -61,6 +61,7 @@ typedef enum { | |||
61 | #define SOCK_ASYNC_WAITDATA 1 | 61 | #define SOCK_ASYNC_WAITDATA 1 |
62 | #define SOCK_NOSPACE 2 | 62 | #define SOCK_NOSPACE 2 |
63 | #define SOCK_PASSCRED 3 | 63 | #define SOCK_PASSCRED 3 |
64 | #define SOCK_PASSSEC 4 | ||
64 | 65 | ||
65 | #ifndef ARCH_HAS_SOCKET_TYPES | 66 | #ifndef ARCH_HAS_SOCKET_TYPES |
66 | /** | 67 | /** |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 03cd7551a7a1..aa2d3c12c4d8 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -315,6 +315,8 @@ struct net_device | |||
315 | #define NETIF_F_GSO_SHIFT 16 | 315 | #define NETIF_F_GSO_SHIFT 16 |
316 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) | 316 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) |
317 | #define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT) | 317 | #define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT) |
318 | #define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT) | ||
319 | #define NETIF_F_TSO_ECN (SKB_GSO_TCPV4_ECN << NETIF_F_GSO_SHIFT) | ||
318 | 320 | ||
319 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | 321 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) |
320 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) | 322 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) |
@@ -543,7 +545,8 @@ struct packet_type { | |||
543 | struct net_device *, | 545 | struct net_device *, |
544 | struct packet_type *, | 546 | struct packet_type *, |
545 | struct net_device *); | 547 | struct net_device *); |
546 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); | 548 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
549 | int features); | ||
547 | void *af_packet_priv; | 550 | void *af_packet_priv; |
548 | struct list_head list; | 551 | struct list_head list; |
549 | }; | 552 | }; |
@@ -968,7 +971,7 @@ extern int netdev_max_backlog; | |||
968 | extern int weight_p; | 971 | extern int weight_p; |
969 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 972 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
970 | extern int skb_checksum_help(struct sk_buff *skb, int inward); | 973 | extern int skb_checksum_help(struct sk_buff *skb, int inward); |
971 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg); | 974 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features); |
972 | #ifdef CONFIG_BUG | 975 | #ifdef CONFIG_BUG |
973 | extern void netdev_rx_csum_fault(struct net_device *dev); | 976 | extern void netdev_rx_csum_fault(struct net_device *dev); |
974 | #else | 977 | #else |
@@ -988,11 +991,16 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
988 | 991 | ||
989 | extern void linkwatch_run_queue(void); | 992 | extern void linkwatch_run_queue(void); |
990 | 993 | ||
994 | static inline int skb_gso_ok(struct sk_buff *skb, int features) | ||
995 | { | ||
996 | int feature = skb_shinfo(skb)->gso_size ? | ||
997 | skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT : 0; | ||
998 | return (features & feature) == feature; | ||
999 | } | ||
1000 | |||
991 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 1001 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) |
992 | { | 1002 | { |
993 | int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT; | 1003 | return !skb_gso_ok(skb, dev->features); |
994 | return skb_shinfo(skb)->gso_size && | ||
995 | (dev->features & feature) != feature; | ||
996 | } | 1004 | } |
997 | 1005 | ||
998 | #endif /* __KERNEL__ */ | 1006 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/security.h b/include/linux/security.h index 51805806f974..c7ea15716dce 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -67,7 +67,7 @@ struct xfrm_state; | |||
67 | struct xfrm_user_sec_ctx; | 67 | struct xfrm_user_sec_ctx; |
68 | 68 | ||
69 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | 69 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); |
70 | extern int cap_netlink_recv(struct sk_buff *skb); | 70 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * Values used in the task_security_ops calls | 73 | * Values used in the task_security_ops calls |
@@ -656,6 +656,7 @@ struct swap_info_struct; | |||
656 | * Check permission before processing the received netlink message in | 656 | * Check permission before processing the received netlink message in |
657 | * @skb. | 657 | * @skb. |
658 | * @skb contains the sk_buff structure for the netlink message. | 658 | * @skb contains the sk_buff structure for the netlink message. |
659 | * @cap indicates the capability required | ||
659 | * Return 0 if permission is granted. | 660 | * Return 0 if permission is granted. |
660 | * | 661 | * |
661 | * Security hooks for Unix domain networking. | 662 | * Security hooks for Unix domain networking. |
@@ -1266,7 +1267,7 @@ struct security_operations { | |||
1266 | struct sembuf * sops, unsigned nsops, int alter); | 1267 | struct sembuf * sops, unsigned nsops, int alter); |
1267 | 1268 | ||
1268 | int (*netlink_send) (struct sock * sk, struct sk_buff * skb); | 1269 | int (*netlink_send) (struct sock * sk, struct sk_buff * skb); |
1269 | int (*netlink_recv) (struct sk_buff * skb); | 1270 | int (*netlink_recv) (struct sk_buff * skb, int cap); |
1270 | 1271 | ||
1271 | /* allow module stacking */ | 1272 | /* allow module stacking */ |
1272 | int (*register_security) (const char *name, | 1273 | int (*register_security) (const char *name, |
@@ -2032,9 +2033,9 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff * skb) | |||
2032 | return security_ops->netlink_send(sk, skb); | 2033 | return security_ops->netlink_send(sk, skb); |
2033 | } | 2034 | } |
2034 | 2035 | ||
2035 | static inline int security_netlink_recv(struct sk_buff * skb) | 2036 | static inline int security_netlink_recv(struct sk_buff * skb, int cap) |
2036 | { | 2037 | { |
2037 | return security_ops->netlink_recv(skb); | 2038 | return security_ops->netlink_recv(skb, cap); |
2038 | } | 2039 | } |
2039 | 2040 | ||
2040 | /* prototypes */ | 2041 | /* prototypes */ |
@@ -2670,9 +2671,9 @@ static inline int security_netlink_send (struct sock *sk, struct sk_buff *skb) | |||
2670 | return cap_netlink_send (sk, skb); | 2671 | return cap_netlink_send (sk, skb); |
2671 | } | 2672 | } |
2672 | 2673 | ||
2673 | static inline int security_netlink_recv (struct sk_buff *skb) | 2674 | static inline int security_netlink_recv (struct sk_buff *skb, int cap) |
2674 | { | 2675 | { |
2675 | return cap_netlink_recv (skb); | 2676 | return cap_netlink_recv (skb, cap); |
2676 | } | 2677 | } |
2677 | 2678 | ||
2678 | static inline struct dentry *securityfs_create_dir(const char *name, | 2679 | static inline struct dentry *securityfs_create_dir(const char *name, |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 16eef03ce0eb..59918be91d0a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -172,6 +172,12 @@ enum { | |||
172 | enum { | 172 | enum { |
173 | SKB_GSO_TCPV4 = 1 << 0, | 173 | SKB_GSO_TCPV4 = 1 << 0, |
174 | SKB_GSO_UDPV4 = 1 << 1, | 174 | SKB_GSO_UDPV4 = 1 << 1, |
175 | |||
176 | /* This indicates the skb is from an untrusted source. */ | ||
177 | SKB_GSO_DODGY = 1 << 2, | ||
178 | |||
179 | /* This indicates the tcp segment has CWR set. */ | ||
180 | SKB_GSO_TCPV4_ECN = 1 << 3, | ||
175 | }; | 181 | }; |
176 | 182 | ||
177 | /** | 183 | /** |
@@ -1298,8 +1304,7 @@ extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | |||
1298 | extern void skb_split(struct sk_buff *skb, | 1304 | extern void skb_split(struct sk_buff *skb, |
1299 | struct sk_buff *skb1, const u32 len); | 1305 | struct sk_buff *skb1, const u32 len); |
1300 | 1306 | ||
1301 | extern void skb_release_data(struct sk_buff *skb); | 1307 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); |
1302 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg); | ||
1303 | 1308 | ||
1304 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 1309 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
1305 | int len, void *buffer) | 1310 | int len, void *buffer) |