diff options
-rw-r--r-- | net/ipv6/ip6_fib.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 9239d559b41b..e8a0fcf8850a 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -635,10 +635,9 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, | |||
635 | { | 635 | { |
636 | struct rt6_info *iter = NULL; | 636 | struct rt6_info *iter = NULL; |
637 | struct rt6_info **ins; | 637 | struct rt6_info **ins; |
638 | int replace = (NULL != info && | 638 | int replace = (NULL != info->nlh && |
639 | NULL != info->nlh && | ||
640 | (info->nlh->nlmsg_flags&NLM_F_REPLACE)); | 639 | (info->nlh->nlmsg_flags&NLM_F_REPLACE)); |
641 | int add = ((NULL == info || NULL == info->nlh) || | 640 | int add = (NULL == info->nlh || |
642 | (info->nlh->nlmsg_flags&NLM_F_CREATE)); | 641 | (info->nlh->nlmsg_flags&NLM_F_CREATE)); |
643 | int found = 0; | 642 | int found = 0; |
644 | 643 | ||
@@ -755,7 +754,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) | |||
755 | int err = -ENOMEM; | 754 | int err = -ENOMEM; |
756 | int allow_create = 1; | 755 | int allow_create = 1; |
757 | int replace_required = 0; | 756 | int replace_required = 0; |
758 | if (NULL != info && NULL != info->nlh) { | 757 | if (NULL != info->nlh) { |
759 | if (!(info->nlh->nlmsg_flags&NLM_F_CREATE)) | 758 | if (!(info->nlh->nlmsg_flags&NLM_F_CREATE)) |
760 | allow_create = 0; | 759 | allow_create = 0; |
761 | if ((info->nlh->nlmsg_flags&NLM_F_REPLACE)) | 760 | if ((info->nlh->nlmsg_flags&NLM_F_REPLACE)) |