diff options
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 1e64dabbd232..ce231780a2b1 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -287,12 +287,8 @@ int ip_ra_control(struct sock *sk, unsigned char on, | |||
287 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | 287 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, |
288 | __be16 port, u32 info, u8 *payload) | 288 | __be16 port, u32 info, u8 *payload) |
289 | { | 289 | { |
290 | struct inet_sock *inet = inet_sk(sk); | ||
291 | struct sock_exterr_skb *serr; | 290 | struct sock_exterr_skb *serr; |
292 | 291 | ||
293 | if (!inet->recverr) | ||
294 | return; | ||
295 | |||
296 | skb = skb_clone(skb, GFP_ATOMIC); | 292 | skb = skb_clone(skb, GFP_ATOMIC); |
297 | if (!skb) | 293 | if (!skb) |
298 | return; | 294 | return; |
@@ -958,6 +954,22 @@ e_inval: | |||
958 | return -EINVAL; | 954 | return -EINVAL; |
959 | } | 955 | } |
960 | 956 | ||
957 | /** | ||
958 | * ip_queue_rcv_skb - Queue an skb into sock receive queue | ||
959 | * @sk: socket | ||
960 | * @skb: buffer | ||
961 | * | ||
962 | * Queues an skb into socket receive queue. If IP_CMSG_PKTINFO option | ||
963 | * is not set, we drop skb dst entry now, while dst cache line is hot. | ||
964 | */ | ||
965 | int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | ||
966 | { | ||
967 | if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO)) | ||
968 | skb_dst_drop(skb); | ||
969 | return sock_queue_rcv_skb(sk, skb); | ||
970 | } | ||
971 | EXPORT_SYMBOL(ip_queue_rcv_skb); | ||
972 | |||
961 | int ip_setsockopt(struct sock *sk, int level, | 973 | int ip_setsockopt(struct sock *sk, int level, |
962 | int optname, char __user *optval, unsigned int optlen) | 974 | int optname, char __user *optval, unsigned int optlen) |
963 | { | 975 | { |