]> granicus.if.org Git - sudo/commitdiff
Move union sudo_in_addr_un into interfaces.h
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Jun 2010 18:53:34 +0000 (14:53 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Jun 2010 18:53:34 +0000 (14:53 -0400)
--HG--
branch : 1.7

interfaces.h
match.c

index b9591af45e020d9ac0683b1e26be4d163cee2e48..06b0b8571db0a753d02796d741c8e46e4bcde19a 100644 (file)
 #ifndef _SUDO_INTERFACES_H
 #define _SUDO_INTERFACES_H
 
+/*
+ * Union to hold either strucr in_addr or in6_add
+ */
+union sudo_in_addr_un {
+    struct in_addr ip4;
+#ifdef HAVE_IN6_ADDR
+    struct in6_addr ip6;
+#endif
+};
+
 /*
  * IP address and netmask pairs for checking against local interfaces.
  */
 struct interface {
     int family;        /* AF_INET or AF_INET6 */
-    union {
-       struct in_addr ip4;
-#ifdef HAVE_IN6_ADDR
-       struct in6_addr ip6;
-#endif
-    } addr;
-    union {
-       struct in_addr ip4;
-#ifdef HAVE_IN6_ADDR
-       struct in6_addr ip6;
-#endif
-    } netmask;
+    union sudo_in_addr_un addr;
+    union sudo_in_addr_un netmask;
 };
 
 /*
diff --git a/match.c b/match.c
index 7ba89a853dae3ef81513150c1a83144446494601..369130ce812b418cc694bc0958887133bf3f9510 100644 (file)
--- a/match.c
+++ b/match.c
@@ -105,13 +105,6 @@ static int command_matches_normal __P((char *, char *));
  */
 #define has_meta(s)    (strpbrk(s, "\\?*[]") != NULL)
 
-union sudo_in_addr_un {
-    struct in_addr ip4;
-#ifdef HAVE_IN6_ADDR
-    struct in6_addr ip6;
-#endif
-};
-
 /*
  * Check for user described by pw in a list of members.
  * Returns ALLOW, DENY or UNSPEC.