Permalink
Browse files

move readonly IN6_IFF_xx check to upwards

  • Loading branch information...
1 parent ed76ad9 commit 3e5397ac647f303f76235b7dc97f634b9df860b0 itojun committed Sep 22, 2002
Showing with 9 additions and 10 deletions.
  1. +9 −10 kame/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $KAME: in6.c,v 1.309 2002/09/22 01:55:53 itojun Exp $ */
+/* $KAME: in6.c,v 1.310 2002/09/22 02:20:47 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -799,6 +799,14 @@ in6_control(so, cmd, data, ifp)
int i, error = 0;
struct nd_prefix pr0, *pr;
+ /* reject read-only flags */
+ if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 ||
+ (ifra->ifra_flags & IN6_IFF_DETACHED) != 0 ||
+ (ifra->ifra_flags & IN6_IFF_NODAD) != 0 ||
+ (ifra->ifra_flags & IN6_IFF_AUTOCONF) != 0 ||
+ (ifra->ifra_flags & IN6_IFF_TEMPORARY) != 0) {
+ return (EINVAL);
+ }
/*
* first, make or update the interface address structure,
* and link it to the list.
@@ -1233,15 +1241,6 @@ in6_update_ifa(ifp, ifra, ia)
/*
* configure address flags.
*/
- /* reject read-only flags */
- if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 ||
- (ifra->ifra_flags & IN6_IFF_DETACHED) != 0 ||
- (ifra->ifra_flags & IN6_IFF_NODAD) != 0 ||
- (ifra->ifra_flags & IN6_IFF_AUTOCONF) != 0 ||
- (ifra->ifra_flags & IN6_IFF_TEMPORARY) != 0) {
- error = EINVAL;
- goto unlink;
- }
ia->ia6_flags = ifra->ifra_flags;
/*
* backward compatibility - if IN6_IFF_DEPRECATED is set from the

0 comments on commit 3e5397a

Please sign in to comment.