diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-06-17 13:20:30 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-06-17 13:20:30 +0000 |
commit | 7acb77a6e7bddd4c4c5aa975bbf976927c013798 (patch) | |
tree | 4139829ec6edb85f73774bb95cdec376758bfc73 /net/ax25/af_ax25.c | |
parent | 64d58d4c8cd6a89ee218301ec0dc0ebfec91a4db (diff) |
Merge with 2.1.43.
Diffstat (limited to 'net/ax25/af_ax25.c')
-rw-r--r-- | net/ax25/af_ax25.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index fe5d4dca6..37b679600 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -148,6 +148,11 @@ void ax25_free_cb(ax25_cb *ax25) MOD_DEC_USE_COUNT; } +static void ax25_free_sock(struct sock *sk) +{ + ax25_free_cb(sk->protinfo.ax25); +} + /* * Socket removal during an interrupt is now safe. */ @@ -428,7 +433,6 @@ void ax25_destroy_socket(ax25_cb *ax25) /* Not static as it's used by the timer add_timer(&ax25->timer); } else { sk_free(ax25->sk); - ax25_free_cb(ax25); } } else { ax25_free_cb(ax25); @@ -858,7 +862,8 @@ int ax25_create(struct socket *sock, int protocol) } sock_init_data(sock, sk); - + + sk->destruct = ax25_free_sock; sock->ops = &ax25_proto_ops; sk->protocol = protocol; sk->mtu = AX25_MTU; /* 256 */ @@ -894,7 +899,8 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev) } sock_init_data(NULL, sk); - + + sk->destruct = ax25_free_sock; sk->type = osk->type; sk->socket = osk->socket; sk->priority = osk->priority; @@ -926,7 +932,6 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev) if (osk->protinfo.ax25->digipeat != NULL) { if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { sk_free(sk); - ax25_free_cb(ax25); return NULL; } @@ -1182,8 +1187,8 @@ static int ax25_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le #ifdef CONFIG_AX25_DAMA_SLAVE case AX25_PROTO_DAMA_SLAVE: - ax25->modulus = AX25_MODULUS; - ax25->window = ax25->ax25_dev->values[AX25_VALUES_WINDOW]; + sk->protinfo.ax25->modulus = AX25_MODULUS; + sk->protinfo.ax25->window = sk->protinfo.ax25->ax25_dev->values[AX25_VALUES_WINDOW]; if (sk->protinfo.ax25->ax25_dev->dama.slave) ax25_ds_establish_data_link(sk->protinfo.ax25); else |