diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/af_unix.h | 6 | ||||
-rw-r--r-- | include/net/pkt_sched.h | 18 | ||||
-rw-r--r-- | include/net/protocol.h | 3 | ||||
-rw-r--r-- | include/net/scm.h | 17 | ||||
-rw-r--r-- | include/net/sock.h | 3 | ||||
-rw-r--r-- | include/net/tcp.h | 2 | ||||
-rw-r--r-- | include/net/tcp_ecn.h | 6 |
7 files changed, 43 insertions, 12 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 795f81f9ec7f..5ba72d95280c 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -53,10 +53,16 @@ struct unix_address { | |||
53 | struct unix_skb_parms { | 53 | struct unix_skb_parms { |
54 | struct ucred creds; /* Skb credentials */ | 54 | struct ucred creds; /* Skb credentials */ |
55 | struct scm_fp_list *fp; /* Passed files */ | 55 | struct scm_fp_list *fp; /* Passed files */ |
56 | #ifdef CONFIG_SECURITY_NETWORK | ||
57 | char *secdata; /* Security context */ | ||
58 | u32 seclen; /* Security length */ | ||
59 | #endif | ||
56 | }; | 60 | }; |
57 | 61 | ||
58 | #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) | 62 | #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) |
59 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) | 63 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) |
64 | #define UNIXSECDATA(skb) (&UNIXCB((skb)).secdata) | ||
65 | #define UNIXSECLEN(skb) (&UNIXCB((skb)).seclen) | ||
60 | 66 | ||
61 | #define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) | 67 | #define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) |
62 | #define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) | 68 | #define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 75b5b9333fc7..1925c65e617b 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -169,17 +169,23 @@ psched_tod_diff(int delta_sec, int bound) | |||
169 | 169 | ||
170 | #define PSCHED_TADD2(tv, delta, tv_res) \ | 170 | #define PSCHED_TADD2(tv, delta, tv_res) \ |
171 | ({ \ | 171 | ({ \ |
172 | int __delta = (tv).tv_usec + (delta); \ | 172 | int __delta = (delta); \ |
173 | (tv_res).tv_sec = (tv).tv_sec; \ | 173 | (tv_res) = (tv); \ |
174 | if (__delta > USEC_PER_SEC) { (tv_res).tv_sec++; __delta -= USEC_PER_SEC; } \ | 174 | while(__delta >= USEC_PER_SEC){ \ |
175 | (tv_res).tv_sec++; \ | ||
176 | __delta -= USEC_PER_SEC; \ | ||
177 | } \ | ||
175 | (tv_res).tv_usec = __delta; \ | 178 | (tv_res).tv_usec = __delta; \ |
176 | }) | 179 | }) |
177 | 180 | ||
178 | #define PSCHED_TADD(tv, delta) \ | 181 | #define PSCHED_TADD(tv, delta) \ |
179 | ({ \ | 182 | ({ \ |
180 | (tv).tv_usec += (delta); \ | 183 | int __delta = (delta); \ |
181 | if ((tv).tv_usec > USEC_PER_SEC) { (tv).tv_sec++; \ | 184 | while(__delta >= USEC_PER_SEC){ \ |
182 | (tv).tv_usec -= USEC_PER_SEC; } \ | 185 | (tv).tv_sec++; \ |
186 | __delta -= USEC_PER_SEC; \ | ||
187 | } \ | ||
188 | (tv).tv_usec = __delta; \ | ||
183 | }) | 189 | }) |
184 | 190 | ||
185 | /* Set/check that time is in the "past perfect"; | 191 | /* Set/check that time is in the "past perfect"; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 3b6dc15c68a5..40b6b9c9973f 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -36,7 +36,8 @@ | |||
36 | struct net_protocol { | 36 | struct net_protocol { |
37 | int (*handler)(struct sk_buff *skb); | 37 | int (*handler)(struct sk_buff *skb); |
38 | void (*err_handler)(struct sk_buff *skb, u32 info); | 38 | void (*err_handler)(struct sk_buff *skb, u32 info); |
39 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); | 39 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
40 | int features); | ||
40 | int no_policy; | 41 | int no_policy; |
41 | }; | 42 | }; |
42 | 43 | ||
diff --git a/include/net/scm.h b/include/net/scm.h index 540619cb7160..02daa097cdcd 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -19,6 +19,10 @@ struct scm_cookie | |||
19 | { | 19 | { |
20 | struct ucred creds; /* Skb credentials */ | 20 | struct ucred creds; /* Skb credentials */ |
21 | struct scm_fp_list *fp; /* Passed files */ | 21 | struct scm_fp_list *fp; /* Passed files */ |
22 | #ifdef CONFIG_SECURITY_NETWORK | ||
23 | char *secdata; /* Security context */ | ||
24 | u32 seclen; /* Security length */ | ||
25 | #endif | ||
22 | unsigned long seq; /* Connection seqno */ | 26 | unsigned long seq; /* Connection seqno */ |
23 | }; | 27 | }; |
24 | 28 | ||
@@ -48,6 +52,17 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | |||
48 | return __scm_send(sock, msg, scm); | 52 | return __scm_send(sock, msg, scm); |
49 | } | 53 | } |
50 | 54 | ||
55 | #ifdef CONFIG_SECURITY_NETWORK | ||
56 | static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) | ||
57 | { | ||
58 | if (test_bit(SOCK_PASSSEC, &sock->flags) && scm->secdata != NULL) | ||
59 | put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, scm->seclen, scm->secdata); | ||
60 | } | ||
61 | #else | ||
62 | static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) | ||
63 | { } | ||
64 | #endif /* CONFIG_SECURITY_NETWORK */ | ||
65 | |||
51 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | 66 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, |
52 | struct scm_cookie *scm, int flags) | 67 | struct scm_cookie *scm, int flags) |
53 | { | 68 | { |
@@ -62,6 +77,8 @@ static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | |||
62 | if (test_bit(SOCK_PASSCRED, &sock->flags)) | 77 | if (test_bit(SOCK_PASSCRED, &sock->flags)) |
63 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds); | 78 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds); |
64 | 79 | ||
80 | scm_passec(sock, msg, scm); | ||
81 | |||
65 | if (!scm->fp) | 82 | if (!scm->fp) |
66 | return; | 83 | return; |
67 | 84 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index 2d8d6adf1616..7136bae48c2f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -383,7 +383,6 @@ enum sock_flags { | |||
383 | SOCK_USE_WRITE_QUEUE, /* whether to call sk->sk_write_space in sock_wfree */ | 383 | SOCK_USE_WRITE_QUEUE, /* whether to call sk->sk_write_space in sock_wfree */ |
384 | SOCK_DBG, /* %SO_DEBUG setting */ | 384 | SOCK_DBG, /* %SO_DEBUG setting */ |
385 | SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */ | 385 | SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */ |
386 | SOCK_NO_LARGESEND, /* whether to sent large segments or not */ | ||
387 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ | 386 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ |
388 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ | 387 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ |
389 | }; | 388 | }; |
@@ -1033,7 +1032,7 @@ static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) | |||
1033 | if (sk->sk_route_caps & NETIF_F_GSO) | 1032 | if (sk->sk_route_caps & NETIF_F_GSO) |
1034 | sk->sk_route_caps |= NETIF_F_TSO; | 1033 | sk->sk_route_caps |= NETIF_F_TSO; |
1035 | if (sk->sk_route_caps & NETIF_F_TSO) { | 1034 | if (sk->sk_route_caps & NETIF_F_TSO) { |
1036 | if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len) | 1035 | if (dst->header_len) |
1037 | sk->sk_route_caps &= ~NETIF_F_TSO; | 1036 | sk->sk_route_caps &= ~NETIF_F_TSO; |
1038 | else | 1037 | else |
1039 | sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM; | 1038 | sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index ca3d38dfc00b..624921e76332 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1086,7 +1086,7 @@ extern struct request_sock_ops tcp_request_sock_ops; | |||
1086 | 1086 | ||
1087 | extern int tcp_v4_destroy_sock(struct sock *sk); | 1087 | extern int tcp_v4_destroy_sock(struct sock *sk); |
1088 | 1088 | ||
1089 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg); | 1089 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); |
1090 | 1090 | ||
1091 | #ifdef CONFIG_PROC_FS | 1091 | #ifdef CONFIG_PROC_FS |
1092 | extern int tcp4_proc_init(void); | 1092 | extern int tcp4_proc_init(void); |
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index c6b84397448d..7bb366f70934 100644 --- a/include/net/tcp_ecn.h +++ b/include/net/tcp_ecn.h | |||
@@ -31,10 +31,9 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp, | |||
31 | struct sk_buff *skb) | 31 | struct sk_buff *skb) |
32 | { | 32 | { |
33 | tp->ecn_flags = 0; | 33 | tp->ecn_flags = 0; |
34 | if (sysctl_tcp_ecn && !(sk->sk_route_caps & NETIF_F_TSO)) { | 34 | if (sysctl_tcp_ecn) { |
35 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; | 35 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; |
36 | tp->ecn_flags = TCP_ECN_OK; | 36 | tp->ecn_flags = TCP_ECN_OK; |
37 | sock_set_flag(sk, SOCK_NO_LARGESEND); | ||
38 | } | 37 | } |
39 | } | 38 | } |
40 | 39 | ||
@@ -56,6 +55,9 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp, | |||
56 | if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) { | 55 | if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) { |
57 | tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; | 56 | tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; |
58 | skb->h.th->cwr = 1; | 57 | skb->h.th->cwr = 1; |
58 | if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) | ||
59 | skb_shinfo(skb)->gso_type |= | ||
60 | SKB_GSO_TCPV4_ECN; | ||
59 | } | 61 | } |
60 | } else { | 62 | } else { |
61 | /* ACK or retransmitted segment: clear ECT|CE */ | 63 | /* ACK or retransmitted segment: clear ECT|CE */ |