aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/mcast_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/mcast_user.c')
-rw-r--r--arch/um/drivers/mcast_user.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index b827e82884c9..d319db16d4ec 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -20,7 +20,6 @@
20#include "net_user.h" 20#include "net_user.h"
21#include "mcast.h" 21#include "mcast.h"
22#include "kern_util.h" 22#include "kern_util.h"
23#include "user_util.h"
24#include "user.h" 23#include "user.h"
25#include "os.h" 24#include "os.h"
26#include "um_malloc.h" 25#include "um_malloc.h"
@@ -34,20 +33,21 @@ static struct sockaddr_in *new_addr(char *addr, unsigned short port)
34 sin = um_kmalloc(sizeof(struct sockaddr_in)); 33 sin = um_kmalloc(sizeof(struct sockaddr_in));
35 if(sin == NULL){ 34 if(sin == NULL){
36 printk("new_addr: allocation of sockaddr_in failed\n"); 35 printk("new_addr: allocation of sockaddr_in failed\n");
37 return(NULL); 36 return NULL;
38 } 37 }
39 sin->sin_family = AF_INET; 38 sin->sin_family = AF_INET;
40 sin->sin_addr.s_addr = in_aton(addr); 39 sin->sin_addr.s_addr = in_aton(addr);
41 sin->sin_port = htons(port); 40 sin->sin_port = htons(port);
42 return(sin); 41 return sin;
43} 42}
44 43
45static void mcast_user_init(void *data, void *dev) 44static int mcast_user_init(void *data, void *dev)
46{ 45{
47 struct mcast_data *pri = data; 46 struct mcast_data *pri = data;
48 47
49 pri->mcast_addr = new_addr(pri->addr, pri->port); 48 pri->mcast_addr = new_addr(pri->addr, pri->port);
50 pri->dev = dev; 49 pri->dev = dev;
50 return 0;
51} 51}
52 52
53static void mcast_remove(void *data) 53static void mcast_remove(void *data)
@@ -107,8 +107,8 @@ static int mcast_open(void *data)
107 err = -errno; 107 err = -errno;
108 printk("mcast_open : data bind failed, errno = %d\n", errno); 108 printk("mcast_open : data bind failed, errno = %d\n", errno);
109 goto out_close; 109 goto out_close;
110 } 110 }
111 111
112 /* subscribe to the multicast group */ 112 /* subscribe to the multicast group */
113 mreq.imr_multiaddr.s_addr = sin->sin_addr.s_addr; 113 mreq.imr_multiaddr.s_addr = sin->sin_addr.s_addr;
114 mreq.imr_interface.s_addr = 0; 114 mreq.imr_interface.s_addr = 0;
@@ -153,12 +153,12 @@ int mcast_user_write(int fd, void *buf, int len, struct mcast_data *pri)
153{ 153{
154 struct sockaddr_in *data_addr = pri->mcast_addr; 154 struct sockaddr_in *data_addr = pri->mcast_addr;
155 155
156 return(net_sendto(fd, buf, len, data_addr, sizeof(*data_addr))); 156 return net_sendto(fd, buf, len, data_addr, sizeof(*data_addr));
157} 157}
158 158
159static int mcast_set_mtu(int mtu, void *data) 159static int mcast_set_mtu(int mtu, void *data)
160{ 160{
161 return(mtu); 161 return mtu;
162} 162}
163 163
164const struct net_user_info mcast_user_info = { 164const struct net_user_info mcast_user_info = {