From: Thomas Graf Date: Sun, 19 Jun 2005 05:51:26 +0000 (-0700) Subject: [NETLINK]: Fix RTA_NEST_CANCEL(). X-Git-Tag: v2.6.13-rc1~90^2~583^2~33 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c52a3f89f882b84fc422000655c023fe73e701cf;p=linux-2.6 [NETLINK]: Fix RTA_NEST_CANCEL(). Only skb_trim() if 'start' is non-NULL. Signed-off-by: Thomas Graf Signed-off-by: David S. Miller --- diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 5a5cda1602..6fff8c4c99 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -924,7 +924,8 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi (skb)->len; }) #define RTA_NEST_CANCEL(skb, start) \ -({ skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ +({ if (start) \ + skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ -1; }) #define RTA_GET_U32(rta) \