ipcomp6.c (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) | ipcomp6.c (72cb6962a91f2af9eef69a06198e1949c10259ae) |
---|---|
1/* 2 * IP Payload Compression Protocol (IPComp) for IPv6 - RFC3173 3 * 4 * Copyright (C)2003 USAGI/WIDE Project 5 * 6 * Author Mitsuru KANDA <mk@linux-ipv6.org> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 220 unchanged lines hidden (view full) --- 229 t->id.proto = IPPROTO_IPV6; 230 t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr); 231 memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr)); 232 memcpy(&t->sel, &x->sel, sizeof(t->sel)); 233 t->props.family = AF_INET6; 234 t->props.mode = 1; 235 memcpy(t->props.saddr.a6, x->props.saddr.a6, sizeof(struct in6_addr)); 236 | 1/* 2 * IP Payload Compression Protocol (IPComp) for IPv6 - RFC3173 3 * 4 * Copyright (C)2003 USAGI/WIDE Project 5 * 6 * Author Mitsuru KANDA <mk@linux-ipv6.org> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 220 unchanged lines hidden (view full) --- 229 t->id.proto = IPPROTO_IPV6; 230 t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr); 231 memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr)); 232 memcpy(&t->sel, &x->sel, sizeof(t->sel)); 233 t->props.family = AF_INET6; 234 t->props.mode = 1; 235 memcpy(t->props.saddr.a6, x->props.saddr.a6, sizeof(struct in6_addr)); 236 |
237 t->type = xfrm_get_type(IPPROTO_IPV6, t->props.family); 238 if (t->type == NULL) | 237 if (xfrm_init_state(t)) |
239 goto error; 240 | 238 goto error; 239 |
241 if (t->type->init_state(t, NULL)) 242 goto error; 243 244 t->km.state = XFRM_STATE_VALID; | |
245 atomic_set(&t->tunnel_users, 1); 246 247out: 248 return t; 249 250error: 251 xfrm_state_put(t); 252 goto out; --- 162 unchanged lines hidden (view full) --- 415 down(&ipcomp6_resource_sem); 416 ipcomp6_free_data(ipcd); 417 up(&ipcomp6_resource_sem); 418 kfree(ipcd); 419 420 xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr); 421} 422 | 240 atomic_set(&t->tunnel_users, 1); 241 242out: 243 return t; 244 245error: 246 xfrm_state_put(t); 247 goto out; --- 162 unchanged lines hidden (view full) --- 410 down(&ipcomp6_resource_sem); 411 ipcomp6_free_data(ipcd); 412 up(&ipcomp6_resource_sem); 413 kfree(ipcd); 414 415 xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr); 416} 417 |
423static int ipcomp6_init_state(struct xfrm_state *x, void *args) | 418static int ipcomp6_init_state(struct xfrm_state *x) |
424{ 425 int err; 426 struct ipcomp_data *ipcd; 427 struct xfrm_algo_desc *calg_desc; 428 429 err = -EINVAL; 430 if (!x->calg) 431 goto out; --- 93 unchanged lines hidden --- | 419{ 420 int err; 421 struct ipcomp_data *ipcd; 422 struct xfrm_algo_desc *calg_desc; 423 424 err = -EINVAL; 425 if (!x->calg) 426 goto out; --- 93 unchanged lines hidden --- |