diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-02 13:49:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-02 13:49:21 -0500 |
commit | b3613118eb30a589d971e4eccbbb2a1314f5dfd4 (patch) | |
tree | 868c1ee59e1b5c19a4f2e43716400d0001a994e5 /net/netlabel | |
parent | 7505afe28c16a8d386624930a018d0052c75d687 (diff) | |
parent | 5983fe2b29df5885880d7fa3b91aca306c7564ef (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/netlabel')
-rw-r--r-- | net/netlabel/netlabel_kapi.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 3735297c524d..5952237c0c86 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c | |||
@@ -111,8 +111,6 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
111 | struct netlbl_domaddr_map *addrmap = NULL; | 111 | struct netlbl_domaddr_map *addrmap = NULL; |
112 | struct netlbl_domaddr4_map *map4 = NULL; | 112 | struct netlbl_domaddr4_map *map4 = NULL; |
113 | struct netlbl_domaddr6_map *map6 = NULL; | 113 | struct netlbl_domaddr6_map *map6 = NULL; |
114 | const struct in_addr *addr4, *mask4; | ||
115 | const struct in6_addr *addr6, *mask6; | ||
116 | 114 | ||
117 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); | 115 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
118 | if (entry == NULL) | 116 | if (entry == NULL) |
@@ -133,9 +131,9 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
133 | INIT_LIST_HEAD(&addrmap->list6); | 131 | INIT_LIST_HEAD(&addrmap->list6); |
134 | 132 | ||
135 | switch (family) { | 133 | switch (family) { |
136 | case AF_INET: | 134 | case AF_INET: { |
137 | addr4 = addr; | 135 | const struct in_addr *addr4 = addr; |
138 | mask4 = mask; | 136 | const struct in_addr *mask4 = mask; |
139 | map4 = kzalloc(sizeof(*map4), GFP_ATOMIC); | 137 | map4 = kzalloc(sizeof(*map4), GFP_ATOMIC); |
140 | if (map4 == NULL) | 138 | if (map4 == NULL) |
141 | goto cfg_unlbl_map_add_failure; | 139 | goto cfg_unlbl_map_add_failure; |
@@ -148,9 +146,11 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
148 | if (ret_val != 0) | 146 | if (ret_val != 0) |
149 | goto cfg_unlbl_map_add_failure; | 147 | goto cfg_unlbl_map_add_failure; |
150 | break; | 148 | break; |
151 | case AF_INET6: | 149 | } |
152 | addr6 = addr; | 150 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
153 | mask6 = mask; | 151 | case AF_INET6: { |
152 | const struct in6_addr *addr6 = addr; | ||
153 | const struct in6_addr *mask6 = mask; | ||
154 | map6 = kzalloc(sizeof(*map6), GFP_ATOMIC); | 154 | map6 = kzalloc(sizeof(*map6), GFP_ATOMIC); |
155 | if (map6 == NULL) | 155 | if (map6 == NULL) |
156 | goto cfg_unlbl_map_add_failure; | 156 | goto cfg_unlbl_map_add_failure; |
@@ -167,6 +167,8 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
167 | if (ret_val != 0) | 167 | if (ret_val != 0) |
168 | goto cfg_unlbl_map_add_failure; | 168 | goto cfg_unlbl_map_add_failure; |
169 | break; | 169 | break; |
170 | } | ||
171 | #endif /* IPv6 */ | ||
170 | default: | 172 | default: |
171 | goto cfg_unlbl_map_add_failure; | 173 | goto cfg_unlbl_map_add_failure; |
172 | break; | 174 | break; |
@@ -225,9 +227,11 @@ int netlbl_cfg_unlbl_static_add(struct net *net, | |||
225 | case AF_INET: | 227 | case AF_INET: |
226 | addr_len = sizeof(struct in_addr); | 228 | addr_len = sizeof(struct in_addr); |
227 | break; | 229 | break; |
230 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
228 | case AF_INET6: | 231 | case AF_INET6: |
229 | addr_len = sizeof(struct in6_addr); | 232 | addr_len = sizeof(struct in6_addr); |
230 | break; | 233 | break; |
234 | #endif /* IPv6 */ | ||
231 | default: | 235 | default: |
232 | return -EPFNOSUPPORT; | 236 | return -EPFNOSUPPORT; |
233 | } | 237 | } |
@@ -266,9 +270,11 @@ int netlbl_cfg_unlbl_static_del(struct net *net, | |||
266 | case AF_INET: | 270 | case AF_INET: |
267 | addr_len = sizeof(struct in_addr); | 271 | addr_len = sizeof(struct in_addr); |
268 | break; | 272 | break; |
273 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
269 | case AF_INET6: | 274 | case AF_INET6: |
270 | addr_len = sizeof(struct in6_addr); | 275 | addr_len = sizeof(struct in6_addr); |
271 | break; | 276 | break; |
277 | #endif /* IPv6 */ | ||
272 | default: | 278 | default: |
273 | return -EPFNOSUPPORT; | 279 | return -EPFNOSUPPORT; |
274 | } | 280 | } |