[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150111202650.GB4214@localhost.localdomain>
Date: Sun, 11 Jan 2015 21:26:50 +0100
From: Richard Cochran <richardcochran@...il.com>
To: Willem de Bruijn <willemb@...gle.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
eric.dumazet@...il.com, luto@...capital.net
Subject: Re: [PATCH net-next RFC 1/5] net-timestamp: no-payload option
On Fri, Jan 09, 2015 at 12:31:55PM -0500, Willem de Bruijn wrote:
> diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
> index a317797..d81ef70 100644
> --- a/net/ipv4/ip_sockglue.c
> +++ b/net/ipv4/ip_sockglue.c
> @@ -440,7 +440,7 @@ static bool ipv4_pktinfo_prepare_errqueue(const struct sock *sk,
>
> if ((ee_origin != SO_EE_ORIGIN_TIMESTAMPING) ||
> (!(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_CMSG)) ||
> - (!skb->dev))
> + (!skb->dev) || (!skb->len))
> return false;
Nit: You have already tested for the condition (!skb->len) ...
>
> info->ipi_spec_dst.s_addr = ip_hdr(skb)->saddr;
> @@ -483,7 +483,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
>
> serr = SKB_EXT_ERR(skb);
>
> - if (sin) {
> + if (sin && skb->len) {
> sin->sin_family = AF_INET;
> sin->sin_addr.s_addr = *(__be32 *)(skb_network_header(skb) +
> serr->addr_offset);
> @@ -496,8 +496,9 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
> sin = &errhdr.offender;
> sin->sin_family = AF_UNSPEC;
>
> - if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP ||
> - ipv4_pktinfo_prepare_errqueue(sk, skb, serr->ee.ee_origin)) {
> + if (skb->len &&
> + (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP ||
> + ipv4_pktinfo_prepare_errqueue(sk, skb, serr->ee.ee_origin))) {
... here.
> struct inet_sock *inet = inet_sk(sk);
>
> sin->sin_family = AF_INET;
Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists