Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78393
b: refs/heads/master
c: 853cbba
h: refs/heads/master
i:
  78391: 74ad210
v: v3
  • Loading branch information
Daniel Lezcano authored and David S. Miller committed Jan 28, 2008
1 parent b5dc4d8 commit 7bc2201
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 248b238dc960a42aa235057ba0a51a98ae2b0f0d
refs/heads/master: 853cbbaaa4ccdf221be5ab6afe967aa9998546b7
3 changes: 2 additions & 1 deletion trunk/include/net/transp_v6.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ struct flowi;
/* extention headers */
extern int ipv6_exthdrs_init(void);
extern void ipv6_exthdrs_exit(void);
extern void ipv6_frag_init(void);
extern int ipv6_frag_init(void);
extern void ipv6_frag_exit(void);

/* transport protocols */
extern void rawv6_init(void);
Expand Down
8 changes: 6 additions & 2 deletions trunk/net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,9 @@ static int __init inet6_init(void)
if (err)
goto ipv6_exthdrs_fail;

ipv6_frag_init();
err = ipv6_frag_init();
if (err)
goto ipv6_frag_fail;

/* Init v6 transport protocols. */
udpv6_init();
Expand All @@ -875,6 +877,8 @@ static int __init inet6_init(void)
out:
return err;

ipv6_frag_fail:
ipv6_exthdrs_exit();
ipv6_exthdrs_fail:
addrconf_cleanup();
addrconf_fail:
Expand Down Expand Up @@ -934,7 +938,7 @@ static void __exit inet6_exit(void)

/* Cleanup code parts. */
ipv6_packet_cleanup();

ipv6_frag_exit();
ipv6_exthdrs_exit();
addrconf_cleanup();
ip6_flowlabel_cleanup();
Expand Down
16 changes: 13 additions & 3 deletions trunk/net/ipv6/reassembly.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,13 @@ static struct inet6_protocol frag_protocol =
.flags = INET6_PROTO_NOPOLICY,
};

void __init ipv6_frag_init(void)
int __init ipv6_frag_init(void)
{
if (inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT) < 0)
printk(KERN_ERR "ipv6_frag_init: Could not register protocol\n");
int ret;

ret = inet6_add_protocol(&frag_protocol, IPPROTO_FRAGMENT);
if (ret)
goto out;
ip6_frags.ctl = &ip6_frags_ctl;
ip6_frags.hashfn = ip6_hashfn;
ip6_frags.constructor = ip6_frag_init;
Expand All @@ -646,4 +648,12 @@ void __init ipv6_frag_init(void)
ip6_frags.match = ip6_frag_match;
ip6_frags.frag_expire = ip6_frag_expire;
inet_frags_init(&ip6_frags);
out:
return ret;
}

void ipv6_frag_exit(void)
{
inet_frags_fini(&ip6_frags);
inet6_del_protocol(&frag_protocol, IPPROTO_FRAGMENT);
}

0 comments on commit 7bc2201

Please sign in to comment.