[quagga-dev 8125] Re: [PATCH 06/10] BGP: Add support for IPv6 ttl security

Balaji G balajig81 at gmail.com
Sun Aug 8 12:11:12 BST 2010


Hi Stephen

When  i run git apply --check i get the following error :

error: patch failed: lib/sockunion.c:541
error: lib/sockunion.c: patch does not apply

Thanks,
Cheers,
  - Balaji





On Thu, Aug 5, 2010 at 10:56 PM, Stephen Hemminger <shemminger at vyatta.com>wrote:

> Add IPv6 support for min hop count. The kernel support is Linux
> kernel 2.6.35 or later.
>
> Signed-off-by: Stephen Hemminger <shemminger at vyatta.com>
>
> ---
>  lib/sockunion.c |   30 +++++++++++++++++++-----------
>  1 files changed, 19 insertions(+), 11 deletions(-)
>
> --- a/lib/sockunion.c   2010-08-05 10:01:12.487631170 -0700
> +++ b/lib/sockunion.c   2010-08-05 10:07:44.085270551 -0700
> @@ -541,22 +541,30 @@ int
>  sockopt_minttl (int family, int sock, int minttl)
>  {
>  #ifdef IP_MINTTL
> -  int ret;
> -
> -  ret = setsockopt (sock, IPPROTO_IP, IP_MINTTL, &minttl, sizeof(minttl));
> -  if (ret < 0)
> +  if (family == AF_INET)
> +    {
> +      int ret = setsockopt (sock, IPPROTO_IP, IP_MINTTL, &minttl,
> sizeof(minttl));
> +      if (ret < 0)
> +         zlog (NULL, LOG_WARNING,
> +               "can't set sockopt IP_MINTTL to %d on socket %d: %s",
> +               minttl, sock, safe_strerror (errno));
> +      return ret;
> +    }
> +#endif /* IP_MINTTL */
> +#ifdef IPV6_MINHOPCNT
> +  if (family == AF_INET6)
>     {
> -      zlog (NULL, LOG_WARNING,
> -           "can't set sockopt IP_MINTTL to %d on socket %d: %s",
> -           minttl, sock, safe_strerror (errno));
> -      return -1;
> +      int ret = setsockopt (sock, IPPROTO_IPV6, IPV6_MINHOPCNT, &minttl,
> sizeof(minttl));
> +      if (ret < 0)
> +         zlog (NULL, LOG_WARNING,
> +               "can't set sockopt IPV6_MINHOPCNT to %d on socket %d: %s",
> +               minttl, sock, safe_strerror (errno));
> +      return ret;
>     }
> +#endif
>
> -  return 0;
> -#else
>   errno = EOPNOTSUPP;
>   return -1;
> -#endif /* IP_MINTTL */
>  }
>
>  /* If same family and same prefix return 1. */
>
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev at lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20100808/b3bf2c46/attachment-0001.html>


More information about the Quagga-dev mailing list