diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-29 14:29:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-29 14:29:33 -0500 |
commit | f3cab8a0b1a772dc8b055b7affa567a366627c9e (patch) | |
tree | 39c4736047e7f1f6617a4703b3ebf62df1d68d34 /include | |
parent | 76babde121d2ffef04ca692ce64ef9f8a9866086 (diff) | |
parent | 65b4b4e81a5094d52cbe372b887b1779abe53f9b (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NETFILTER]: Rename init functions.
[TCP]: Fix RFC2465 typo.
[INET]: Introduce tunnel4/tunnel6
[NET]: deinline 200+ byte inlines in sock.h
[ECONET]: Convert away from SOCKOPS_WRAPPED
[NET]: Fix ipx/econet/appletalk/irda ioctl crashes
[NET]: Kill Documentation/networking/TODO
[TG3]: Update version and reldate
[TG3]: Skip timer code during full lock
[TG3]: Speed up SRAM access
[TG3]: Fix PHY loopback on 5700
[TG3]: Fix bug in 40-bit DMA workaround code
[TG3]: Fix probe failure due to invalid MAC address
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sock.h | 91 | ||||
-rw-r--r-- | include/net/xfrm.h | 16 |
2 files changed, 15 insertions, 92 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 2aa73c0ec6c2..af2b0544586e 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -938,28 +938,7 @@ static inline void sock_put(struct sock *sk) | |||
938 | sk_free(sk); | 938 | sk_free(sk); |
939 | } | 939 | } |
940 | 940 | ||
941 | static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb) | 941 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb); |
942 | { | ||
943 | int rc = NET_RX_SUCCESS; | ||
944 | |||
945 | if (sk_filter(sk, skb, 0)) | ||
946 | goto discard_and_relse; | ||
947 | |||
948 | skb->dev = NULL; | ||
949 | |||
950 | bh_lock_sock(sk); | ||
951 | if (!sock_owned_by_user(sk)) | ||
952 | rc = sk->sk_backlog_rcv(sk, skb); | ||
953 | else | ||
954 | sk_add_backlog(sk, skb); | ||
955 | bh_unlock_sock(sk); | ||
956 | out: | ||
957 | sock_put(sk); | ||
958 | return rc; | ||
959 | discard_and_relse: | ||
960 | kfree_skb(skb); | ||
961 | goto out; | ||
962 | } | ||
963 | 942 | ||
964 | /* Detach socket from process context. | 943 | /* Detach socket from process context. |
965 | * Announce socket dead, detach it from wait queue and inode. | 944 | * Announce socket dead, detach it from wait queue and inode. |
@@ -1044,33 +1023,9 @@ sk_dst_reset(struct sock *sk) | |||
1044 | write_unlock(&sk->sk_dst_lock); | 1023 | write_unlock(&sk->sk_dst_lock); |
1045 | } | 1024 | } |
1046 | 1025 | ||
1047 | static inline struct dst_entry * | 1026 | extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); |
1048 | __sk_dst_check(struct sock *sk, u32 cookie) | ||
1049 | { | ||
1050 | struct dst_entry *dst = sk->sk_dst_cache; | ||
1051 | |||
1052 | if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) { | ||
1053 | sk->sk_dst_cache = NULL; | ||
1054 | dst_release(dst); | ||
1055 | return NULL; | ||
1056 | } | ||
1057 | |||
1058 | return dst; | ||
1059 | } | ||
1060 | |||
1061 | static inline struct dst_entry * | ||
1062 | sk_dst_check(struct sock *sk, u32 cookie) | ||
1063 | { | ||
1064 | struct dst_entry *dst = sk_dst_get(sk); | ||
1065 | 1027 | ||
1066 | if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) { | 1028 | extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); |
1067 | sk_dst_reset(sk); | ||
1068 | dst_release(dst); | ||
1069 | return NULL; | ||
1070 | } | ||
1071 | |||
1072 | return dst; | ||
1073 | } | ||
1074 | 1029 | ||
1075 | static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) | 1030 | static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) |
1076 | { | 1031 | { |
@@ -1140,45 +1095,7 @@ extern void sk_reset_timer(struct sock *sk, struct timer_list* timer, | |||
1140 | 1095 | ||
1141 | extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); | 1096 | extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); |
1142 | 1097 | ||
1143 | static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | 1098 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
1144 | { | ||
1145 | int err = 0; | ||
1146 | int skb_len; | ||
1147 | |||
1148 | /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces | ||
1149 | number of warnings when compiling with -W --ANK | ||
1150 | */ | ||
1151 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
1152 | (unsigned)sk->sk_rcvbuf) { | ||
1153 | err = -ENOMEM; | ||
1154 | goto out; | ||
1155 | } | ||
1156 | |||
1157 | /* It would be deadlock, if sock_queue_rcv_skb is used | ||
1158 | with socket lock! We assume that users of this | ||
1159 | function are lock free. | ||
1160 | */ | ||
1161 | err = sk_filter(sk, skb, 1); | ||
1162 | if (err) | ||
1163 | goto out; | ||
1164 | |||
1165 | skb->dev = NULL; | ||
1166 | skb_set_owner_r(skb, sk); | ||
1167 | |||
1168 | /* Cache the SKB length before we tack it onto the receive | ||
1169 | * queue. Once it is added it no longer belongs to us and | ||
1170 | * may be freed by other threads of control pulling packets | ||
1171 | * from the queue. | ||
1172 | */ | ||
1173 | skb_len = skb->len; | ||
1174 | |||
1175 | skb_queue_tail(&sk->sk_receive_queue, skb); | ||
1176 | |||
1177 | if (!sock_flag(sk, SOCK_DEAD)) | ||
1178 | sk->sk_data_ready(sk, skb_len); | ||
1179 | out: | ||
1180 | return err; | ||
1181 | } | ||
1182 | 1099 | ||
1183 | static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | 1100 | static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) |
1184 | { | 1101 | { |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 61b7504fc2ba..e100291e43f4 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -864,13 +864,19 @@ struct xfrm_algo_desc { | |||
864 | /* XFRM tunnel handlers. */ | 864 | /* XFRM tunnel handlers. */ |
865 | struct xfrm_tunnel { | 865 | struct xfrm_tunnel { |
866 | int (*handler)(struct sk_buff *skb); | 866 | int (*handler)(struct sk_buff *skb); |
867 | void (*err_handler)(struct sk_buff *skb, __u32 info); | 867 | int (*err_handler)(struct sk_buff *skb, __u32 info); |
868 | |||
869 | struct xfrm_tunnel *next; | ||
870 | int priority; | ||
868 | }; | 871 | }; |
869 | 872 | ||
870 | struct xfrm6_tunnel { | 873 | struct xfrm6_tunnel { |
871 | int (*handler)(struct sk_buff **pskb); | 874 | int (*handler)(struct sk_buff *skb); |
872 | void (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, | 875 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, |
873 | int type, int code, int offset, __u32 info); | 876 | int type, int code, int offset, __u32 info); |
877 | |||
878 | struct xfrm6_tunnel *next; | ||
879 | int priority; | ||
874 | }; | 880 | }; |
875 | 881 | ||
876 | extern void xfrm_init(void); | 882 | extern void xfrm_init(void); |
@@ -906,7 +912,7 @@ extern int xfrm4_rcv(struct sk_buff *skb); | |||
906 | extern int xfrm4_output(struct sk_buff *skb); | 912 | extern int xfrm4_output(struct sk_buff *skb); |
907 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); | 913 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); |
908 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); | 914 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); |
909 | extern int xfrm6_rcv_spi(struct sk_buff **pskb, u32 spi); | 915 | extern int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi); |
910 | extern int xfrm6_rcv(struct sk_buff **pskb); | 916 | extern int xfrm6_rcv(struct sk_buff **pskb); |
911 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); | 917 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); |
912 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); | 918 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); |